summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.h
Unidiff
Diffstat (limited to 'kaddressbook/viewmanager.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.h12
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
@@ -5,57 +5,59 @@
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
33class KAction; 35class KAction;
34class KSelectAction; 36class KSelectAction;
35 37
36class KABCore; 38class KABCore;
37class QWidgetStack; 39class Q3WidgetStack;
38class QDropEvent; 40class QDropEvent;
39 41
40namespace KABC { class AddressBook; } 42namespace 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 */
50class ViewManager : public QWidget 52class 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();
@@ -124,38 +126,38 @@ class ViewManager : public QWidget
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