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