00001 /* -*- mode: c++ -*- */ 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> // for version 00024 00025 #include <list> 00026 #include <string> 00027 00028 class QAssistantClient; 00029 class QRect; 00030 00031 namespace hippodraw { 00032 00033 class CanvasWindow; 00034 class Inspector; 00035 00054 class MDL_QTHIPPOPLOT_API WindowController 00055 { 00056 00057 private: 00058 00060 static WindowController * s_instance; 00061 00063 std::list < CanvasWindow * > m_window_list; 00064 00066 CanvasWindow * m_active_window; 00067 00069 Inspector * m_inspector; 00070 00073 QAssistantClient * m_assistant; 00074 00080 static std::string s_version; 00081 00085 bool m_quit; 00086 00088 #if QT_VERSION < 0x040000 00089 const QRect & getScreenRect (); 00090 #else 00091 QRect getScreenRect (); 00092 #endif 00093 00096 void positionCanvas ( CanvasWindow * window ); 00097 00101 void resizeCanvas ( CanvasWindow * window ); 00102 00106 void positionInspector (); 00107 00110 void moveInspector ( CanvasWindow * window ); 00111 00112 public: 00113 00116 WindowController ( ); 00117 00119 ~WindowController(); 00120 00122 static WindowController * instance (); 00123 00125 static const std::string & version (); 00126 00128 void createInspector ( ); 00129 00131 void newWindow ( CanvasWindow * ); 00132 00136 void aboutToClose ( CanvasWindow * window ); 00137 00141 void quitOnLastWindowClose ( bool yes = true ); 00142 00147 void hasBeenHidden (); 00148 00151 void unHide ( CanvasWindow * window ); 00152 00157 bool okToQuit (); 00158 00160 CanvasWindow * currentCanvas (); 00161 00166 void setCurrentCanvas ( CanvasWindow * canvas ); 00167 00169 Inspector * getInspector(); 00170 00176 void updateActions (); 00177 00181 void closeAllWindows ( bool alsoDelete ); 00182 00185 void setFirstWindow (); 00186 00189 void openAssistant (); 00190 00191 }; 00192 00193 } // namespace hippodraw 00194 00195 #endif // WindowController_H