-rw-r--r-- | kaddressbook/viewmanager.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h index 97c2275..6def6b6 100644 --- a/kaddressbook/viewmanager.h +++ b/kaddressbook/viewmanager.h | |||
@@ -1,153 +1,154 @@ | |||
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 | #include <kaddressbookview.h> | 29 | #include <kaddressbookview.h> |
30 | #include <qdict.h> | 30 | #include <qdict.h> |
31 | 31 | ||
32 | class KAction; | 32 | class KAction; |
33 | class KSelectAction; | 33 | class KSelectAction; |
34 | 34 | ||
35 | class KABCore; | 35 | class KABCore; |
36 | class QWidgetStack; | 36 | class QWidgetStack; |
37 | class QDropEvent; | 37 | class QDropEvent; |
38 | 38 | ||
39 | namespace KABC { class AddressBook; } | 39 | namespace KABC { class AddressBook; } |
40 | 40 | ||
41 | /** | 41 | /** |
42 | The view manager manages the views and everything related to them. The | 42 | The view manager manages the views and everything related to them. The |
43 | manager will load the views at startup and display a view when told to | 43 | manager will load the views at startup and display a view when told to |
44 | make one active. | 44 | make one active. |
45 | 45 | ||
46 | The view manager will also create and manage all dialogs directly related to | 46 | The view manager will also create and manage all dialogs directly related to |
47 | views (ie: AddView, ConfigureView, DeleteView, etc). | 47 | views (ie: AddView, ConfigureView, DeleteView, etc). |
48 | */ | 48 | */ |
49 | class ViewManager : public QWidget | 49 | class ViewManager : public QWidget |
50 | { | 50 | { |
51 | Q_OBJECT | 51 | Q_OBJECT |
52 | public: | 52 | public: |
53 | ViewManager( KABCore *core, QWidget *parent, const char *name = 0 ); | 53 | ViewManager( KABCore *core, QWidget *parent, const char *name = 0 ); |
54 | ~ViewManager(); | 54 | ~ViewManager(); |
55 | 55 | ||
56 | void restoreSettings(); | 56 | void restoreSettings(); |
57 | void saveSettings(); | 57 | void saveSettings(); |
58 | void doSearch( const QString& s ,KABC::Field *field ); | ||
58 | 59 | ||
59 | void unloadViews(); | 60 | void unloadViews(); |
60 | KSelectAction * getFilterAction() { return mActionSelectFilter; } | 61 | KSelectAction * getFilterAction() { return mActionSelectFilter; } |
61 | 62 | ||
62 | QStringList selectedUids() const; | 63 | QStringList selectedUids() const; |
63 | QStringList selectedEmails() const; | 64 | QStringList selectedEmails() const; |
64 | KABC::Addressee::List selectedAddressees() const; | 65 | KABC::Addressee::List selectedAddressees() const; |
65 | void setListSelected(QStringList); | 66 | void setListSelected(QStringList); |
66 | 67 | ||
67 | public slots: | 68 | public slots: |
68 | 69 | ||
69 | //US void setSelected( const QString &uid = QString::null, bool selected = true ); | 70 | //US void setSelected( const QString &uid = QString::null, bool selected = true ); |
70 | void setSelected( const QString &uid, bool); | 71 | void setSelected( const QString &uid, bool); |
71 | //US added another method with no parameter, since my moc compiler does not support default parameters. | 72 | //US added another method with no parameter, since my moc compiler does not support default parameters. |
72 | void setSelected(); | 73 | void setSelected(); |
73 | 74 | ||
74 | 75 | ||
75 | 76 | ||
76 | //US added another method with no parameter, since my moc compiler does not support default parameters. | 77 | //US added another method with no parameter, since my moc compiler does not support default parameters. |
77 | void refreshView(); | 78 | void refreshView(); |
78 | void refreshView( const QString &uid); | 79 | void refreshView( const QString &uid); |
79 | 80 | ||
80 | void editView(); | 81 | void editView(); |
81 | void deleteView(); | 82 | void deleteView(); |
82 | void addView(); | 83 | void addView(); |
83 | 84 | ||
84 | protected slots: | 85 | protected slots: |
85 | /** | 86 | /** |
86 | Called whenever the user drops something in the active view. | 87 | Called whenever the user drops something in the active view. |
87 | This method will try to decode what was dropped, and if it was | 88 | This method will try to decode what was dropped, and if it was |
88 | a valid addressee, add it to the addressbook. | 89 | a valid addressee, add it to the addressbook. |
89 | */ | 90 | */ |
90 | void dropped( QDropEvent* ); | 91 | void dropped( QDropEvent* ); |
91 | 92 | ||
92 | /** | 93 | /** |
93 | Called whenever the user attempts to start a drag in the view. | 94 | Called whenever the user attempts to start a drag in the view. |
94 | This method will convert all the selected addressees into text (vcard) | 95 | This method will convert all the selected addressees into text (vcard) |
95 | and create a drag object. | 96 | and create a drag object. |
96 | */ | 97 | */ |
97 | void startDrag(); | 98 | void startDrag(); |
98 | 99 | ||
99 | signals: | 100 | signals: |
100 | /** | 101 | /** |
101 | Emitted whenever the user selects an entry in the view. | 102 | Emitted whenever the user selects an entry in the view. |
102 | */ | 103 | */ |
103 | void selected( const QString &uid ); | 104 | void selected( const QString &uid ); |
104 | void deleteRequest( ); | 105 | void deleteRequest( ); |
105 | 106 | ||
106 | /** | 107 | /** |
107 | Emitted whenever the user activates an entry in the view. | 108 | Emitted whenever the user activates an entry in the view. |
108 | */ | 109 | */ |
109 | void executed( const QString &uid ); | 110 | void executed( const QString &uid ); |
110 | 111 | ||
111 | /** | 112 | /** |
112 | Emitted whenever the address book is modified in some way. | 113 | Emitted whenever the address book is modified in some way. |
113 | */ | 114 | */ |
114 | void modified(); | 115 | void modified(); |
115 | 116 | ||
116 | /** | 117 | /** |
117 | Emitted whenever a url is dragged on a view. | 118 | Emitted whenever a url is dragged on a view. |
118 | */ | 119 | */ |
119 | void urlDropped( const KURL& ); | 120 | void urlDropped( const KURL& ); |
120 | 121 | ||
121 | private slots: | 122 | private slots: |
122 | void setActiveView( const QString &name ); | 123 | void setActiveView( const QString &name ); |
123 | void setActiveFilter( int index ); | 124 | void setActiveFilter( int index ); |
124 | void configureFilters(); | 125 | void configureFilters(); |
125 | 126 | ||
126 | private: | 127 | private: |
127 | void createViewFactories(); | 128 | void createViewFactories(); |
128 | QStringList filterNames() const; | 129 | QStringList filterNames() const; |
129 | int filterPosition( const QString &name ) const; | 130 | int filterPosition( const QString &name ) const; |
130 | QStringList viewNames() const; | 131 | QStringList viewNames() const; |
131 | int viewPosition( const QString &name ) const; | 132 | int viewPosition( const QString &name ) const; |
132 | void initActions(); | 133 | void initActions(); |
133 | void initGUI(); | 134 | void initGUI(); |
134 | 135 | ||
135 | KABCore *mCore; | 136 | KABCore *mCore; |
136 | 137 | ||
137 | Filter mCurrentFilter; | 138 | Filter mCurrentFilter; |
138 | Filter::List mFilterList; | 139 | Filter::List mFilterList; |
139 | 140 | ||
140 | QDict<KAddressBookView> mViewDict; | 141 | QDict<KAddressBookView> mViewDict; |
141 | QDict<ViewFactory> mViewFactoryDict; | 142 | QDict<ViewFactory> mViewFactoryDict; |
142 | QStringList mViewNameList; | 143 | QStringList mViewNameList; |
143 | 144 | ||
144 | QWidgetStack *mViewWidgetStack; | 145 | QWidgetStack *mViewWidgetStack; |
145 | KAddressBookView *mActiveView; | 146 | KAddressBookView *mActiveView; |
146 | 147 | ||
147 | KAction *mActionDeleteView; | 148 | KAction *mActionDeleteView; |
148 | KSelectAction *mActionSelectFilter; | 149 | KSelectAction *mActionSelectFilter; |
149 | KSelectAction *mActionSelectView; | 150 | KSelectAction *mActionSelectView; |
150 | 151 | ||
151 | }; | 152 | }; |
152 | 153 | ||
153 | #endif | 154 | #endif |