Diffstat (limited to 'kaddressbook/views/contactlistview.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/contactlistview.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kaddressbook/views/contactlistview.h b/kaddressbook/views/contactlistview.h index 46477e1..c92b002 100644 --- a/kaddressbook/views/contactlistview.h +++ b/kaddressbook/views/contactlistview.h | |||
@@ -1,119 +1,123 @@ | |||
1 | #ifndef CONTACTLISTVIEW_H | 1 | #ifndef CONTACTLISTVIEW_H |
2 | #define CONTACTLISTVIEW_H | 2 | #define CONTACTLISTVIEW_H |
3 | 3 | ||
4 | #include <qcolor.h> | 4 | #include <qcolor.h> |
5 | #include <qpixmap.h> | 5 | #include <qpixmap.h> |
6 | #include <qtooltip.h> | 6 | #include <qtooltip.h> |
7 | #include <qstring.h> | 7 | #include <qstring.h> |
8 | //Added by qt3to4: | ||
9 | #include <QDropEvent> | ||
10 | #include <QMouseEvent> | ||
11 | #include <QKeyEvent> | ||
8 | 12 | ||
9 | #include <klistview.h> | 13 | #include <klistview.h> |
10 | 14 | ||
11 | #include <kabc/field.h> | 15 | #include <kabc/field.h> |
12 | #include <kabc/addressee.h> | 16 | #include <kabc/addressee.h> |
13 | #include <kabc/addressbook.h> | 17 | #include <kabc/addressbook.h> |
14 | 18 | ||
15 | 19 | ||
16 | class QDropEvent; | 20 | class QDropEvent; |
17 | class KAddressBookTableView; | 21 | class KAddressBookTableView; |
18 | class ContactListView; | 22 | class ContactListView; |
19 | 23 | ||
20 | /** The whole tooltip design needs a lot of work. Currently it is | 24 | /** The whole tooltip design needs a lot of work. Currently it is |
21 | * hacked together to function. | 25 | * hacked together to function. |
22 | */ | 26 | */ |
23 | class DynamicTip : public QToolTip | 27 | class DynamicTip /* TODO:hacker: : public QToolTip */ |
24 | { | 28 | { |
25 | public: | 29 | public: |
26 | DynamicTip( ContactListView * parent ); | 30 | DynamicTip( ContactListView * parent ); |
27 | 31 | ||
28 | protected: | 32 | protected: |
29 | void maybeTip( const QPoint & ); | 33 | void maybeTip( const QPoint & ); |
30 | 34 | ||
31 | private: | 35 | private: |
32 | }; | 36 | }; |
33 | 37 | ||
34 | class ContactListViewItem : public KListViewItem | 38 | class ContactListViewItem : public KListViewItem |
35 | { | 39 | { |
36 | 40 | ||
37 | public: | 41 | public: |
38 | ContactListViewItem(const KABC::Addressee &a, ContactListView* parent, | 42 | ContactListViewItem(const KABC::Addressee &a, ContactListView* parent, |
39 | KABC::AddressBook *doc, const KABC::Field::List &fields ); | 43 | KABC::AddressBook *doc, const KABC::Field::List &fields ); |
40 | const KABC::Addressee &addressee() const { return mAddressee; } | 44 | const KABC::Addressee &addressee() const { return mAddressee; } |
41 | virtual void refresh(); | 45 | virtual void refresh(); |
42 | virtual ContactListView* parent(); | 46 | virtual ContactListView* parent(); |
43 | virtual QString key ( int, bool ) const; | 47 | virtual QString key ( int, bool ) const; |
44 | 48 | ||
45 | /** Adds the border around the cell if the user wants it. | 49 | /** Adds the border around the cell if the user wants it. |
46 | * This is how the single line config option is implemented. | 50 | * This is how the single line config option is implemented. |
47 | */ | 51 | */ |
48 | virtual void paintCell(QPainter * p, const QColorGroup & cg, | 52 | virtual void paintCell(QPainter * p, const QColorGroup & cg, |
49 | int column, int width, int align ); | 53 | int column, int width, int align ); |
50 | 54 | ||
51 | private: | 55 | private: |
52 | KABC::Addressee mAddressee; | 56 | KABC::Addressee mAddressee; |
53 | KABC::Field::List mFields; | 57 | KABC::Field::List mFields; |
54 | ContactListView *parentListView; | 58 | ContactListView *parentListView; |
55 | KABC::AddressBook *mDocument; | 59 | KABC::AddressBook *mDocument; |
56 | }; | 60 | }; |
57 | 61 | ||
58 | 62 | ||
59 | ///////////////////////////////////////////// | 63 | ///////////////////////////////////////////// |
60 | // ContactListView | 64 | // ContactListView |
61 | 65 | ||
62 | class ContactListView : public KListView | 66 | class ContactListView : public KListView |
63 | { | 67 | { |
64 | Q_OBJECT | 68 | Q_OBJECT |
65 | 69 | ||
66 | public: | 70 | public: |
67 | ContactListView(KAddressBookTableView *view, | 71 | ContactListView(KAddressBookTableView *view, |
68 | KABC::AddressBook *doc, | 72 | KABC::AddressBook *doc, |
69 | QWidget *parent, | 73 | QWidget *parent, |
70 | const char *name = 0L ); | 74 | const char *name = 0L ); |
71 | virtual ~ContactListView() {} | 75 | virtual ~ContactListView() {} |
72 | //void resort(); | 76 | //void resort(); |
73 | 77 | ||
74 | /** Returns true if tooltips should be displayed, false otherwise | 78 | /** Returns true if tooltips should be displayed, false otherwise |
75 | */ | 79 | */ |
76 | bool tooltips() const { return mToolTips; } | 80 | bool tooltips() const { return mToolTips; } |
77 | void setToolTipsEnabled(bool enabled) { mToolTips = enabled; } | 81 | void setToolTipsEnabled(bool enabled) { mToolTips = enabled; } |
78 | 82 | ||
79 | bool alternateBackground() const { return mABackground; } | 83 | bool alternateBackground() const { return mABackground; } |
80 | void setAlternateBackgroundEnabled(bool enabled); | 84 | void setAlternateBackgroundEnabled(bool enabled); |
81 | 85 | ||
82 | bool singleLine() const { return mSingleLine; } | 86 | bool singleLine() const { return mSingleLine; } |
83 | void setSingleLineEnabled(bool enabled) { mSingleLine = enabled; } | 87 | void setSingleLineEnabled(bool enabled) { mSingleLine = enabled; } |
84 | 88 | ||
85 | const QColor &alternateColor() const { return mAlternateColor; } | 89 | const QColor &alternateColor() const { return mAlternateColor; } |
86 | void setAlternateColor(const QColor &mAlternateColor); | 90 | void setAlternateColor(const QColor &mAlternateColor); |
87 | 91 | ||
88 | /** Sets the background pixmap to <i>filename</i>. If the | 92 | /** Sets the background pixmap to <i>filename</i>. If the |
89 | * QString is empty (QString::isEmpty()), then the background | 93 | * QString is empty (QString::isEmpty()), then the background |
90 | * pixmap will be disabled. | 94 | * pixmap will be disabled. |
91 | */ | 95 | */ |
92 | void setBackgroundPixmap(const QString &filename); | 96 | void setBackgroundPixmap(const QString &filename); |
93 | 97 | ||
94 | protected: | 98 | protected: |
95 | bool mFlagKeyPressed; | 99 | bool mFlagKeyPressed; |
96 | bool mFlagBlockKeyPressed; | 100 | bool mFlagBlockKeyPressed; |
97 | virtual void keyPressEvent ( QKeyEvent * ); | 101 | virtual void keyPressEvent ( QKeyEvent * ); |
98 | virtual void keyReleaseEvent ( QKeyEvent * ); | 102 | virtual void keyReleaseEvent ( QKeyEvent * ); |
99 | /** Paints the background pixmap in the empty area. This method is needed | 103 | /** Paints the background pixmap in the empty area. This method is needed |
100 | * since Qt::FixedPixmap will not scroll with the list view. | 104 | * since Qt::FixedPixmap will not scroll with the list view. |
101 | */ | 105 | */ |
102 | virtual void paintEmptyArea( QPainter * p, const QRect & rect ); | 106 | virtual void paintEmptyArea( QPainter * p, const QRect & rect ); |
103 | virtual void contentsMousePressEvent(QMouseEvent*); | 107 | virtual void contentsMousePressEvent(QMouseEvent*); |
104 | void contentsMouseMoveEvent( QMouseEvent *e ); | 108 | void contentsMouseMoveEvent( QMouseEvent *e ); |
105 | void contentsDropEvent( QDropEvent *e ); | 109 | void contentsDropEvent( QDropEvent *e ); |
106 | virtual bool acceptDrag(QDropEvent *e) const; | 110 | virtual bool acceptDrag(QDropEvent *e) const; |
107 | 111 | ||
108 | protected slots: | 112 | protected slots: |
109 | void itemDropped(QDropEvent *e); | 113 | void itemDropped(QDropEvent *e); |
110 | 114 | ||
111 | public slots: | 115 | public slots: |
112 | void printMe(); | 116 | void printMe(); |
113 | 117 | ||
114 | signals: | 118 | signals: |
115 | void startAddresseeDrag(); | 119 | void startAddresseeDrag(); |
116 | void addresseeDropped(QDropEvent *); | 120 | void addresseeDropped(QDropEvent *); |
117 | 121 | ||
118 | private: | 122 | private: |
119 | KAddressBookTableView *pabWidget; | 123 | KAddressBookTableView *pabWidget; |