summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.h
Unidiff
Diffstat (limited to 'kaddressbook/viewmanager.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h
index 6def6b6..585f4e9 100644
--- a/kaddressbook/viewmanager.h
+++ b/kaddressbook/viewmanager.h
@@ -1,154 +1,156 @@
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
32class KAction; 32class KAction;
33class KSelectAction; 33class KSelectAction;
34 34
35class KABCore; 35class KABCore;
36class QWidgetStack; 36class QWidgetStack;
37class QDropEvent; 37class QDropEvent;
38 38
39namespace KABC { class AddressBook; } 39namespace 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 */
49class ViewManager : public QWidget 49class 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 67
68 public slots: 68 public slots:
69 void scrollUP();
70 void scrollDOWN();
69 71
70//US void setSelected( const QString &uid = QString::null, bool selected = true ); 72//US void setSelected( const QString &uid = QString::null, bool selected = true );
71 void setSelected( const QString &uid, bool); 73 void setSelected( const QString &uid, bool);
72//US added another method with no parameter, since my moc compiler does not support default parameters. 74//US added another method with no parameter, since my moc compiler does not support default parameters.
73 void setSelected(); 75 void setSelected();
74 76
75 77
76 78
77//US added another method with no parameter, since my moc compiler does not support default parameters. 79//US added another method with no parameter, since my moc compiler does not support default parameters.
78 void refreshView(); 80 void refreshView();
79 void refreshView( const QString &uid); 81 void refreshView( const QString &uid);
80 82
81 void editView(); 83 void editView();
82 void deleteView(); 84 void deleteView();
83 void addView(); 85 void addView();
84 86
85 protected slots: 87 protected slots:
86 /** 88 /**
87 Called whenever the user drops something in the active view. 89 Called whenever the user drops something in the active view.
88 This method will try to decode what was dropped, and if it was 90 This method will try to decode what was dropped, and if it was
89 a valid addressee, add it to the addressbook. 91 a valid addressee, add it to the addressbook.
90 */ 92 */
91 void dropped( QDropEvent* ); 93 void dropped( QDropEvent* );
92 94
93 /** 95 /**
94 Called whenever the user attempts to start a drag in the view. 96 Called whenever the user attempts to start a drag in the view.
95 This method will convert all the selected addressees into text (vcard) 97 This method will convert all the selected addressees into text (vcard)
96 and create a drag object. 98 and create a drag object.
97 */ 99 */
98 void startDrag(); 100 void startDrag();
99 101
100 signals: 102 signals:
101 /** 103 /**
102 Emitted whenever the user selects an entry in the view. 104 Emitted whenever the user selects an entry in the view.
103 */ 105 */
104 void selected( const QString &uid ); 106 void selected( const QString &uid );
105 void deleteRequest( ); 107 void deleteRequest( );
106 108
107 /** 109 /**
108 Emitted whenever the user activates an entry in the view. 110 Emitted whenever the user activates an entry in the view.
109 */ 111 */
110 void executed( const QString &uid ); 112 void executed( const QString &uid );
111 113
112 /** 114 /**
113 Emitted whenever the address book is modified in some way. 115 Emitted whenever the address book is modified in some way.
114 */ 116 */
115 void modified(); 117 void modified();
116 118
117 /** 119 /**
118 Emitted whenever a url is dragged on a view. 120 Emitted whenever a url is dragged on a view.
119 */ 121 */
120 void urlDropped( const KURL& ); 122 void urlDropped( const KURL& );
121 123
122 private slots: 124 private slots:
123 void setActiveView( const QString &name ); 125 void setActiveView( const QString &name );
124 void setActiveFilter( int index ); 126 void setActiveFilter( int index );
125 void configureFilters(); 127 void configureFilters();
126 128
127 private: 129 private:
128 void createViewFactories(); 130 void createViewFactories();
129 QStringList filterNames() const; 131 QStringList filterNames() const;
130 int filterPosition( const QString &name ) const; 132 int filterPosition( const QString &name ) const;
131 QStringList viewNames() const; 133 QStringList viewNames() const;
132 int viewPosition( const QString &name ) const; 134 int viewPosition( const QString &name ) const;
133 void initActions(); 135 void initActions();
134 void initGUI(); 136 void initGUI();
135 137
136 KABCore *mCore; 138 KABCore *mCore;
137 139
138 Filter mCurrentFilter; 140 Filter mCurrentFilter;
139 Filter::List mFilterList; 141 Filter::List mFilterList;
140 142
141 QDict<KAddressBookView> mViewDict; 143 QDict<KAddressBookView> mViewDict;
142 QDict<ViewFactory> mViewFactoryDict; 144 QDict<ViewFactory> mViewFactoryDict;
143 QStringList mViewNameList; 145 QStringList mViewNameList;
144 146
145 QWidgetStack *mViewWidgetStack; 147 QWidgetStack *mViewWidgetStack;
146 KAddressBookView *mActiveView; 148 KAddressBookView *mActiveView;
147 149
148 KAction *mActionDeleteView; 150 KAction *mActionDeleteView;
149 KSelectAction *mActionSelectFilter; 151 KSelectAction *mActionSelectFilter;
150 KSelectAction *mActionSelectView; 152 KSelectAction *mActionSelectView;
151 153
152}; 154};
153 155
154#endif 156#endif