00001
00002
00014 #ifndef WindowController_H
00015 #define WindowController_H
00016
00017 #include "qt/libqthippo.h"
00018
00019 #ifdef _MSC_VER
00020 #include <msdevstudio/MSconfig.h>
00021 #endif
00022
00023 #include <qglobal.h>
00024
00025 #include <list>
00026 #include <string>
00027
00028 class CanvasWindow;
00029 class Inspector;
00030 class QRect;
00031
00042 class MDL_QTHIPPOPLOT_API WindowController
00043 {
00044
00045 private:
00046
00048 static WindowController * s_instance;
00049
00051 std::list < CanvasWindow * > m_window_list;
00052
00054 CanvasWindow * m_active_window;
00055
00057 Inspector * m_inspector;
00058
00064 static std::string s_version;
00065
00069 bool m_quit;
00070
00072 #if QT_VERSION < 0x040000
00073 const QRect & getScreenRect ();
00074 #else
00075 QRect getScreenRect ();
00076 #endif
00077
00080 void positionCanvas ( CanvasWindow * window );
00081
00085 void resizeCanvas ( CanvasWindow * window );
00086
00089 void positionInspector ();
00090
00091 public:
00092
00095 WindowController ( );
00096
00098 ~WindowController();
00099
00101 static WindowController * instance ();
00102
00104 static const std::string & version ();
00105
00107 void createInspector ( );
00108
00110 void newWindow ( CanvasWindow * );
00111
00115 void aboutToClose ( CanvasWindow * window );
00116
00120 void quitOnLastWindowClose ( bool yes = true );
00121
00125 void hasBeenHidden ( CanvasWindow * window );
00126
00129 void unHide ( CanvasWindow * window );
00130
00135 bool okToQuit ();
00136
00138 CanvasWindow * currentCanvas ();
00139
00144 void setCurrentCanvas ( CanvasWindow * canvas );
00145
00147 Inspector * getInspector();
00148
00154 void updateActions ();
00155
00159 void closeAllWindows ();
00160
00163 void setFirstWindow ();
00164
00165 };
00166
00167 #endif // WindowController_H