Diffstat (limited to 'libopie2/opiepim/ui/opimmainwindow.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/ui/opimmainwindow.h | 65 |
1 files changed, 60 insertions, 5 deletions
diff --git a/libopie2/opiepim/ui/opimmainwindow.h b/libopie2/opiepim/ui/opimmainwindow.h index abad630..4aed8b8 100644 --- a/libopie2/opiepim/ui/opimmainwindow.h +++ b/libopie2/opiepim/ui/opimmainwindow.h | |||
@@ -26,17 +26,24 @@ | |||
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef OPIE_PIM_MAINWINDOW_H | 29 | #ifndef OPIE_PIM_MAINWINDOW_H |
30 | #define OPIE_PIM_MAINWINDOW_H | 30 | #define OPIE_PIM_MAINWINDOW_H |
31 | 31 | ||
32 | #include <opie2/opimrecord.h> | ||
33 | |||
34 | #include <qpe/categories.h> | ||
35 | #include <qpe/config.h> | ||
36 | |||
32 | #include <qmainwindow.h> | 37 | #include <qmainwindow.h> |
33 | 38 | ||
34 | #include <opie2/opimrecord.h> | 39 | class QAction; |
40 | class QActionGroup; | ||
35 | class QCopChannel; | 41 | class QCopChannel; |
36 | class QDateTime; | 42 | class QDateTime; |
43 | class QPopupMenu; | ||
37 | 44 | ||
38 | namespace Opie { | 45 | namespace Opie { |
39 | /** | 46 | /** |
40 | * This is a common Opie PIM MainWindow | 47 | * This is a common Opie PIM MainWindow |
41 | * it takes care of the QCOP internals | 48 | * it takes care of the QCOP internals |
42 | * and implements some functions | 49 | * and implements some functions |
@@ -53,14 +60,18 @@ namespace Opie { | |||
53 | class OPimMainWindow : public QMainWindow { | 60 | class OPimMainWindow : public QMainWindow { |
54 | Q_OBJECT | 61 | Q_OBJECT |
55 | public: | 62 | public: |
56 | enum TransPort { BlueTooth=0, | 63 | enum TransPort { BlueTooth=0, |
57 | IrDa }; | 64 | IrDa }; |
58 | 65 | ||
59 | OPimMainWindow( const QString& service, QWidget *parent = 0, const char* name = 0, | 66 | OPimMainWindow( const QString &serviceName, |
60 | WFlags f = WType_TopLevel); | 67 | const QString &appName = QString::null, |
68 | const QString &catName = QString::null, | ||
69 | const QString &itemName = QString::null, | ||
70 | const QString &configName = QString::null, | ||
71 | QWidget *parent = 0l, const char* name = 0l, WFlags f = WType_TopLevel ); | ||
61 | virtual ~OPimMainWindow(); | 72 | virtual ~OPimMainWindow(); |
62 | 73 | ||
63 | 74 | ||
64 | protected slots: | 75 | protected slots: |
65 | /* | 76 | /* |
66 | * called when a setDocument | 77 | * called when a setDocument |
@@ -87,43 +98,87 @@ protected slots: | |||
87 | virtual void add( const OPimRecord& ) = 0; | 98 | virtual void add( const OPimRecord& ) = 0; |
88 | 99 | ||
89 | virtual void doAlarm( const QDateTime&, int uid ); | 100 | virtual void doAlarm( const QDateTime&, int uid ); |
90 | 101 | ||
91 | QCopChannel* channel(); | 102 | QCopChannel* channel(); |
92 | 103 | ||
104 | /** UI-related slots */ | ||
105 | virtual void slotItemNew() = 0; | ||
106 | virtual void slotItemEdit() = 0; | ||
107 | virtual void slotItemDuplicate() = 0; | ||
108 | virtual void slotItemDelete() = 0; | ||
109 | virtual void slotItemBeam() = 0; | ||
110 | virtual void slotItemFind() = 0; | ||
111 | virtual void slotConfigure() = 0; | ||
112 | |||
93 | protected: | 113 | protected: |
94 | /** | 114 | /** |
95 | * start to play soundAlarm() | 115 | * start to play soundAlarm() |
96 | * @param count How many times the alarm is played | 116 | * @param count How many times the alarm is played |
97 | */ | 117 | */ |
98 | void startAlarm(int count = 10); | 118 | void startAlarm( int count = 10 ); |
99 | void killAlarm(); | 119 | void killAlarm(); |
100 | void timerEvent( QTimerEvent* ); | 120 | void timerEvent( QTimerEvent* ); |
101 | 121 | ||
122 | /** UI-related functions */ | ||
123 | QPopupMenu *itemContextMenu(); | ||
124 | |||
125 | void insertItemMenuItems( QActionGroup *items ); | ||
126 | void insertViewMenuItems( QActionGroup *items ); | ||
127 | |||
128 | void setViewCategory( const QString &category ); | ||
129 | void reloadCategories(); | ||
130 | |||
102 | private slots: | 131 | private slots: |
103 | void appMessage( const QCString&, const QByteArray& ); | 132 | void appMessage( const QCString&, const QByteArray& ); |
104 | void setDocument( const QString& ); | 133 | void setDocument( const QString& ); |
105 | 134 | ||
106 | 135 | /** UI-related slots */ | |
136 | void slotViewCategory( QAction *category ); | ||
137 | |||
107 | private: | 138 | private: |
108 | class Private; | 139 | class Private; |
109 | Private* d; | 140 | Private* d; |
110 | 141 | ||
111 | int m_rtti; | 142 | int m_rtti; |
112 | QCopChannel* m_channel; | 143 | QCopChannel* m_channel; |
113 | QString m_service; | 144 | QString m_service; |
114 | QCString m_str; | 145 | QCString m_str; |
115 | OPimRecord* m_fallBack; | 146 | OPimRecord* m_fallBack; |
116 | int m_alarmCount; | 147 | int m_alarmCount; |
117 | int m_playedCount; | 148 | int m_playedCount; |
118 | int m_timerId; | 149 | int m_timerId; |
150 | |||
151 | QString m_appName; // Name of application for title bar | ||
152 | QString m_catGroupName; // Name of category group | ||
153 | Config m_config; // Configuration settings file | ||
154 | |||
155 | // Menu bar data | ||
156 | QPopupMenu *m_itemContextMenu; // Pointer to context-sensitive menu | ||
157 | QPopupMenu *m_itemMenu; // Pointer to item menu | ||
158 | QPopupMenu *m_viewMenu; // Pointer to view menu | ||
159 | QActionGroup *m_itemMenuGroup1; // Action group containing default items in Item menu | ||
160 | QActionGroup *m_itemMenuGroup2; // Action group containing default items in Item menu | ||
161 | QActionGroup *m_viewMenuAppGroup; // Action group containing application items in View menu | ||
162 | QActionGroup *m_viewMenuGroup; // Action group containing default items in View menu | ||
163 | QActionGroup *m_viewMenuCategories; // Pointer to action group containing categories in View menu | ||
164 | QAction *m_itemEditAction; // Edit current item action | ||
165 | QAction *m_itemDuplicateAction; // Duplicate current item action | ||
166 | QAction *m_itemDeleteAction; // Delete current item action | ||
167 | |||
119 | /* I would love to do this as a template | 168 | /* I would love to do this as a template |
120 | * but can't think of a right way | 169 | * but can't think of a right way |
121 | * because I need signal and slots -zecke | 170 | * because I need signal and slots -zecke |
122 | */ | 171 | */ |
123 | virtual OPimRecord* record( int rtti, const QByteArray& ) ; | 172 | virtual OPimRecord* record( int rtti, const QByteArray& ) ; |
124 | int service(); | 173 | int service(); |
174 | |||
175 | /** UI-related functions */ | ||
176 | void initBars( const QString &itemName = tr( "Item" ) ); | ||
177 | |||
178 | signals: | ||
179 | void categorySelected( const QString &cat ); | ||
125 | }; | 180 | }; |
126 | 181 | ||
127 | } | 182 | } |
128 | 183 | ||
129 | #endif | 184 | #endif |