-rw-r--r-- | kaddressbook/kabcore.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 5871d39..c7be343 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -1,79 +1,80 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressbook. | 2 | This file is part of KAddressbook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KABCORE_H | 24 | #ifndef KABCORE_H |
25 | #define KABCORE_H | 25 | #define KABCORE_H |
26 | 26 | ||
27 | #include <kabc/field.h> | 27 | #include <kabc/field.h> |
28 | 28 | ||
29 | #ifndef KAB_EMBEDDED | 29 | #ifndef KAB_EMBEDDED |
30 | #endif //KAB_EMBEDDED | 30 | #endif //KAB_EMBEDDED |
31 | #include <qdict.h> | 31 | #include <qdict.h> |
32 | #include <qtimer.h> | ||
32 | 33 | ||
33 | #include <qwidget.h> | 34 | #include <qwidget.h> |
34 | #include <qpopupmenu.h> | 35 | #include <qpopupmenu.h> |
35 | #include <ksyncmanager.h> | 36 | #include <ksyncmanager.h> |
36 | 37 | ||
37 | namespace KABC { | 38 | namespace KABC { |
38 | class AddressBook; | 39 | class AddressBook; |
39 | } | 40 | } |
40 | 41 | ||
41 | #ifndef KAB_EMBEDDED | 42 | #ifndef KAB_EMBEDDED |
42 | class KAboutData; | 43 | class KAboutData; |
43 | class KConfig; | 44 | class KConfig; |
44 | 45 | ||
45 | class KAddressBookService; | 46 | class KAddressBookService; |
46 | class LDAPSearchDialog; | 47 | class LDAPSearchDialog; |
47 | #else //KAB_EMBEDDED | 48 | #else //KAB_EMBEDDED |
48 | class KAddressBookMain; | 49 | class KAddressBookMain; |
49 | //US class QAction; | 50 | //US class QAction; |
50 | #endif //KAB_EMBEDDED | 51 | #endif //KAB_EMBEDDED |
51 | class KCMultiDialog; | 52 | class KCMultiDialog; |
52 | class KXMLGUIClient; | 53 | class KXMLGUIClient; |
53 | class ExtensionManager; | 54 | class ExtensionManager; |
54 | class XXPortManager; | 55 | class XXPortManager; |
55 | class JumpButtonBar; | 56 | class JumpButtonBar; |
56 | class IncSearchWidget; | 57 | class IncSearchWidget; |
57 | class KDGanttMinimizeSplitter; | 58 | class KDGanttMinimizeSplitter; |
58 | class KAction; | 59 | class KAction; |
59 | class KActionCollection; | 60 | class KActionCollection; |
60 | class KToggleAction; | 61 | class KToggleAction; |
61 | class KSyncProfile; | 62 | class KSyncProfile; |
62 | 63 | ||
63 | class QAction; | 64 | class QAction; |
64 | class QMenuBar; | 65 | class QMenuBar; |
65 | class QSplitter; | 66 | class QSplitter; |
66 | class ViewContainer; | 67 | class ViewContainer; |
67 | class ViewManager; | 68 | class ViewManager; |
68 | class AddresseeEditorDialog; | 69 | class AddresseeEditorDialog; |
69 | class Ir; | 70 | class Ir; |
70 | 71 | ||
71 | class KABCore : public QWidget, public KSyncInterface | 72 | class KABCore : public QWidget, public KSyncInterface |
72 | { | 73 | { |
73 | Q_OBJECT | 74 | Q_OBJECT |
74 | 75 | ||
75 | public: | 76 | public: |
76 | KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 ); | 77 | KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 ); |
77 | 78 | ||
78 | 79 | ||
79 | ~KABCore(); | 80 | ~KABCore(); |
@@ -98,97 +99,96 @@ class KABCore : public QWidget, public KSyncInterface | |||
98 | 99 | ||
99 | /** | 100 | /** |
100 | Returns a pointer to the StdAddressBook of the application. | 101 | Returns a pointer to the StdAddressBook of the application. |
101 | */ | 102 | */ |
102 | KABC::AddressBook *addressBook() const; | 103 | KABC::AddressBook *addressBook() const; |
103 | 104 | ||
104 | /** | 105 | /** |
105 | Returns a pointer to the KConfig object of the application. | 106 | Returns a pointer to the KConfig object of the application. |
106 | */ | 107 | */ |
107 | static KConfig *config(); | 108 | static KConfig *config(); |
108 | 109 | ||
109 | /** | 110 | /** |
110 | Returns a pointer to the global KActionCollection object. So | 111 | Returns a pointer to the global KActionCollection object. So |
111 | other classes can register their actions easily. | 112 | other classes can register their actions easily. |
112 | */ | 113 | */ |
113 | KActionCollection *actionCollection() const; | 114 | KActionCollection *actionCollection() const; |
114 | 115 | ||
115 | /** | 116 | /** |
116 | Returns the current search field of the Incremental Search Widget. | 117 | Returns the current search field of the Incremental Search Widget. |
117 | */ | 118 | */ |
118 | KABC::Field *currentSearchField() const; | 119 | KABC::Field *currentSearchField() const; |
119 | 120 | ||
120 | /** | 121 | /** |
121 | Returns the uid list of the currently selected contacts. | 122 | Returns the uid list of the currently selected contacts. |
122 | */ | 123 | */ |
123 | QStringList selectedUIDs() const; | 124 | QStringList selectedUIDs() const; |
124 | 125 | ||
125 | /** | 126 | /** |
126 | Displays the ResourceSelectDialog and returns the selected | 127 | Displays the ResourceSelectDialog and returns the selected |
127 | resource or a null pointer if no resource was selected by | 128 | resource or a null pointer if no resource was selected by |
128 | the user. | 129 | the user. |
129 | */ | 130 | */ |
130 | KABC::Resource *requestResource( QWidget *parent ); | 131 | KABC::Resource *requestResource( QWidget *parent ); |
131 | 132 | ||
132 | #ifndef KAB_EMBEDDED | 133 | #ifndef KAB_EMBEDDED |
133 | static KAboutData *createAboutData(); | 134 | static KAboutData *createAboutData(); |
134 | #endif //KAB_EMBEDDED | 135 | #endif //KAB_EMBEDDED |
135 | 136 | ||
136 | #ifdef KAB_EMBEDDED | 137 | #ifdef KAB_EMBEDDED |
137 | inline QPopupMenu* getImportMenu() { return ImportMenu;} | 138 | inline QPopupMenu* getImportMenu() { return ImportMenu;} |
138 | inline QPopupMenu* getExportMenu() { return ExportMenu;} | 139 | inline QPopupMenu* getExportMenu() { return ExportMenu;} |
139 | #endif //KAB_EMBEDDED | 140 | #endif //KAB_EMBEDDED |
140 | 141 | ||
141 | public slots: | 142 | public slots: |
142 | #ifdef KAB_EMBEDDED | 143 | #ifdef KAB_EMBEDDED |
143 | void createAboutData(); | 144 | void createAboutData(); |
144 | #endif //KAB_EMBEDDED | 145 | #endif //KAB_EMBEDDED |
145 | 146 | ||
146 | void statusMessage(QString, int time = 0 ); | ||
147 | void showLicence(); | 147 | void showLicence(); |
148 | void faq(); | 148 | void faq(); |
149 | void whatsnew() ; | 149 | void whatsnew() ; |
150 | void synchowto() ; | 150 | void synchowto() ; |
151 | void writeToPhone(); | 151 | void writeToPhone(); |
152 | 152 | ||
153 | /** | 153 | /** |
154 | Is called whenever a contact is selected in the view. | 154 | Is called whenever a contact is selected in the view. |
155 | */ | 155 | */ |
156 | void setContactSelected( const QString &uid ); | 156 | void setContactSelected( const QString &uid ); |
157 | 157 | ||
158 | /** | 158 | /** |
159 | Opens the preferred mail composer with all selected contacts as | 159 | Opens the preferred mail composer with all selected contacts as |
160 | arguments. | 160 | arguments. |
161 | */ | 161 | */ |
162 | void sendMail(); | 162 | void sendMail(); |
163 | 163 | ||
164 | /** | 164 | /** |
165 | Opens the preferred mail composer with the given contacts as | 165 | Opens the preferred mail composer with the given contacts as |
166 | arguments. | 166 | arguments. |
167 | */ | 167 | */ |
168 | void sendMail( const QString& email ); | 168 | void sendMail( const QString& email ); |
169 | 169 | ||
170 | 170 | ||
171 | void mailVCard(); | 171 | void mailVCard(); |
172 | void mailVCard(const QStringList& uids); | 172 | void mailVCard(const QStringList& uids); |
173 | 173 | ||
174 | /** | 174 | /** |
175 | Beams the "WhoAmI contact. | 175 | Beams the "WhoAmI contact. |
176 | */ | 176 | */ |
177 | void beamMySelf(); | 177 | void beamMySelf(); |
178 | 178 | ||
179 | void beamVCard(); | 179 | void beamVCard(); |
180 | void export2phone(); | 180 | void export2phone(); |
181 | void beamVCard(const QStringList& uids); | 181 | void beamVCard(const QStringList& uids); |
182 | void beamDone( Ir *ir ); | 182 | void beamDone( Ir *ir ); |
183 | 183 | ||
184 | 184 | ||
185 | /** | 185 | /** |
186 | Starts the preferred web browser with the given URL as argument. | 186 | Starts the preferred web browser with the given URL as argument. |
187 | */ | 187 | */ |
188 | void browse( const QString& url ); | 188 | void browse( const QString& url ); |
189 | 189 | ||
190 | /** | 190 | /** |
191 | Select all contacts in the view. | 191 | Select all contacts in the view. |
192 | */ | 192 | */ |
193 | void selectAllContacts(); | 193 | void selectAllContacts(); |
194 | 194 | ||
@@ -325,96 +325,97 @@ class KABCore : public QWidget, public KSyncInterface | |||
325 | */ | 325 | */ |
326 | void openLDAPDialog(); | 326 | void openLDAPDialog(); |
327 | 327 | ||
328 | /** | 328 | /** |
329 | Creates a KAddressBookPrinter, which will display the print | 329 | Creates a KAddressBookPrinter, which will display the print |
330 | dialog and do the printing. | 330 | dialog and do the printing. |
331 | */ | 331 | */ |
332 | void print(); | 332 | void print(); |
333 | 333 | ||
334 | /** | 334 | /** |
335 | Registers a new GUI client, so plugins can register its actions. | 335 | Registers a new GUI client, so plugins can register its actions. |
336 | */ | 336 | */ |
337 | void addGUIClient( KXMLGUIClient *client ); | 337 | void addGUIClient( KXMLGUIClient *client ); |
338 | 338 | ||
339 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); | 339 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); |
340 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | 340 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); |
341 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); | 341 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); |
342 | 342 | ||
343 | 343 | ||
344 | signals: | 344 | signals: |
345 | void contactSelected( const QString &name ); | 345 | void contactSelected( const QString &name ); |
346 | void contactSelected( const QPixmap &pixmap ); | 346 | void contactSelected( const QPixmap &pixmap ); |
347 | public slots: | 347 | public slots: |
348 | void recieve(QString cmsg ); | 348 | void recieve(QString cmsg ); |
349 | void getFile( bool success ); | 349 | void getFile( bool success ); |
350 | void syncFileRequest(); | 350 | void syncFileRequest(); |
351 | void setDetailsVisible( bool visible ); | 351 | void setDetailsVisible( bool visible ); |
352 | void setDetailsToState(); | 352 | void setDetailsToState(); |
353 | // void slotSyncMenu( int ); | 353 | // void slotSyncMenu( int ); |
354 | private slots: | 354 | private slots: |
355 | void setJumpButtonBarVisible( bool visible ); | 355 | void setJumpButtonBarVisible( bool visible ); |
356 | void setCaptionBack(); | 356 | void setCaptionBack(); |
357 | void importFromOL(); | 357 | void importFromOL(); |
358 | void extensionModified( const KABC::Addressee::List &list ); | 358 | void extensionModified( const KABC::Addressee::List &list ); |
359 | void extensionChanged( int id ); | 359 | void extensionChanged( int id ); |
360 | void clipboardDataChanged(); | 360 | void clipboardDataChanged(); |
361 | void updateActionMenu(); | 361 | void updateActionMenu(); |
362 | void configureKeyBindings(); | 362 | void configureKeyBindings(); |
363 | void removeVoice(); | 363 | void removeVoice(); |
364 | #ifdef KAB_EMBEDDED | 364 | #ifdef KAB_EMBEDDED |
365 | void configureResources(); | 365 | void configureResources(); |
366 | #endif //KAB_EMBEDDED | 366 | #endif //KAB_EMBEDDED |
367 | 367 | ||
368 | void slotEditorDestroyed( const QString &uid ); | 368 | void slotEditorDestroyed( const QString &uid ); |
369 | void configurationChanged(); | 369 | void configurationChanged(); |
370 | void addressBookChanged(); | 370 | void addressBookChanged(); |
371 | 371 | ||
372 | private: | 372 | private: |
373 | QTimer *mMessageTimer; | ||
373 | void initGUI(); | 374 | void initGUI(); |
374 | void initActions(); | 375 | void initActions(); |
375 | QString getPhoneFile(); | 376 | QString getPhoneFile(); |
376 | 377 | ||
377 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, | 378 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, |
378 | const char *name = 0 ); | 379 | const char *name = 0 ); |
379 | 380 | ||
380 | KXMLGUIClient *mGUIClient; | 381 | KXMLGUIClient *mGUIClient; |
381 | 382 | ||
382 | KABC::AddressBook *mAddressBook; | 383 | KABC::AddressBook *mAddressBook; |
383 | 384 | ||
384 | ViewManager *mViewManager; | 385 | ViewManager *mViewManager; |
385 | // QSplitter *mDetailsSplitter; | 386 | // QSplitter *mDetailsSplitter; |
386 | KDGanttMinimizeSplitter *mExtensionBarSplitter; | 387 | KDGanttMinimizeSplitter *mExtensionBarSplitter; |
387 | ViewContainer *mDetails; | 388 | ViewContainer *mDetails; |
388 | KDGanttMinimizeSplitter* mMiniSplitter; | 389 | KDGanttMinimizeSplitter* mMiniSplitter; |
389 | XXPortManager *mXXPortManager; | 390 | XXPortManager *mXXPortManager; |
390 | JumpButtonBar *mJumpButtonBar; | 391 | JumpButtonBar *mJumpButtonBar; |
391 | IncSearchWidget *mIncSearchWidget; | 392 | IncSearchWidget *mIncSearchWidget; |
392 | ExtensionManager *mExtensionManager; | 393 | ExtensionManager *mExtensionManager; |
393 | 394 | ||
394 | KCMultiDialog *mConfigureDialog; | 395 | KCMultiDialog *mConfigureDialog; |
395 | 396 | ||
396 | #ifndef KAB_EMBEDDED | 397 | #ifndef KAB_EMBEDDED |
397 | LDAPSearchDialog *mLdapSearchDialog; | 398 | LDAPSearchDialog *mLdapSearchDialog; |
398 | #endif //KAB_EMBEDDED | 399 | #endif //KAB_EMBEDDED |
399 | // QDict<AddresseeEditorDialog> mEditorDict; | 400 | // QDict<AddresseeEditorDialog> mEditorDict; |
400 | AddresseeEditorDialog *mEditorDialog; | 401 | AddresseeEditorDialog *mEditorDialog; |
401 | bool mReadWrite; | 402 | bool mReadWrite; |
402 | bool mModified; | 403 | bool mModified; |
403 | bool mIsPart; | 404 | bool mIsPart; |
404 | bool mMultipleViewsAtOnce; | 405 | bool mMultipleViewsAtOnce; |
405 | 406 | ||
406 | 407 | ||
407 | //US file menu | 408 | //US file menu |
408 | KAction *mActionMail; | 409 | KAction *mActionMail; |
409 | KAction *mActionBeam; | 410 | KAction *mActionBeam; |
410 | KAction *mActionExport2phone; | 411 | KAction *mActionExport2phone; |
411 | KAction* mActionPrint; | 412 | KAction* mActionPrint; |
412 | KAction* mActionNewContact; | 413 | KAction* mActionNewContact; |
413 | KAction *mActionSave; | 414 | KAction *mActionSave; |
414 | KAction *mActionEditAddressee; | 415 | KAction *mActionEditAddressee; |
415 | KAction *mActionMailVCard; | 416 | KAction *mActionMailVCard; |
416 | KAction *mActionBeamVCard; | 417 | KAction *mActionBeamVCard; |
417 | 418 | ||
418 | KAction *mActionQuit; | 419 | KAction *mActionQuit; |
419 | 420 | ||
420 | //US edit menu | 421 | //US edit menu |