author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/viewmanager.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kaddressbook/viewmanager.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h index ab5d372..4bbdbc7 100644 --- a/kaddressbook/viewmanager.h +++ b/kaddressbook/viewmanager.h | |||
@@ -1,69 +1,71 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
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 VIEWMANAGER_H | 24 | #ifndef VIEWMANAGER_H |
25 | #define VIEWMANAGER_H | 25 | #define VIEWMANAGER_H |
26 | 26 | ||
27 | #include <qwidget.h> | 27 | #include <qwidget.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | //Added by qt3to4: | ||
30 | #include <QDropEvent> | ||
29 | #include <kaddressbookview.h> | 31 | #include <kaddressbookview.h> |
30 | #include <qdict.h> | 32 | #include <q3dict.h> |
31 | #include "filter.h" | 33 | #include "filter.h" |
32 | 34 | ||
33 | class KAction; | 35 | class KAction; |
34 | class KSelectAction; | 36 | class KSelectAction; |
35 | 37 | ||
36 | class KABCore; | 38 | class KABCore; |
37 | class QWidgetStack; | 39 | class Q3WidgetStack; |
38 | class QDropEvent; | 40 | class QDropEvent; |
39 | 41 | ||
40 | namespace KABC { class AddressBook; } | 42 | namespace KABC { class AddressBook; } |
41 | 43 | ||
42 | /** | 44 | /** |
43 | The view manager manages the views and everything related to them. The | 45 | The view manager manages the views and everything related to them. The |
44 | manager will load the views at startup and display a view when told to | 46 | manager will load the views at startup and display a view when told to |
45 | make one active. | 47 | make one active. |
46 | 48 | ||
47 | The view manager will also create and manage all dialogs directly related to | 49 | The view manager will also create and manage all dialogs directly related to |
48 | views (ie: AddView, ConfigureView, DeleteView, etc). | 50 | views (ie: AddView, ConfigureView, DeleteView, etc). |
49 | */ | 51 | */ |
50 | class ViewManager : public QWidget | 52 | class ViewManager : public QWidget |
51 | { | 53 | { |
52 | Q_OBJECT | 54 | Q_OBJECT |
53 | public: | 55 | public: |
54 | ViewManager( KABCore *core, QWidget *parent, const char *name = 0 ); | 56 | ViewManager( KABCore *core, QWidget *parent, const char *name = 0 ); |
55 | ~ViewManager(); | 57 | ~ViewManager(); |
56 | 58 | ||
57 | void restoreSettings(); | 59 | void restoreSettings(); |
58 | void saveSettings(); | 60 | void saveSettings(); |
59 | void doSearch( const QString& s ,KABC::Field *field ); | 61 | void doSearch( const QString& s ,KABC::Field *field ); |
60 | 62 | ||
61 | void unloadViews(); | 63 | void unloadViews(); |
62 | KSelectAction * getFilterAction() { return mActionSelectFilter; } | 64 | KSelectAction * getFilterAction() { return mActionSelectFilter; } |
63 | Filter getFilterByName( const QString &name ) const; | 65 | Filter getFilterByName( const QString &name ) const; |
64 | 66 | ||
65 | QStringList selectedUids() const; | 67 | QStringList selectedUids() const; |
66 | QStringList selectedEmails() const; | 68 | QStringList selectedEmails() const; |
67 | KABC::Addressee::List selectedAddressees() const; | 69 | KABC::Addressee::List selectedAddressees() const; |
68 | void setListSelected(QStringList); | 70 | void setListSelected(QStringList); |
69 | void setFocusAV(); | 71 | void setFocusAV(); |
@@ -116,46 +118,46 @@ class ViewManager : public QWidget | |||
116 | void executed( const QString &uid ); | 118 | void executed( const QString &uid ); |
117 | 119 | ||
118 | /** | 120 | /** |
119 | Emitted whenever the address book is modified in some way. | 121 | Emitted whenever the address book is modified in some way. |
120 | */ | 122 | */ |
121 | void modified(); | 123 | void modified(); |
122 | 124 | ||
123 | /** | 125 | /** |
124 | Emitted whenever a url is dragged on a view. | 126 | Emitted whenever a url is dragged on a view. |
125 | */ | 127 | */ |
126 | void urlDropped( const KURL& ); | 128 | void urlDropped( const KURL& ); |
127 | 129 | ||
128 | private slots: | 130 | private slots: |
129 | void selectView( const QString &name ); | 131 | void selectView( const QString &name ); |
130 | void setActiveView( const QString &name ); | 132 | void setActiveView( const QString &name ); |
131 | void setActiveFilter( int index ); | 133 | void setActiveFilter( int index ); |
132 | void configureFilters(); | 134 | void configureFilters(); |
133 | 135 | ||
134 | private: | 136 | private: |
135 | void createViewFactories(); | 137 | void createViewFactories(); |
136 | QStringList filterNames() const; | 138 | QStringList filterNames() const; |
137 | int filterPosition( const QString &name ) const; | 139 | int filterPosition( const QString &name ) const; |
138 | QStringList viewNames() const; | 140 | QStringList viewNames() const; |
139 | int viewPosition( const QString &name ) const; | 141 | int viewPosition( const QString &name ) const; |
140 | void initActions(); | 142 | void initActions(); |
141 | void initGUI(); | 143 | void initGUI(); |
142 | 144 | ||
143 | KABCore *mCore; | 145 | KABCore *mCore; |
144 | 146 | ||
145 | Filter mCurrentFilter; | 147 | Filter mCurrentFilter; |
146 | Filter::List mFilterList; | 148 | Filter::List mFilterList; |
147 | 149 | ||
148 | QDict<KAddressBookView> mViewDict; | 150 | Q3Dict<KAddressBookView> mViewDict; |
149 | QDict<ViewFactory> mViewFactoryDict; | 151 | Q3Dict<ViewFactory> mViewFactoryDict; |
150 | QStringList mViewNameList; | 152 | QStringList mViewNameList; |
151 | 153 | ||
152 | QWidgetStack *mViewWidgetStack; | 154 | Q3WidgetStack *mViewWidgetStack; |
153 | KAddressBookView *mActiveView; | 155 | KAddressBookView *mActiveView; |
154 | 156 | ||
155 | KAction *mActionDeleteView; | 157 | KAction *mActionDeleteView; |
156 | KSelectAction *mActionSelectFilter; | 158 | KSelectAction *mActionSelectFilter; |
157 | KSelectAction *mActionSelectView; | 159 | KSelectAction *mActionSelectView; |
158 | 160 | ||
159 | }; | 161 | }; |
160 | 162 | ||
161 | #endif | 163 | #endif |