From 8401def65aa4f19d91873bc57a3dcf25c358c490 Mon Sep 17 00:00:00 2001 From: eilers Date: Mon, 18 Nov 2002 09:38:28 +0000 Subject: Back to main tree. Back to main tree. Back to main tree. Waiting for moving to feature freeze .. --- (limited to 'core/pim/addressbook/abtable.h') 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,5 +1,6 @@ /********************************************************************** ** 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. ** @@ -23,14 +24,13 @@ #include #include +#include #include #include #include #include -#include - class AbTableItem : public QTableItem { public: @@ -63,54 +63,40 @@ class AbTable : public QTable Q_OBJECT public: - AbTable( const QValueList *ordered, QWidget *parent, const char *name=0 ); + AbTable( const QValueList 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& 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 ); @@ -127,35 +113,24 @@ protected slots: 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 contactList; - const QValueList *intFields; - int currFindRow; - QString showCat; + QValueList intFields; QStringList choicenames; bool enablePainting; - Categories mCat; - QString showBk; bool columnVisible; - bool m_inSearch; - - OContactAccess m_contactdb; + OContactAccess::List m_viewList; }; #endif // ABTABLE_H -- cgit v0.9.0.2