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 TQt, and distribute the resulting executable,
00021     without including the source code for TQt 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 <tqwidget.h>
00032 #include <tqlistview.h>
00033 #include <tqstring.h>
00034 #include <tqdialog.h>
00035 #include <tqtabdialog.h>
00036 #include <tqstringlist.h>
00037 #include <tqvaluelist.h>
00038 
00039 #include "kaddressbookview.h"
00040 
00041 class TQListViewItem;
00042 class TQListBox;
00043 class TQVBoxLayout;
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   TQ_OBJECT
00066 
00067   public:
00068     KAddressBookTableView( KAB::Core *core, TQWidget *parent,
00069                            const char *name = 0 );
00070     virtual ~KAddressBookTableView();
00071 
00072     virtual void refresh( const TQString &uid = TQString() );
00073     virtual TQStringList selectedUids();
00074     virtual void setSelected( const TQString &uid = TQString(), bool selected = false );
00075     virtual void setFirstSelected( bool selected = true );
00076     virtual KABC::Field *sortField() const;
00077 
00078     virtual void readConfig( KConfig *config );
00079     virtual void writeConfig( KConfig *config );
00080     virtual TQString type() const { return "Table"; }
00081 
00082     void scrollUp();
00083     void scrollDown();
00084 
00085   public slots:
00086     virtual void reconstructListView();
00087 
00088   protected slots:
00092     void addresseeSelected();
00093 
00098     void addresseeExecuted( TQListViewItem* );
00099 
00103     void rmbClicked( KListView*, TQListViewItem*, const TQPoint& );
00104 
00108     void updatePresence( const TQString &uid );
00109 
00110   private:
00111     TQVBoxLayout *mMainLayout;
00112     ContactListView *mListView;
00113     KIMProxy *mIMProxy;
00114 };
00115 
00116 #endif