Diffstat (limited to 'core/pim/addressbook/abtable.h') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index b9ebe27..927a5a9 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h | |||
@@ -1,51 +1,52 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) | 3 | ** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) |
4 | ** | 4 | ** |
5 | ** This file is part of Qt Palmtop Environment. | 5 | ** This file is part of Qt Palmtop Environment. |
6 | ** | 6 | ** |
7 | ** This file may be distributed and/or modified under the terms of the | 7 | ** This file may be distributed and/or modified under the terms of the |
8 | ** GNU General Public License version 2 as published by the Free Software | 8 | ** GNU General Public License version 2 as published by the Free Software |
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
10 | ** packaging of this file. | 10 | ** packaging of this file. |
11 | ** | 11 | ** |
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | ** | 14 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 16 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #ifndef ABTABLE_H | 22 | #ifndef ABTABLE_H |
23 | #define ABTABLE_H | 23 | #define ABTABLE_H |
24 | 24 | ||
25 | #include <opie2/opimcontact.h> | ||
26 | #include <opie2/ocontactaccess.h> | ||
27 | |||
25 | #include <qpe/categories.h> | 28 | #include <qpe/categories.h> |
26 | #include <opie/ocontact.h> | ||
27 | #include <opie/ocontactaccess.h> | ||
28 | 29 | ||
29 | #include <qmap.h> | 30 | #include <qmap.h> |
30 | #include <qtable.h> | 31 | #include <qtable.h> |
31 | #include <qstringlist.h> | 32 | #include <qstringlist.h> |
32 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
33 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
34 | 35 | ||
35 | #if 0 | 36 | #if 0 |
36 | class AbTableItem : public QTableItem | 37 | class AbTableItem : public QTableItem |
37 | { | 38 | { |
38 | public: | 39 | public: |
39 | AbTableItem( QTable *t, EditType et, const QString &s, | 40 | AbTableItem( QTable *t, EditType et, const QString &s, |
40 | const QString &secondSortKey); | 41 | const QString &secondSortKey); |
41 | QString entryKey() const; | 42 | QString entryKey() const; |
42 | void setEntryKey( const QString & k ); | 43 | void setEntryKey( const QString & k ); |
43 | virtual int alignment() const; | 44 | virtual int alignment() const; |
44 | virtual QString key() const; | 45 | virtual QString key() const; |
45 | void setItem( const QString &txt, const QString &secondKey ); | 46 | void setItem( const QString &txt, const QString &secondKey ); |
46 | 47 | ||
47 | private: | 48 | private: |
48 | QString sortKey; | 49 | QString sortKey; |
49 | }; | 50 | }; |
50 | 51 | ||
51 | #endif | 52 | #endif |
@@ -62,97 +63,97 @@ class ContactItem | |||
62 | #if 0 | 63 | #if 0 |
63 | class AbPickItem : public QTableItem | 64 | class AbPickItem : public QTableItem |
64 | { | 65 | { |
65 | public: | 66 | public: |
66 | AbPickItem( QTable *t ); | 67 | AbPickItem( QTable *t ); |
67 | 68 | ||
68 | QWidget *createEditor() const; | 69 | QWidget *createEditor() const; |
69 | void setContentFromEditor( QWidget *w ); | 70 | void setContentFromEditor( QWidget *w ); |
70 | 71 | ||
71 | private: | 72 | private: |
72 | QGuardedPtr<QComboBox> cb; | 73 | QGuardedPtr<QComboBox> cb; |
73 | }; | 74 | }; |
74 | 75 | ||
75 | #endif | 76 | #endif |
76 | 77 | ||
77 | class AbTable : public QTable | 78 | class AbTable : public QTable |
78 | { | 79 | { |
79 | Q_OBJECT | 80 | Q_OBJECT |
80 | 81 | ||
81 | public: | 82 | public: |
82 | AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); | 83 | AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); |
83 | ~AbTable(); | 84 | ~AbTable(); |
84 | 85 | ||
85 | // Set the contacts shown in the table | 86 | // Set the contacts shown in the table |
86 | void setContacts( const OContactAccess::List& viewList ); | 87 | void setContacts( const Opie::OPimContactAccess::List& viewList ); |
87 | 88 | ||
88 | // Set the list for primary contacts | 89 | // Set the list for primary contacts |
89 | void setOrderedList( const QValueList<int> ordered ); | 90 | void setOrderedList( const QValueList<int> ordered ); |
90 | 91 | ||
91 | // Selects a contact of a specific UID | 92 | // Selects a contact of a specific UID |
92 | bool selectContact( int UID ); | 93 | bool selectContact( int UID ); |
93 | 94 | ||
94 | // Get the current selected entry | 95 | // Get the current selected entry |
95 | OContact currentEntry(); | 96 | Opie::OPimContact currentEntry(); |
96 | 97 | ||
97 | // Get the UID of the current selected Entry | 98 | // Get the UID of the current selected Entry |
98 | int currentEntry_UID(); | 99 | int currentEntry_UID(); |
99 | 100 | ||
100 | // QString findContactName( const OContact &entry ); | 101 | // QString findContactName( const Opie::OPimContact &entry ); |
101 | 102 | ||
102 | void init(); | 103 | void init(); |
103 | void clear(); | 104 | void clear(); |
104 | void refresh(); | 105 | void refresh(); |
105 | 106 | ||
106 | void show(); | 107 | void show(); |
107 | void setPaintingEnabled( bool e ); | 108 | void setPaintingEnabled( bool e ); |
108 | void viewportPaintEvent( QPaintEvent* e); | 109 | void viewportPaintEvent( QPaintEvent* e); |
109 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); | 110 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); |
110 | 111 | ||
111 | // addresspicker mode (What's that ? se) | 112 | // addresspicker mode (What's that ? se) |
112 | // void setChoiceNames( const QStringList& list); | 113 | // void setChoiceNames( const QStringList& list); |
113 | // QStringList choiceNames() const; | 114 | // QStringList choiceNames() const; |
114 | void setChoiceSelection( const QValueList<int>& list ); | 115 | void setChoiceSelection( const QValueList<int>& list ); |
115 | QStringList choiceSelection(int index) const; | 116 | QStringList choiceSelection(int index) const; |
116 | 117 | ||
117 | signals: | 118 | signals: |
118 | void signalSwitch(); | 119 | void signalSwitch(); |
119 | void signalEditor(); | 120 | void signalEditor(); |
120 | void signalKeyDown(); | 121 | void signalKeyDown(); |
121 | void signalKeyUp(); | 122 | void signalKeyUp(); |
122 | 123 | ||
123 | protected: | 124 | protected: |
124 | virtual void keyPressEvent( QKeyEvent *e ); | 125 | virtual void keyPressEvent( QKeyEvent *e ); |
125 | 126 | ||
126 | // int rowHeight( int ) const; | 127 | // int rowHeight( int ) const; |
127 | // int rowPos( int row ) const; | 128 | // int rowPos( int row ) const; |
128 | // virtual int rowAt( int pos ) const; | 129 | // virtual int rowAt( int pos ) const; |
129 | 130 | ||
130 | 131 | ||
131 | protected slots: | 132 | protected slots: |
132 | void moveTo( char ); | 133 | void moveTo( char ); |
133 | virtual void columnClicked( int col ); | 134 | virtual void columnClicked( int col ); |
134 | void itemClicked(int,int col); | 135 | void itemClicked(int,int col); |
135 | void rowHeightChanged( int row ); | 136 | void rowHeightChanged( int row ); |
136 | 137 | ||
137 | private: | 138 | private: |
138 | // void insertIntoTable( const OContact &cnt, int row ); | 139 | // void insertIntoTable( const Opie::OPimContact &cnt, int row ); |
139 | ContactItem findContactContact( const OContact &entry, int row ); | 140 | ContactItem findContactContact( const Opie::OPimContact &entry, int row ); |
140 | void fitColumns(); | 141 | void fitColumns(); |
141 | void resizeRows(); | 142 | void resizeRows(); |
142 | void realignTable(); | 143 | void realignTable(); |
143 | void resort(); | 144 | void resort(); |
144 | void updateVisible(); | 145 | void updateVisible(); |
145 | 146 | ||
146 | int lastSortCol; | 147 | int lastSortCol; |
147 | bool asc; | 148 | bool asc; |
148 | // QMap<AbTableItem*, OContact> contactList; | 149 | // QMap<AbTableItem*, Opie::OPimContact> contactList; |
149 | QValueList<int> intFields; | 150 | QValueList<int> intFields; |
150 | QStringList choicenames; | 151 | QStringList choicenames; |
151 | bool enablePainting; | 152 | bool enablePainting; |
152 | bool columnVisible; | 153 | bool columnVisible; |
153 | int countNested; | 154 | int countNested; |
154 | 155 | ||
155 | OContactAccess::List m_viewList; | 156 | Opie::OPimContactAccess::List m_viewList; |
156 | 157 | ||
157 | }; | 158 | }; |
158 | #endif // ABTABLE_H | 159 | #endif // ABTABLE_H |