#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