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