summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.h
Unidiff
Diffstat (limited to 'core/pim/addressbook/abview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abview.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/pim/addressbook/abview.h b/core/pim/addressbook/abview.h
index 4d35338..201b521 100644
--- a/core/pim/addressbook/abview.h
+++ b/core/pim/addressbook/abview.h
@@ -8,74 +8,79 @@
8#include <opie/ocontact.h> 8#include <opie/ocontact.h>
9#include <opie/ocontactaccess.h> 9#include <opie/ocontactaccess.h>
10 10
11#include "contacteditor.h" 11#include "contacteditor.h"
12#include "abtable.h" 12#include "abtable.h"
13#include "ablabel.h" 13#include "ablabel.h"
14 14
15class AbView: public QWidget 15class AbView: public QWidget
16{ 16{
17 Q_OBJECT 17 Q_OBJECT
18 18
19public: 19public:
20 enum Views{ TableView=0, CardView, PhoneBook, CompanyBook, EmailBook }; 20 enum Views{ TableView=0, CardView, PersonalView };
21 21
22 AbView( QWidget* parent, const QValueList<int>& ordered, const QStringList& slOrderedFields ); 22 AbView( QWidget* parent, const QValueList<int>& ordered );
23 ~AbView();
23 24
24 bool save(); 25 bool save();
25 void load(); 26 void load();
26 void reload(); 27 void reload();
27 void clear(); 28 void clear();
28 29
29 void setView( Views view ); 30 void setView( Views view );
30 void showContact( const OContact& cnt ); 31 void showPersonal( bool personal );
31 void setShowByCategory( Views view, const QString& cat ); 32 void setShowByCategory( Views view, const QString& cat );
32 void setShowByLetter( char c ); 33 void setShowByLetter( char c );
34 void setListOrder( const QValueList<int>& ordered );
35
33 // Add Entry and put to current 36 // Add Entry and put to current
34 void addEntry( const OContact &newContact ); 37 void addEntry( const OContact &newContact );
35 void removeEntry( const int UID ); 38 void removeEntry( const int UID );
36 void replaceEntry( const OContact &contact ); 39 void replaceEntry( const OContact &contact );
37 OContact currentEntry(); 40 OContact currentEntry();
38 41
39 void inSearch() { m_inSearch = true; } 42 void inSearch() { m_inSearch = true; }
40 void offSearch(); 43 void offSearch();
41 44
42 QString showCategory() const; 45 QString showCategory() const;
43 QStringList categories(); 46 QStringList categories();
44 47
45signals: 48signals:
46 void signalNotFound(); 49 void signalNotFound();
47 void signalClearLetterPicker(); 50 void signalClearLetterPicker();
48 void signalViewSwitched ( int ); 51 void signalViewSwitched ( int );
49 52
50public slots: 53public slots:
51 void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, 54 void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp,
52 bool backwards, QString category = QString::null ); 55 bool backwards, QString category = QString::null );
53 void slotSwitch(); 56 void slotSwitch();
54 57
55private: 58private:
59 void updateListinViews();
56 void updateView(); 60 void updateView();
57 void clearForCategory(); 61 void clearForCategory();
58 bool contactCompare( const OContact &cnt, int category ); 62 bool contactCompare( const OContact &cnt, int category );
59 void parseName( const QString& name, QString *first, QString *middle, 63 void parseName( const QString& name, QString *first, QString *middle,
60 QString * last ); 64 QString * last );
61 65
62 Categories mCat; 66 Categories mCat;
63 bool m_inSearch; 67 bool m_inSearch;
68 bool m_inPersonal;
64 int m_curr_category; 69 int m_curr_category;
65 Views m_curr_View; 70 Views m_curr_View;
66 Views m_prev_View; 71 Views m_prev_View;
67 int m_curr_Contact; 72 int m_curr_Contact;
68 73
69 OContactAccess m_contactdb; 74 OContactAccess* m_contactdb;
75 OContactAccess* m_storedDB;
70 OContactAccess::List m_list; 76 OContactAccess::List m_list;
71 77
72 QWidgetStack* m_viewStack; 78 QWidgetStack* m_viewStack;
73 AbTable* m_abTable; 79 AbTable* m_abTable;
74 AbLabel* m_ablabel; 80 AbLabel* m_ablabel;
75 81
76 QValueList<int> m_orderedFields; 82 QValueList<int> m_orderedFields;
77 QStringList m_slOrderedFields;
78}; 83};
79 84
80 85
81#endif 86#endif