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