5 //#include "qc_graphicview.h"
6 #include "qg_layerwidget.h"
7 #include "qg_pentoolbar.h"
8 #include "rs_document.h"
10 class RS_EventHandler;
14 * MDI document window. Contains a document and a view (window).
16 * @author Andrew Mustun
18 class MDIWindow: public QMdiSubWindow
23 MDIWindow(RS_Document * doc, QWidget * parent, const char * name = NULL,
24 // Qt::WindowFlags wflags = Qt::WDestructiveClose);
25 Qt::WindowFlags wflags = Qt::SubWindow);
28 void initDoc(RS_Document * doc = NULL);
32 void slotPenChanged(RS_Pen p);
34 bool slotFileOpen(const QString & fileName, RS2::FormatType type);
35 bool slotFileSave(bool & cancelled);
36 bool slotFileSaveAs(bool & cancelled);
37 bool slotFileClose(bool force);
41 // QC_GraphicView * getGraphicView();
42 QG_GraphicView * getGraphicView();
43 RS_Document * getDocument();
44 Drawing * getGraphic();
45 RS_EventHandler * getEventHandler();
47 void addChildWindow(MDIWindow * w);
48 void removeChildWindow(MDIWindow * w);
49 MDIWindow * getPrintPreview();
50 void setParentWindow(MDIWindow * p);
53 bool closeMDI(bool force, bool ask = true);
55 void setForceClosing(bool on);
57 friend std::ostream & operator<<(std::ostream & os, MDIWindow & w);
63 void closeEvent(QCloseEvent *);
68 /** ID counter (class variable) */
71 //let's see if we can get rid of this...
72 // QC_GraphicView * graphicView;
73 QG_GraphicView * graphicView;
75 RS_Document * document;
76 /** Does the window own the document? */
79 * List of known child windows that show blocks of the same drawing.
81 QList<MDIWindow *> childWindows;
83 * Pointer to parent window which needs to know if this window
86 MDIWindow * parentWindow;
88 * If flag is set, the user will not be asked about closing this file.