Diffstat (limited to 'core/pim/addressbook/abtable.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.h | 87 |
1 files changed, 31 insertions, 56 deletions
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index 35a1e9e..83bd5a7 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h @@ -1,10 +1,11 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) ** ** This file is part of Qt Palmtop Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** @@ -18,24 +19,23 @@ ** **********************************************************************/ #ifndef ABTABLE_H #define ABTABLE_H #include <qpe/categories.h> #include <opie/ocontact.h> +#include <opie/ocontactaccess.h> #include <qmap.h> #include <qtable.h> #include <qstringlist.h> #include <qcombobox.h> -#include <opie/ocontactaccess.h> - class AbTableItem : public QTableItem { public: AbTableItem( QTable *t, EditType et, const QString &s, const QString &secondSortKey); QString entryKey() const; void setEntryKey( const QString & k ); virtual int alignment() const; @@ -58,104 +58,79 @@ private: QGuardedPtr<QComboBox> cb; }; class AbTable : public QTable { Q_OBJECT public: - AbTable( const QValueList<int> *ordered, QWidget *parent, const char *name=0 ); + AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); ~AbTable(); - // NEW - void addEntry( const OContact &newContact ); + + // Set the contacts shown in the table + void setContacts( const OContactAccess::List& viewList ); + // Selects a contact of a specific UID + bool selectContact( int UID ); + + // Get the current selected entry OContact currentEntry(); - void replaceCurrentEntry( const OContact &newContact ); - void init(); + // Get the UID of the current selected Entry + int currentEntry_UID(); + + QString findContactName( const OContact &entry ); - void deleteCurrentEntry(); + void init(); void clear(); - void clearFindRow() { currFindRow = -1; } - void loadFields(); void refresh(); - bool save(); - void load(); - void reload(); - - // addresspicker mode - void setChoiceNames( const QStringList& list); - QStringList choiceNames() const; - void setChoiceSelection(int index, const QStringList& list); - QStringList choiceSelection(int index) const; - void setShowCategory( const QString &b, const QString &c ); - void setShowByLetter( char c ); - QString showCategory() const; - QStringList categories(); - - void resizeRows(); void show(); void setPaintingEnabled( bool e ); - QString showBook() const; - - void inSearch() { m_inSearch = true; } - void offSearch() { m_inSearch = false; } + // addresspicker mode (What's that ? se) + void setChoiceNames( const QStringList& list); + QStringList choiceNames() const; + void setChoiceSelection( const QValueList<int>& list ); + QStringList choiceSelection(int index) const; -public slots: - void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, bool backwards, - QString category = QString::null ); signals: - void empty( bool ); - void details(); - void signalNotFound(); - void signalWrapAround(); - void signalSearchBackward(); // Signalled if backward search is requested - void signalSearchNext(); // Singalled if forward search is requested + void signalSwitch(); + void signalEditor(); + void signalKeyDown(); + void signalKeyUp(); protected: virtual void keyPressEvent( QKeyEvent *e ); // int rowHeight( int ) const; // int rowPos( int row ) const; // virtual int rowAt( int pos ) const; protected slots: void moveTo( char ); virtual void columnClicked( int col ); void itemClicked(int,int col); void rowHeightChanged( int row ); private: - void loadFile( const QString &strFile, bool journalFile ); + void insertIntoTable( const OContact &cnt, int row ); + QString findContactContact( const OContact &entry, int row ); void fitColumns(); + void resizeRows(); + void realignTable(); void resort(); - void updateJournal( const OContact &contact, OContact::journal_action action, - int row = -1 ); - void insertIntoTable( const OContact &contact, int row ); - QString findContactName( const OContact &entry ); - QString findContactContact( const OContact &entry, int row ); - void journalFreeReplace( const OContact &cnt, int row ); - void journalFreeRemove( int row ); - void realignTable( int ); void updateVisible(); + int lastSortCol; bool asc; - char showChar; QMap<AbTableItem*, OContact> contactList; - const QValueList<int> *intFields; - int currFindRow; - QString showCat; + QValueList<int> intFields; QStringList choicenames; bool enablePainting; - Categories mCat; - QString showBk; bool columnVisible; - bool m_inSearch; - - OContactAccess m_contactdb; + OContactAccess::List m_viewList; }; #endif // ABTABLE_H |