kaddressbook

kaddressbooktableview.h

00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
00022 */
00023 
00024 #ifndef KADDRESSBOOKTABLEVIEW_H
00025 #define KADDRESSBOOKTABLEVIEW_H
00026 
00027 #ifdef HAVE_CONFIG_H
00028 #include <config.h>
00029 #endif
00030 
00031 #include <qwidget.h>
00032 #include <qlistview.h>
00033 #include <qstring.h>
00034 #include <qdialog.h>
00035 #include <qtabdialog.h>
00036 #include <qstringlist.h>
00037 #include <qvaluelist.h>
00038 
00039 #include "kaddressbookview.h"
00040 
00041 class QListViewItem;
00042 class QListBox;
00043 class QVBoxLayout;
00044 class KConfig;
00045 class KIMProxy;
00046 
00047 class ContactListViewItem;
00048 class ContactListView;
00049 
00050 namespace KABC { class AddressBook; }
00051 
00060 class KAddressBookTableView : public KAddressBookView
00061 {
00062 friend class ContactListView;
00063 
00064   Q_OBJECT
00065 
00066   public:
00067     KAddressBookTableView( KAB::Core *core, QWidget *parent,
00068                            const char *name = 0 );
00069     virtual ~KAddressBookTableView();
00070 
00071     virtual void refresh( const QString &uid = QString() );
00072     virtual QStringList selectedUids();
00073     virtual void setSelected( const QString &uid = QString(), bool selected = false );
00074     virtual void setFirstSelected( bool selected = true );
00075     virtual KABC::Field *sortField() const;
00076 
00077     virtual void readConfig( KConfig *config );
00078     virtual void writeConfig( KConfig *config );
00079     virtual QString type() const { return "Table"; }
00080 
00081     void scrollUp();
00082     void scrollDown();
00083 
00084   public slots:
00085     virtual void reconstructListView();
00086 
00087   protected slots:
00091     void addresseeSelected();
00092 
00097     void addresseeExecuted( QListViewItem* );
00098 
00102     void rmbClicked( KListView*, QListViewItem*, const QPoint& );
00103 
00107     void updatePresence( const QString &uid );
00108 
00109   private:
00110     QVBoxLayout *mMainLayout;
00111     ContactListView *mListView;
00112     KIMProxy *mIMProxy;
00113 };
00114 
00115 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys