summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.h
authoreilers <eilers>2002-11-01 14:50:14 (UTC)
committer eilers <eilers>2002-11-01 14:50:14 (UTC)
commit3fbba334274ca53bd26cd79ccd4662e529c61f40 (patch) (side-by-side diff)
tree3fa1ccd82237757dc97a7c9b652ea43b8a16023a /core/pim/addressbook/abview.h
parent6e4730b8485d3481d554dc8c079722ee1236f375 (diff)
downloadopie-3fbba334274ca53bd26cd79ccd4662e529c61f40.zip
opie-3fbba334274ca53bd26cd79ccd4662e529c61f40.tar.gz
opie-3fbba334274ca53bd26cd79ccd4662e529c61f40.tar.bz2
Complete redesign of internal structure. Now, there exist a cetral view
class which manages the current implemented views table and card...
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 @@
+#ifndef _ABVIEW_H_
+#define _ABVIEW_H_
+
+#include <qwidget.h>
+#include <qwidgetstack.h>
+
+#include <qpe/categories.h>
+#include <opie/ocontact.h>
+#include <opie/ocontactaccess.h>
+
+#include "contacteditor.h"
+#include "abtable.h"
+#include "ablabel.h"
+
+class AbView: public QWidget
+{
+ Q_OBJECT
+
+public:
+ enum Views{ TableView=0, CardView, PhoneBook, CompanyBook, EmailBook };
+
+ AbView( QWidget* parent, const QValueList<int>& ordered, const QStringList& slOrderedFields );
+
+ bool save();
+ void load();
+ void reload();
+ void clear();
+
+ void setView( Views view );
+ void showContact( const OContact& cnt );
+ void setShowByCategory( Views view, const QString& cat );
+ void setShowByLetter( char c );
+ // Add Entry and put to current
+ void addEntry( const OContact &newContact );
+ void removeEntry( const int UID );
+ void replaceEntry( const OContact &contact );
+ OContact currentEntry();
+
+ void inSearch() { m_inSearch = true; }
+ void offSearch();
+
+ QString showCategory() const;
+ QStringList categories();
+
+signals:
+ void signalNotFound();
+ void signalClearLetterPicker();
+ void signalViewSwitched ( int );
+
+public slots:
+ void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp,
+ bool backwards, QString category = QString::null );
+ void slotSwitch();
+
+private:
+ void updateView();
+ void clearForCategory();
+ bool contactCompare( const OContact &cnt, int category );
+ void parseName( const QString& name, QString *first, QString *middle,
+ QString * last );
+
+ Categories mCat;
+ bool m_inSearch;
+ int m_curr_category;
+ Views m_curr_View;
+ Views m_prev_View;
+ int m_curr_Contact;
+
+ OContactAccess m_contactdb;
+ OContactAccess::List m_list;
+
+ QWidgetStack* m_viewStack;
+ AbTable* m_abTable;
+ AbLabel* m_ablabel;
+
+ QValueList<int> m_orderedFields;
+ QStringList m_slOrderedFields;
+};
+
+
+#endif