Diffstat (limited to 'kaddressbook/extensionwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/extensionwidget.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/kaddressbook/extensionwidget.h b/kaddressbook/extensionwidget.h new file mode 100644 index 0000000..fc91f21 --- a/dev/null +++ b/kaddressbook/extensionwidget.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /* | ||
2 | This file is part of KAddressBook. | ||
3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | ||
4 | |||
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 | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
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 | ||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | As a special exception, permission is given to link this program | ||
20 | with any edition of Qt, and distribute the resulting executable, | ||
21 | without including the source code for Qt in the source distribution. | ||
22 | */ | ||
23 | |||
24 | #ifndef EXTENSIONWIDGET_H | ||
25 | #define EXTENSIONWIDGET_H | ||
26 | |||
27 | #include <qwidget.h> | ||
28 | |||
29 | #include <kabc/addressbook.h> | ||
30 | #ifndef KAB_EMBEDDED | ||
31 | #include <klibloader.h> | ||
32 | #endif //KAB_EMBEDDED | ||
33 | |||
34 | class ConfigureWidget; | ||
35 | class KABCore; | ||
36 | |||
37 | class ExtensionWidget : public QWidget | ||
38 | { | ||
39 | Q_OBJECT | ||
40 | |||
41 | public: | ||
42 | ExtensionWidget( KABCore *core, QWidget *parent, const char *name = 0 ); | ||
43 | ~ExtensionWidget(); | ||
44 | |||
45 | /** | ||
46 | @return A pointer to the core object | ||
47 | */ | ||
48 | KABCore *core() const; | ||
49 | |||
50 | /** | ||
51 | Returns whether there are selected contacts in the view. | ||
52 | */ | ||
53 | bool contactsSelected() const; | ||
54 | |||
55 | /** | ||
56 | Returns a list of contacts that are selected in the view. | ||
57 | Use @ref addresseesSelected() to test if there exists selected | ||
58 | contacts. | ||
59 | */ | ||
60 | KABC::Addressee::List selectedContacts(); | ||
61 | |||
62 | /** | ||
63 | This method is called whenever the selection in the view changed. | ||
64 | */ | ||
65 | virtual void contactsSelectionChanged(); | ||
66 | |||
67 | /** | ||
68 | This method should be reimplemented and return the i18ned title of this | ||
69 | widget. | ||
70 | */ | ||
71 | virtual QString title() const; | ||
72 | |||
73 | /** | ||
74 | This method should be reimplemented and return a unique identifier. | ||
75 | */ | ||
76 | virtual QString identifier() const; | ||
77 | |||
78 | signals: | ||
79 | void modified( const KABC::Addressee::List &list ); | ||
80 | |||
81 | private: | ||
82 | KABCore *mCore; | ||
83 | |||
84 | class ExtensionWidgetPrivate; | ||
85 | ExtensionWidgetPrivate *d; | ||
86 | }; | ||
87 | |||
88 | #ifndef KAB_EMBEDDED | ||
89 | //MOC_SKIP_BEGIN | ||
90 | class ExtensionFactory : public KLibFactory | ||
91 | //MOC_SKIP_END | ||
92 | #else //KAB_EMBEDDED | ||
93 | class ExtensionFactory | ||
94 | #endif //KAB_EMBEDDED | ||
95 | { | ||
96 | public: | ||
97 | virtual ExtensionWidget *extension( KABCore *core, QWidget *parent, | ||
98 | const char *name = 0 ) = 0; | ||
99 | |||
100 | virtual ConfigureWidget *configureWidget( QWidget *parent, | ||
101 | const char *name = 0 ); | ||
102 | |||
103 | virtual bool configureWidgetAvailable() { return false; } | ||
104 | |||
105 | /** | ||
106 | This method should return the same identifier like the config | ||
107 | widget. | ||
108 | */ | ||
109 | virtual QString identifier() const = 0; | ||
110 | |||
111 | protected: | ||
112 | virtual QObject* createObject( QObject*, const char*, const char*, | ||
113 | const QStringList & ) | ||
114 | { | ||
115 | return 0; | ||
116 | } | ||
117 | }; | ||
118 | |||
119 | #endif | ||