summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.h
Unidiff
Diffstat (limited to 'core/pim/addressbook/abtable.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h
index d5ff279..84aef1e 100644
--- a/core/pim/addressbook/abtable.h
+++ b/core/pim/addressbook/abtable.h
@@ -13,31 +13,33 @@
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef ABTABLE_H 21#ifndef ABTABLE_H
22#define ABTABLE_H 22#define ABTABLE_H
23 23
24#include <qpe/categories.h> 24#include <qpe/categories.h>
25#include <qpe/contact.h> 25#include <opie/ocontact.h>
26 26
27#include <qmap.h> 27#include <qmap.h>
28#include <qtable.h> 28#include <qtable.h>
29#include <qstringlist.h> 29#include <qstringlist.h>
30#include <qcombobox.h> 30#include <qcombobox.h>
31 31
32#include <opie/ocontactaccess.h>
33
32class AbTableItem : public QTableItem 34class AbTableItem : public QTableItem
33{ 35{
34public: 36public:
35 AbTableItem( QTable *t, EditType et, const QString &s, 37 AbTableItem( QTable *t, EditType et, const QString &s,
36 const QString &secondSortKey); 38 const QString &secondSortKey);
37 QString entryKey() const; 39 QString entryKey() const;
38 void setEntryKey( const QString & k ); 40 void setEntryKey( const QString & k );
39 virtual int alignment() const; 41 virtual int alignment() const;
40 virtual QString key() const; 42 virtual QString key() const;
41 void setItem( const QString &txt, const QString &secondKey ); 43 void setItem( const QString &txt, const QString &secondKey );
42 44
43private: 45private:
@@ -55,52 +57,55 @@ public:
55private: 57private:
56 QGuardedPtr<QComboBox> cb; 58 QGuardedPtr<QComboBox> cb;
57}; 59};
58 60
59class AbTable : public QTable 61class AbTable : public QTable
60{ 62{
61 Q_OBJECT 63 Q_OBJECT
62 64
63public: 65public:
64 AbTable( const QValueList<int> *ordered, QWidget *parent, const char *name=0 ); 66 AbTable( const QValueList<int> *ordered, QWidget *parent, const char *name=0 );
65 ~AbTable(); 67 ~AbTable();
66 // NEW 68 // NEW
67 void addEntry( const Contact &newContact ); 69 void addEntry( const OContact &newContact );
68 Contact currentEntry(); 70 OContact currentEntry();
69 void replaceCurrentEntry( const Contact &newContact ); 71 void replaceCurrentEntry( const OContact &newContact );
70 72
71 void init(); 73 void init();
72 74
73 void deleteCurrentEntry(); 75 void deleteCurrentEntry();
74 void clear(); 76 void clear();
75 void clearFindRow() { currFindRow = -2; } 77 void clearFindRow() { currFindRow = -2; }
76 void loadFields(); 78 void loadFields();
77 void refresh(); 79 void refresh();
78 bool save( const QString &fn ); 80 bool save( const QString &fn );
79 void load( const QString &fn ); 81 void load( const QString &fn );
80 82
81 // addresspicker mode 83 // addresspicker mode
82 void setChoiceNames( const QStringList& list); 84 void setChoiceNames( const QStringList& list);
83 QStringList choiceNames() const; 85 QStringList choiceNames() const;
84 void setChoiceSelection(int index, const QStringList& list); 86 void setChoiceSelection(int index, const QStringList& list);
85 QStringList choiceSelection(int index) const; 87 QStringList choiceSelection(int index) const;
86 void setShowCategory( const QString &c ); 88 void setShowCategory( const QString &b, const QString &c );
87 void setShowByLetter( char c ); 89 void setShowByLetter( char c );
88 QString showCategory() const; 90 QString showCategory() const;
89 QStringList categories(); 91 QStringList categories();
90 void resizeRows( int size ); 92
93 void resizeRows();
91 94
92 void show(); 95 void show();
93 void setPaintingEnabled( bool e ); 96 void setPaintingEnabled( bool e );
94 97
98 QString showBook() const;
99
95public slots: 100public slots:
96 void slotDoFind( const QString &str, bool caseSensitive, bool backwards, 101 void slotDoFind( const QString &str, bool caseSensitive, bool backwards,
97 int category ); 102 int category );
98signals: 103signals:
99 void empty( bool ); 104 void empty( bool );
100 void details(); 105 void details();
101 void signalNotFound(); 106 void signalNotFound();
102 void signalWrapAround(); 107 void signalWrapAround();
103 108
104protected: 109protected:
105 virtual void keyPressEvent( QKeyEvent *e ); 110 virtual void keyPressEvent( QKeyEvent *e );
106 111
@@ -110,34 +115,39 @@ protected:
110 115
111 116
112protected slots: 117protected slots:
113 void moveTo( char ); 118 void moveTo( char );
114 virtual void columnClicked( int col ); 119 virtual void columnClicked( int col );
115 void itemClicked(int,int col); 120 void itemClicked(int,int col);
116 void rowHeightChanged( int row ); 121 void rowHeightChanged( int row );
117 122
118private: 123private:
119 void loadFile( const QString &strFile, bool journalFile ); 124 void loadFile( const QString &strFile, bool journalFile );
120 void fitColumns(); 125 void fitColumns();
121 void resort(); 126 void resort();
122 void updateJournal( const Contact &contact, Contact::journal_action action, 127 void updateJournal( const OContact &contact, OContact::journal_action action,
123 int row = -1 ); 128 int row = -1 );
124 void insertIntoTable( const Contact &contact, int row ); 129 void insertIntoTable( const OContact &contact, int row );
125 void internalAddEntries( QList<Contact> &list ); 130 QString findContactName( const OContact &entry );
126 QString findContactName( const Contact &entry ); 131 QString findContactContact( const OContact &entry, int row );
127 QString findContactContact( const Contact &entry ); 132 void journalFreeReplace( const OContact &cnt, int row );
128 void journalFreeReplace( const Contact &cnt, int row );
129 void journalFreeRemove( int row ); 133 void journalFreeRemove( int row );
130 void realignTable( int ); 134 void realignTable( int );
131 void updateVisible(); 135 void updateVisible();
132 int lastSortCol; 136 int lastSortCol;
133 bool asc; 137 bool asc;
134 char showChar; 138 char showChar;
135 QMap<AbTableItem*, Contact> contactList; 139 QMap<AbTableItem*, OContact> contactList;
136 const QValueList<int> *intFields; 140 const QValueList<int> *intFields;
137 int currFindRow; 141 int currFindRow;
138 QString showCat; 142 QString showCat;
139 QStringList choicenames; 143 QStringList choicenames;
140 bool enablePainting; 144 bool enablePainting;
141 Categories mCat; 145 Categories mCat;
146
147 QString showBk;
148 bool columnVisible;
149
150 OContactAccess m_contactdb;
151
142}; 152};
143#endif // ABTABLE_H 153#endif // ABTABLE_H