author | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
commit | b9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff) | |
tree | 2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /kaddressbook/views/kaddressbookcardview.h | |
download | kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2 |
Initial revision
Diffstat (limited to 'kaddressbook/views/kaddressbookcardview.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/kaddressbookcardview.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.h b/kaddressbook/views/kaddressbookcardview.h new file mode 100644 index 0000000..cd70371 --- a/dev/null +++ b/kaddressbook/views/kaddressbookcardview.h | |||
@@ -0,0 +1,117 @@ | |||
1 | #ifndef KADDRESSBOOKCARDVIEW_H | ||
2 | #define KADDRESSBOOKCARDVIEW_H | ||
3 | |||
4 | /* | ||
5 | This file is part of KAddressBook. | ||
6 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | ||
7 | |||
8 | This program is free software; you can redistribute it and/or modify | ||
9 | it under the terms of the GNU General Public License as published by | ||
10 | the Free Software Foundation; either version 2 of the License, or | ||
11 | (at your option) any later version. | ||
12 | |||
13 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | GNU General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU General Public License | ||
19 | along with this program; if not, write to the Free Software | ||
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
21 | |||
22 | As a special exception, permission is given to link this program | ||
23 | with any edition of Qt, and distribute the resulting executable, | ||
24 | without including the source code for Qt in the source distribution. | ||
25 | */ | ||
26 | |||
27 | #include <qstring.h> | ||
28 | #ifndef KAB_EMBEDDED | ||
29 | #include <kiconview.h> | ||
30 | #else //KAB_EMBEDDED | ||
31 | #include <klocale.h> | ||
32 | #endif //KAB_EMBEDDED | ||
33 | |||
34 | #include "cardview.h" | ||
35 | #include "kaddressbookview.h" | ||
36 | #include "configurecardviewdialog.h" | ||
37 | |||
38 | class QDragEnterEvent; | ||
39 | class QDragEntryEvent; | ||
40 | class QDropEvent; | ||
41 | class KConfig; | ||
42 | class AddresseeCardView; | ||
43 | |||
44 | /** | ||
45 | This view uses the CardView class to create a card view. At some | ||
46 | point in the future I think this will be the default view of | ||
47 | KAddressBook. | ||
48 | */ | ||
49 | class KAddressBookCardView : public KAddressBookView | ||
50 | { | ||
51 | Q_OBJECT | ||
52 | |||
53 | public: | ||
54 | KAddressBookCardView( KABC::AddressBook *ab, QWidget *parent, | ||
55 | const char *name = 0 ); | ||
56 | virtual ~KAddressBookCardView(); | ||
57 | |||
58 | virtual QStringList selectedUids(); | ||
59 | virtual QString type() const { return "Card"; } | ||
60 | |||
61 | virtual void readConfig(KConfig *config); | ||
62 | virtual void writeConfig(KConfig *); | ||
63 | |||
64 | public slots: | ||
65 | void refresh(QString uid = QString::null); | ||
66 | void setSelected(QString uid/*US = QString::null*/, bool selected/*US = true*/); | ||
67 | //US added an additional method without parameter | ||
68 | void setSelected(); | ||
69 | |||
70 | protected slots: | ||
71 | void addresseeExecuted(CardViewItem *item); | ||
72 | void addresseeSelected(); | ||
73 | |||
74 | private: | ||
75 | AddresseeCardView *mCardView; | ||
76 | bool mShowEmptyFields; | ||
77 | }; | ||
78 | |||
79 | class AddresseeCardView : public CardView | ||
80 | { | ||
81 | Q_OBJECT | ||
82 | public: | ||
83 | AddresseeCardView(QWidget *parent, const char *name = 0); | ||
84 | ~AddresseeCardView(); | ||
85 | |||
86 | signals: | ||
87 | void startAddresseeDrag(); | ||
88 | void addresseeDropped(QDropEvent *); | ||
89 | |||
90 | protected: | ||
91 | virtual void dragEnterEvent(QDragEnterEvent *); | ||
92 | virtual void dropEvent(QDropEvent *); | ||
93 | virtual void startDrag(); | ||
94 | }; | ||
95 | |||
96 | |||
97 | class CardViewFactory : public ViewFactory | ||
98 | { | ||
99 | public: | ||
100 | KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) | ||
101 | { | ||
102 | return new KAddressBookCardView( ab, parent, name ); | ||
103 | } | ||
104 | |||
105 | QString type() const { return "Card"; } | ||
106 | |||
107 | QString description() const { return i18n( "Rolodex style cards represent contacts." ); } | ||
108 | |||
109 | ViewConfigureWidget *configureWidget( KABC::AddressBook *ab, QWidget *parent, | ||
110 | const char *name = 0 ) | ||
111 | { | ||
112 | return new ConfigureCardViewWidget( ab, parent, name ); | ||
113 | } | ||
114 | }; | ||
115 | |||
116 | |||
117 | #endif | ||