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