summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/kaddressbooktableview.h
Unidiff
Diffstat (limited to 'kaddressbook/views/kaddressbooktableview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbooktableview.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/kaddressbook/views/kaddressbooktableview.h b/kaddressbook/views/kaddressbooktableview.h
new file mode 100644
index 0000000..bb991bc
--- a/dev/null
+++ b/kaddressbook/views/kaddressbooktableview.h
@@ -0,0 +1,114 @@
1#ifndef KADDRESSBOOKTABLEVIEW_H
2#define KADDRESSBOOKTABLEVIEW_H
3
4
5#ifndef KAB_EMBEDDED
6
7
8#ifdef HAVE_CONFIG_H
9#include <config.h>
10#endif
11
12#include <qwidget.h>
13#include <qlistview.h>
14#include <qstring.h>
15#include <qdialog.h>
16#include <qtabdialog.h>
17#include <qstringlist.h>
18#include <qvaluelist.h>
19
20#include "undo.h"
21
22#else //KAB_EMBEDDED
23#include "views/configuretableviewdialog.h"
24#endif //KAB_EMBEDDED
25
26#include "klocale.h"
27#include "kaddressbookview.h"
28
29class QListViewItem;
30class QListBox;
31class QVBoxLayout;
32class KConfig;
33
34class ContactListViewItem;
35class ContactListView;
36
37
38namespace KABC { class AddressBook; }
39
40/**
41 * This class is the table view for kaddressbook. This view is a KListView
42 * with multiple columns for the selected fields.
43 *
44 * @short Table View
45 * @author Don Sanders <dsanders@kde.org>
46 * @version 0.1
47 */
48class KAddressBookTableView : public KAddressBookView
49{
50friend class ContactListView;
51
52 Q_OBJECT
53
54 public:
55 KAddressBookTableView( KABC::AddressBook *ab, QWidget *parent,
56 const char *name = 0 );
57 virtual ~KAddressBookTableView();
58
59 virtual void refresh(QString uid = QString::null);
60 virtual QStringList selectedUids();
61 virtual void setSelected(QString uid = QString::null, bool selected = false);
62 virtual void readConfig(KConfig *config);
63 virtual void writeConfig(KConfig *config);
64 virtual QString type() const { return "Table"; }
65
66 public slots:
67 virtual void reconstructListView();
68
69 protected slots:
70 /** Called whenever the user selects an addressee in the list view.
71 */
72 void addresseeSelected();
73 void addresseeDeleted();
74
75 /** Called whenever the user executes an addressee. In terms of the
76 * list view, this is probably a double click
77 */
78 void addresseeExecuted(QListViewItem*);
79
80 private:
81 QVBoxLayout *mainLayout;
82 ContactListView *mListView;
83};
84
85
86class TableViewFactory : public ViewFactory
87{
88 public:
89 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name )
90 {
91 return new KAddressBookTableView( ab, parent, name );
92 }
93
94 QString type() const { return "Table"; }
95
96 QString description() const { return i18n( "A listing of contacts in a table. Each cell of "
97 "the table holds a field of the contact." ); }
98
99 ViewConfigureWidget *configureWidget( KABC::AddressBook *ab, QWidget *parent,
100 const char *name = 0 )
101 {
102 return new ConfigureTableViewWidget( ab, parent, name );
103 }
104};
105/*US
106extern "C" {
107 void *init_libkaddrbk_tableview()
108 {
109 return ( new TableViewFactory );
110 }
111}
112*/
113
114#endif