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
41class TQListViewItem;
42class TQListBox;
43class TQVBoxLayout;
44class TDEConfig;
45class KIMProxy;
46
47class ContactListViewItem;
48class ContactListView;
49
50namespace TDEABC { class AddressBook; }
51
61{
62friend class ContactListView;
63
64 TQ_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
This class is the table view for kaddressbook.
virtual void readConfig(TDEConfig *config)
Called whenever this view should read the config.
virtual void refresh(const TQString &uid=TQString())
Must be overloaded in subclasses to refresh the view.
virtual void setSelected(const TQString &uid=TQString(), bool selected=false)
This method must be overloaded in subclasses.
void rmbClicked(TDEListView *, TQListViewItem *, const TQPoint &)
RBM menu called.
virtual TQString type() const
Return the type of the view: Icon, Table, etc.
void addresseeSelected()
Called whenever the user selects an addressee in the list view.
void addresseeExecuted(TQListViewItem *)
Called whenever the user executes an addressee.
virtual void setFirstSelected(bool selected=true)
Selects the first contact in the view.
virtual void writeConfig(TDEConfig *config)
Called whenever this view should write the config.
virtual TDEABC::Field * sortField() const
virtual TQStringList selectedUids()
Must be overloaded in subclasses.
void updatePresence(const TQString &uid)
Called to update the presence of a single item.
Base class for all views in kaddressbook.
KAB::Core * core() const
void selected(const TQString &uid)
This signal should be emitted by a subclass whenever an addressee is selected.