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