Diffstat (limited to 'core/pim/addressbook/abtable.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index 9825665..092e86f 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h | |||
@@ -21,40 +21,50 @@ | |||
21 | 21 | ||
22 | #ifndef ABTABLE_H | 22 | #ifndef ABTABLE_H |
23 | #define ABTABLE_H | 23 | #define ABTABLE_H |
24 | 24 | ||
25 | #include <qpe/categories.h> | 25 | #include <qpe/categories.h> |
26 | #include <opie/ocontact.h> | 26 | #include <opie/ocontact.h> |
27 | #include <opie/ocontactaccess.h> | 27 | #include <opie/ocontactaccess.h> |
28 | 28 | ||
29 | #include <qmap.h> | 29 | #include <qmap.h> |
30 | #include <qtable.h> | 30 | #include <qtable.h> |
31 | #include <qstringlist.h> | 31 | #include <qstringlist.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qpixmap.h> | ||
33 | 34 | ||
34 | class AbTableItem : public QTableItem | 35 | class AbTableItem : public QTableItem |
35 | { | 36 | { |
36 | public: | 37 | public: |
37 | AbTableItem( QTable *t, EditType et, const QString &s, | 38 | AbTableItem( QTable *t, EditType et, const QString &s, |
38 | const QString &secondSortKey); | 39 | const QString &secondSortKey); |
39 | QString entryKey() const; | 40 | QString entryKey() const; |
40 | void setEntryKey( const QString & k ); | 41 | void setEntryKey( const QString & k ); |
41 | virtual int alignment() const; | 42 | virtual int alignment() const; |
42 | virtual QString key() const; | 43 | virtual QString key() const; |
43 | void setItem( const QString &txt, const QString &secondKey ); | 44 | void setItem( const QString &txt, const QString &secondKey ); |
44 | 45 | ||
45 | private: | 46 | private: |
46 | QString sortKey; | 47 | QString sortKey; |
47 | }; | 48 | }; |
48 | 49 | ||
50 | // This is a simple container, storing all contact | ||
51 | // information | ||
52 | class ContactItem | ||
53 | { | ||
54 | public: | ||
55 | QPixmap icon; | ||
56 | QString value; | ||
57 | }; | ||
58 | |||
49 | class AbPickItem : public QTableItem | 59 | class AbPickItem : public QTableItem |
50 | { | 60 | { |
51 | public: | 61 | public: |
52 | AbPickItem( QTable *t ); | 62 | AbPickItem( QTable *t ); |
53 | 63 | ||
54 | QWidget *createEditor() const; | 64 | QWidget *createEditor() const; |
55 | void setContentFromEditor( QWidget *w ); | 65 | void setContentFromEditor( QWidget *w ); |
56 | 66 | ||
57 | private: | 67 | private: |
58 | QGuardedPtr<QComboBox> cb; | 68 | QGuardedPtr<QComboBox> cb; |
59 | }; | 69 | }; |
60 | 70 | ||
@@ -106,25 +116,25 @@ protected: | |||
106 | // int rowPos( int row ) const; | 116 | // int rowPos( int row ) const; |
107 | // virtual int rowAt( int pos ) const; | 117 | // virtual int rowAt( int pos ) const; |
108 | 118 | ||
109 | 119 | ||
110 | protected slots: | 120 | protected slots: |
111 | void moveTo( char ); | 121 | void moveTo( char ); |
112 | virtual void columnClicked( int col ); | 122 | virtual void columnClicked( int col ); |
113 | void itemClicked(int,int col); | 123 | void itemClicked(int,int col); |
114 | void rowHeightChanged( int row ); | 124 | void rowHeightChanged( int row ); |
115 | 125 | ||
116 | private: | 126 | private: |
117 | void insertIntoTable( const OContact &cnt, int row ); | 127 | void insertIntoTable( const OContact &cnt, int row ); |
118 | QString findContactContact( const OContact &entry, int row ); | 128 | ContactItem findContactContact( const OContact &entry, int row ); |
119 | void fitColumns(); | 129 | void fitColumns(); |
120 | void resizeRows(); | 130 | void resizeRows(); |
121 | void realignTable(); | 131 | void realignTable(); |
122 | void resort(); | 132 | void resort(); |
123 | void updateVisible(); | 133 | void updateVisible(); |
124 | 134 | ||
125 | int lastSortCol; | 135 | int lastSortCol; |
126 | bool asc; | 136 | bool asc; |
127 | QMap<AbTableItem*, OContact> contactList; | 137 | QMap<AbTableItem*, OContact> contactList; |
128 | QValueList<int> intFields; | 138 | QValueList<int> intFields; |
129 | QStringList choicenames; | 139 | QStringList choicenames; |
130 | bool enablePainting; | 140 | bool enablePainting; |