summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/kaddressbookiconview.h
Unidiff
Diffstat (limited to 'kaddressbook/views/kaddressbookiconview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbookiconview.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/kaddressbook/views/kaddressbookiconview.h b/kaddressbook/views/kaddressbookiconview.h
index b0b9fea..6fad4c6 100644
--- a/kaddressbook/views/kaddressbookiconview.h
+++ b/kaddressbook/views/kaddressbookiconview.h
@@ -4,131 +4,134 @@
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 KADDRESSBOOKICONVIEW_H 24#ifndef KADDRESSBOOKICONVIEW_H
25#define KADDRESSBOOKICONVIEW_H 25#define KADDRESSBOOKICONVIEW_H
26 26
27#include <qstring.h> 27#include <qstring.h>
28//Added by qt3to4:
29#include <Q3ValueList>
30#include <QDropEvent>
28#ifndef KAB_EMBEDDED 31#ifndef KAB_EMBEDDED
29#include <kiconview.h> 32#include <kiconview.h>
30#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
31#include <qiconview.h> 34#include <q3iconview.h>
32#include <qptrlist.h> 35#include <q3ptrlist.h>
33#include <klocale.h> 36#include <klocale.h>
34#endif //KAB_EMBEDDED 37#endif //KAB_EMBEDDED
35#include "kaddressbookview.h" 38#include "kaddressbookview.h"
36 39
37class QIconViewItem; 40class Q3IconViewItem;
38class KConfig; 41class KConfig;
39class AddresseeIconView; 42class AddresseeIconView;
40class AddresseeIconViewItem; 43class AddresseeIconViewItem;
41class QIconDragItem; 44class Q3IconDragItem;
42class KAddressBookIconView; 45class KAddressBookIconView;
43 46
44namespace KABC { class AddressBook; } 47namespace KABC { class AddressBook; }
45 48
46/** This is an example kaddressbook view that is implemented using 49/** This is an example kaddressbook view that is implemented using
47* KIconView. This view is not the most useful view, but it displays 50* KIconView. This view is not the most useful view, but it displays
48* how simple implementing a new view can be. 51* how simple implementing a new view can be.
49*/ 52*/
50class KAddressBookIconView : public KAddressBookView 53class KAddressBookIconView : public KAddressBookView
51{ 54{
52 Q_OBJECT 55 Q_OBJECT
53 56
54 public: 57 public:
55 KAddressBookIconView( KABC::AddressBook *ab, QWidget *parent, 58 KAddressBookIconView( KABC::AddressBook *ab, QWidget *parent,
56 const char *name = 0 ); 59 const char *name = 0 );
57 virtual ~KAddressBookIconView(); 60 virtual ~KAddressBookIconView();
58 61
59 virtual QStringList selectedUids(); 62 virtual QStringList selectedUids();
60 virtual QString type() const { return "Icon"; } 63 virtual QString type() const { return "Icon"; }
61 void doSearch( const QString& s ,KABC::Field *field ); 64 void doSearch( const QString& s ,KABC::Field *field );
62 65
63 virtual void readConfig(KConfig *config); 66 virtual void readConfig(KConfig *config);
64 virtual void scrollUP(); 67 virtual void scrollUP();
65 virtual void scrollDOWN(); 68 virtual void scrollDOWN();
66 virtual void setFocusAV(); 69 virtual void setFocusAV();
67 70
68 public slots: 71 public slots:
69 void refresh(QString uid = QString::null); 72 void refresh(QString uid = QString::null);
70#ifndef KAB_EMBEDDED 73#ifndef KAB_EMBEDDED
71//MOC_SKIP_BEGIN 74#ifndef Q_MOC_RUN
72 void setSelected(QString uid = QString::null, bool selected = true); 75 void setSelected(QString uid = QString::null, bool selected = true);
73//MOC_SKIP_END 76#endif
74#else //KAB_EMBEDDED 77#else //KAB_EMBEDDED
75//US my MOC do not like default parameters ??? 78//US my MOC do not like default parameters ???
76 void setSelected(QString uid, bool selected); 79 void setSelected(QString uid, bool selected);
77#endif //KAB_EMBEDDED 80#endif //KAB_EMBEDDED
78 81
79 protected slots: 82 protected slots:
80 void addresseeExecuted(QIconViewItem *item); 83 void addresseeExecuted(Q3IconViewItem *item);
81 void addresseeSelected(); 84 void addresseeSelected();
82 85
83 private: 86 private:
84 AddresseeIconView *mIconView; 87 AddresseeIconView *mIconView;
85 QPtrList<AddresseeIconViewItem> mIconList; 88 Q3PtrList<AddresseeIconViewItem> mIconList;
86}; 89};
87 90
88 91
89#ifndef KAB_EMBEDDED 92#ifndef KAB_EMBEDDED
90//MOC_SKIP_BEGIN 93#ifndef Q_MOC_RUN
91class AddresseeIconView : public KIconView 94class AddresseeIconView : public KIconView
92//MOC_SKIP_END 95#endif
93#else //KAB_EMBEDDED 96#else //KAB_EMBEDDED
94class AddresseeIconView : public QIconView 97class AddresseeIconView : public Q3IconView
95#endif //KAB_EMBEDDED 98#endif //KAB_EMBEDDED
96{ 99{
97 Q_OBJECT 100 Q_OBJECT
98 101
99 public: 102 public:
100 AddresseeIconView(QWidget *parent, const char *name); 103 AddresseeIconView(QWidget *parent, const char *name);
101 ~AddresseeIconView(); 104 ~AddresseeIconView();
102 105
103 signals: 106 signals:
104 void addresseeDropped(QDropEvent *); 107 void addresseeDropped(QDropEvent *);
105 void startAddresseeDrag(); 108 void startAddresseeDrag();
106 109
107 protected: 110 protected:
108 virtual QDragObject *dragObject(); 111 virtual Q3DragObject *dragObject();
109 112
110 protected slots: 113 protected slots:
111 void itemDropped(QDropEvent *, const QValueList<QIconDragItem> &); 114 void itemDropped(QDropEvent *, const Q3ValueList<Q3IconDragItem> &);
112}; 115};
113 116
114class IconViewFactory : public ViewFactory 117class IconViewFactory : public ViewFactory
115{ 118{
116 public: 119 public:
117 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) 120 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name )
118 { 121 {
119 return new KAddressBookIconView( ab, parent, name ); 122 return new KAddressBookIconView( ab, parent, name );
120 } 123 }
121 124
122 QString type() const { return "Icon"; } 125 QString type() const { return "Icon"; }
123 126
124 QString description() const { return i18n( "Icons represent contacts. Very simple view." ); } 127 QString description() const { return i18n( "Icons represent contacts. Very simple view." ); }
125}; 128};
126/* 129/*
127extern "C" { 130extern "C" {
128 void *init_libkaddrbk_iconview() 131 void *init_libkaddrbk_iconview()
129 { 132 {
130 return ( new IconViewFactory ); 133 return ( new IconViewFactory );
131 } 134 }
132} 135}
133*/ 136*/
134#endif 137#endif