kaddressbook

kaddressbooktableview.h
1 /*
2  This file is part of KAddressBook.
3  Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 
19  As a special exception, permission is given to link this program
20  with any edition of TQt, and distribute the resulting executable,
21  without including the source code for TQt in the source distribution.
22 */
23 
24 #ifndef KADDRESSBOOKTABLEVIEW_H
25 #define KADDRESSBOOKTABLEVIEW_H
26 
27 #ifdef HAVE_CONFIG_H
28 #include <config.h>
29 #endif
30 
31 #include <tqwidget.h>
32 #include <tqlistview.h>
33 #include <tqstring.h>
34 #include <tqdialog.h>
35 #include <tqtabdialog.h>
36 #include <tqstringlist.h>
37 #include <tqvaluelist.h>
38 
39 #include "kaddressbookview.h"
40 
41 class TQListViewItem;
42 class TQListBox;
43 class TQVBoxLayout;
44 class TDEConfig;
45 class KIMProxy;
46 
47 class ContactListViewItem;
48 class ContactListView;
49 
50 namespace TDEABC { class AddressBook; }
51 
61 {
62 friend class ContactListView;
63 
64  Q_OBJECT
65 
66 
67  public:
68  KAddressBookTableView( KAB::Core *core, TQWidget *parent,
69  const char *name = 0 );
70  virtual ~KAddressBookTableView();
71 
72  virtual void refresh( const TQString &uid = TQString() );
73  virtual TQStringList selectedUids();
74  virtual void setSelected( const TQString &uid = TQString(), bool selected = false );
75  virtual void setFirstSelected( bool selected = true );
76  virtual TDEABC::Field *sortField() const;
77 
78  virtual void readConfig( TDEConfig *config );
79  virtual void writeConfig( TDEConfig *config );
80  virtual TQString type() const { return "Table"; }
81 
82  void scrollUp();
83  void scrollDown();
84 
85  public slots:
86  virtual void reconstructListView();
87 
88  protected slots:
92  void addresseeSelected();
93 
98  void addresseeExecuted( TQListViewItem* );
99 
103  void rmbClicked( TDEListView*, TQListViewItem*, const TQPoint& );
104 
108  void updatePresence( const TQString &uid );
109 
110  private:
111  TQVBoxLayout *mMainLayout;
112  ContactListView *mListView;
113  KIMProxy *mIMProxy;
114 };
115 
116 #endif