5 #include "qg_layerwidget.h"
6 #include "qg_pentoolbar.h"
7 #include "rs_document.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::WDestructiveClose);
24 Qt::WindowFlags wflags = Qt::SubWindow);
27 void initDoc(RS_Document * doc = NULL);
31 void slotPenChanged(RS_Pen p);
33 bool slotFileOpen(const QString & fileName, RS2::FormatType type);
34 bool slotFileSave(bool & cancelled);
35 bool slotFileSaveAs(bool & cancelled);
36 bool slotFileClose(bool force);
40 // QC_GraphicView * getGraphicView();
41 QG_GraphicView * getGraphicView();
42 RS_Document * getDocument();
43 Drawing * getGraphic();
44 RS_EventHandler * getEventHandler();
46 void addChildWindow(MDIWindow * w);
47 void removeChildWindow(MDIWindow * w);
48 MDIWindow * getPrintPreview();
49 void setParentWindow(MDIWindow * p);
52 bool closeMDI(bool force, bool ask = true);
54 void setForceClosing(bool on);
56 friend std::ostream & operator<<(std::ostream & os, MDIWindow & w);
62 void closeEvent(QCloseEvent *);
67 /** ID counter (class variable) */
70 //let's see if we can get rid of this...
71 // QC_GraphicView * graphicView;
72 QG_GraphicView * graphicView;
74 RS_Document * document;
75 /** Does the window own the document? */
78 * List of known child windows that show blocks of the same drawing.
80 QList<MDIWindow *> childWindows;
82 * Pointer to parent window which needs to know if this window
85 MDIWindow * parentWindow;
87 * If flag is set, the user will not be asked about closing this file.