-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 585f4e9..a03a83f 100644 --- a/kaddressbook/viewmanager.h +++ b/kaddressbook/viewmanager.h | |||
@@ -1,156 +1,157 @@ | |||
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 | void doSearch( const QString& s ,KABC::Field *field ); |
59 | 59 | ||
60 | void unloadViews(); | 60 | void unloadViews(); |
61 | KSelectAction * getFilterAction() { return mActionSelectFilter; } | 61 | KSelectAction * getFilterAction() { return mActionSelectFilter; } |
62 | 62 | ||
63 | QStringList selectedUids() const; | 63 | QStringList selectedUids() const; |
64 | QStringList selectedEmails() const; | 64 | QStringList selectedEmails() const; |
65 | KABC::Addressee::List selectedAddressees() const; | 65 | KABC::Addressee::List selectedAddressees() const; |
66 | void setListSelected(QStringList); | 66 | void setListSelected(QStringList); |
67 | void setFocusAV(); | ||
67 | 68 | ||
68 | public slots: | 69 | public slots: |
69 | void scrollUP(); | 70 | void scrollUP(); |
70 | void scrollDOWN(); | 71 | void scrollDOWN(); |
71 | 72 | ||
72 | //US void setSelected( const QString &uid = QString::null, bool selected = true ); | 73 | //US void setSelected( const QString &uid = QString::null, bool selected = true ); |
73 | void setSelected( const QString &uid, bool); | 74 | void setSelected( const QString &uid, bool); |
74 | //US added another method with no parameter, since my moc compiler does not support default parameters. | 75 | //US added another method with no parameter, since my moc compiler does not support default parameters. |
75 | void setSelected(); | 76 | void setSelected(); |
76 | 77 | ||
77 | 78 | ||
78 | 79 | ||
79 | //US added another method with no parameter, since my moc compiler does not support default parameters. | 80 | //US added another method with no parameter, since my moc compiler does not support default parameters. |
80 | void refreshView(); | 81 | void refreshView(); |
81 | void refreshView( const QString &uid); | 82 | void refreshView( const QString &uid); |
82 | 83 | ||
83 | void editView(); | 84 | void editView(); |
84 | void deleteView(); | 85 | void deleteView(); |
85 | void addView(); | 86 | void addView(); |
86 | 87 | ||
87 | protected slots: | 88 | protected slots: |
88 | /** | 89 | /** |
89 | Called whenever the user drops something in the active view. | 90 | Called whenever the user drops something in the active view. |
90 | This method will try to decode what was dropped, and if it was | 91 | This method will try to decode what was dropped, and if it was |
91 | a valid addressee, add it to the addressbook. | 92 | a valid addressee, add it to the addressbook. |
92 | */ | 93 | */ |
93 | void dropped( QDropEvent* ); | 94 | void dropped( QDropEvent* ); |
94 | 95 | ||
95 | /** | 96 | /** |
96 | Called whenever the user attempts to start a drag in the view. | 97 | Called whenever the user attempts to start a drag in the view. |
97 | This method will convert all the selected addressees into text (vcard) | 98 | This method will convert all the selected addressees into text (vcard) |
98 | and create a drag object. | 99 | and create a drag object. |
99 | */ | 100 | */ |
100 | void startDrag(); | 101 | void startDrag(); |
101 | 102 | ||
102 | signals: | 103 | signals: |
103 | /** | 104 | /** |
104 | Emitted whenever the user selects an entry in the view. | 105 | Emitted whenever the user selects an entry in the view. |
105 | */ | 106 | */ |
106 | void selected( const QString &uid ); | 107 | void selected( const QString &uid ); |
107 | void deleteRequest( ); | 108 | void deleteRequest( ); |
108 | 109 | ||
109 | /** | 110 | /** |
110 | Emitted whenever the user activates an entry in the view. | 111 | Emitted whenever the user activates an entry in the view. |
111 | */ | 112 | */ |
112 | void executed( const QString &uid ); | 113 | void executed( const QString &uid ); |
113 | 114 | ||
114 | /** | 115 | /** |
115 | Emitted whenever the address book is modified in some way. | 116 | Emitted whenever the address book is modified in some way. |
116 | */ | 117 | */ |
117 | void modified(); | 118 | void modified(); |
118 | 119 | ||
119 | /** | 120 | /** |
120 | Emitted whenever a url is dragged on a view. | 121 | Emitted whenever a url is dragged on a view. |
121 | */ | 122 | */ |
122 | void urlDropped( const KURL& ); | 123 | void urlDropped( const KURL& ); |
123 | 124 | ||
124 | private slots: | 125 | private slots: |
125 | void setActiveView( const QString &name ); | 126 | void setActiveView( const QString &name ); |
126 | void setActiveFilter( int index ); | 127 | void setActiveFilter( int index ); |
127 | void configureFilters(); | 128 | void configureFilters(); |
128 | 129 | ||
129 | private: | 130 | private: |
130 | void createViewFactories(); | 131 | void createViewFactories(); |
131 | QStringList filterNames() const; | 132 | QStringList filterNames() const; |
132 | int filterPosition( const QString &name ) const; | 133 | int filterPosition( const QString &name ) const; |
133 | QStringList viewNames() const; | 134 | QStringList viewNames() const; |
134 | int viewPosition( const QString &name ) const; | 135 | int viewPosition( const QString &name ) const; |
135 | void initActions(); | 136 | void initActions(); |
136 | void initGUI(); | 137 | void initGUI(); |
137 | 138 | ||
138 | KABCore *mCore; | 139 | KABCore *mCore; |
139 | 140 | ||
140 | Filter mCurrentFilter; | 141 | Filter mCurrentFilter; |
141 | Filter::List mFilterList; | 142 | Filter::List mFilterList; |
142 | 143 | ||
143 | QDict<KAddressBookView> mViewDict; | 144 | QDict<KAddressBookView> mViewDict; |
144 | QDict<ViewFactory> mViewFactoryDict; | 145 | QDict<ViewFactory> mViewFactoryDict; |
145 | QStringList mViewNameList; | 146 | QStringList mViewNameList; |
146 | 147 | ||
147 | QWidgetStack *mViewWidgetStack; | 148 | QWidgetStack *mViewWidgetStack; |
148 | KAddressBookView *mActiveView; | 149 | KAddressBookView *mActiveView; |
149 | 150 | ||
150 | KAction *mActionDeleteView; | 151 | KAction *mActionDeleteView; |
151 | KSelectAction *mActionSelectFilter; | 152 | KSelectAction *mActionSelectFilter; |
152 | KSelectAction *mActionSelectView; | 153 | KSelectAction *mActionSelectView; |
153 | 154 | ||
154 | }; | 155 | }; |
155 | 156 | ||
156 | #endif | 157 | #endif |