5 #include "qc_graphicview.h"
6 #include "qg_layerwidget.h"
7 #include "qg_recentfiles.h"
8 #include "qg_pentoolbar.h"
9 #include "rs_document.h"
12 * MDI document window. Contains a document and a view (window).
14 * @author Andrew Mustun
16 class MDIWindow: public QMdiSubWindow
21 MDIWindow(RS_Document * doc, QWidget * parent, const char * name = NULL,
22 // Qt::WindowFlags wflags = Qt::WDestructiveClose);
23 Qt::WindowFlags wflags = Qt::SubWindow);
26 void initDoc(RS_Document * doc = NULL);
30 void slotPenChanged(RS_Pen p);
32 bool slotFileOpen(const QString & fileName, RS2::FormatType type);
33 bool slotFileSave(bool & cancelled);
34 bool slotFileSaveAs(bool & cancelled);
35 bool slotFileClose(bool force);
39 QC_GraphicView * getGraphicView();
40 RS_Document * getDocument();
41 Drawing * getGraphic();
42 RS_EventHandler * getEventHandler();
44 void addChildWindow(MDIWindow * w);
45 void removeChildWindow(MDIWindow * w);
46 MDIWindow * getPrintPreview();
47 void setParentWindow(MDIWindow * p);
50 bool closeMDI(bool force, bool ask = true);
52 void setForceClosing(bool on);
54 friend std::ostream & operator<<(std::ostream & os, MDIWindow & w);
60 void closeEvent(QCloseEvent *);
65 /** ID counter (class variable) */
68 QC_GraphicView * graphicView;
70 RS_Document * document;
71 /** Does the window own the document? */
74 * List of known child windows that show blocks of the same drawing.
76 QList<MDIWindow *> childWindows;
78 * Pointer to parent window which needs to know if this window
81 MDIWindow * parentWindow;
83 * If flag is set, the user will not be asked about closing this file.