5 #include "rs_document.h"
6 #include "layerwidget.h"
7 #include "pentoolbar.h"
13 * MDI document window. Contains a document and a view (window).
15 * @author Andrew Mustun
17 class MDIWindow: public QMdiSubWindow
22 MDIWindow(RS_Document * doc, QWidget * parent, const char * name = NULL,
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 QG_GraphicView * getGraphicView();
40 RS_Document * getDocument();
41 Drawing * getGraphic();
42 RS_EventHandler * getEventHandler();
43 void addChildWindow(MDIWindow * w);
44 void removeChildWindow(MDIWindow * w);
45 MDIWindow * getPrintPreview();
46 void setParentWindow(MDIWindow * p);
48 bool closeMDI(bool force, bool ask = true);
49 void setForceClosing(bool on);
51 friend std::ostream & operator<<(std::ostream & os, MDIWindow & w);
57 void closeEvent(QCloseEvent *);
62 /** ID counter (class variable) */
65 //let's see if we can get rid of this...
66 QG_GraphicView * graphicView;
68 RS_Document * document;
69 /** Does the window own the document? */
72 * List of known child windows that show blocks of the same drawing.
74 QList<MDIWindow *> childWindows;
76 * Pointer to parent window which needs to know if this window
79 MDIWindow * parentWindow;
81 * If flag is set, the user will not be asked about closing this file.