From 3fbba334274ca53bd26cd79ccd4662e529c61f40 Mon Sep 17 00:00:00 2001 From: eilers Date: Fri, 01 Nov 2002 14:50:14 +0000 Subject: Complete redesign of internal structure. Now, there exist a cetral view class which manages the current implemented views table and card... --- (limited to 'core/pim/addressbook/abview.h') 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 +#include + +#include +#include +#include + +#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& 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 m_orderedFields; + QStringList m_slOrderedFields; +}; + + +#endif -- cgit v0.9.0.2