00001 #ifndef DATE_BOOK_MAIN_WINDOW_H 00002 #define DATE_BOOK_MAIN_WINDOW_H 00003 00004 #include <qlist.h> 00005 00006 #include <opie/opimmainwindow.h> 00007 00008 #include "descriptionmanager.h" 00009 #include "locationmanager.h" 00010 #include "templatemanager.h" 00011 #include "view.h" 00012 00013 class QAction; 00014 class QWidgetStack; 00015 class QPopupMenu; 00016 class QToolBar; 00017 namespace Datebook { 00018 class BookManager; 00019 class Show; 00020 class Editor; 00021 class MainWindow : public OPimMainWindow { 00022 Q_OBJECT 00023 friend class Show; // to avoid QObject 00024 friend class View; // to avoid QObject 00025 friend class Editor; 00026 public: 00027 MainWindow(); 00028 ~MainWindow(); 00029 00030 private slots: 00031 void initUI(); // init the UI 00032 void initConfig(); // apply the config 00033 void initView(); // init the Views.. 00034 void initManagers(); // init the Managers including templates, location and description 00035 void raiseCurrentView(); // raise the current View 00036 void slotGoToNow(); // will switch the currentView to the curren date time 00037 void slotFind(); // find!!! 00038 void slotConfigure(); // configure the app 00039 void slotClockChanged(bool); // clock changed 00040 void slotWeekChanged( bool ); // week changed 00041 void slotAppMessage( const QCString&, const QByteArray& ); // qApp message QPE/Application/datebook 00042 void slotReceive( const QCString&, const QByteArray& ); // QPE/System and QPE/Datebook 00043 void slotAction( QAction* ); // View changed 00044 void slotConfigureLocs(); // Configure the Locations 00045 void slotConfigureDesc(); // Configure the Desc 00046 void slotConfigureTemp(); 00047 void slotNewFromTemplate(int ); // called when someone chooses the template menu 00048 00049 void setTemplateMenu(); // updates the templateMenu 00050 00051 protected slots: 00052 void populate(); 00053 void doSetDocument( const QString& str ); 00054 void flush(); 00055 void reload(); 00056 int create(); 00057 bool remove( int uid ); 00058 void beam( int uid ); 00059 void show( int uid ); 00060 void edit( int uid ); 00061 void edit(); 00062 void add( const OPimRecord& ); 00063 00064 private: 00065 QToolBar* toolbar(); 00066 QPopupMenu* viewMenu(); 00067 QPopupMenu* settingsMenu(); 00068 QPopupMenu* templateMenu(); 00069 View* currentView(); 00070 BookManager* manager(); 00071 TemplateManager templateManager(); 00072 LocationManager locationManager(); 00073 DescriptionManager descriptionManager(); 00074 void setLocationManager( const LocationManager& ); 00075 void setDescriptionManager( const DescriptionManager& ); 00076 Show* eventShow(); 00077 Editor* editor(); 00078 00079 private: // friend functions for Show 00080 void hideShow(); // to hide the view 00081 // off friend Show 00082 00083 // friend of the view 00084 private: 00085 void viewPopup( int ); 00086 void viewAdd( const QDate& date ); 00087 void viewAdd( const QDateTime&, const QDateTime& ); 00088 bool viewAP()const; 00089 bool viewStartMonday()const; 00090 // off view show 00091 private: 00092 QList<View> m_view; // the Views.. not autoDelete 00093 QWidgetStack* m_stack; 00094 QToolBar *m_toolBar; 00095 QPopupMenu* m_popView; 00096 QPopupMenu* m_popSetting; 00097 QPopupMenu* m_popTemplate; 00098 BookManager* m_manager; 00099 TemplateManager m_tempMan; 00100 DescriptionManager m_descMan; 00101 LocationManager m_locMan; 00102 Show* m_show; 00103 Editor* m_edit; 00104 }; 00105 } 00106 00107 #endif
1.4.2