Diffstat (limited to 'kaddressbook/kaddressbookview.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kaddressbookview.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h index 8646136..8f31910 100644 --- a/kaddressbook/kaddressbookview.h +++ b/kaddressbook/kaddressbookview.h | |||
@@ -25,32 +25,38 @@ | |||
25 | #define KADDRESSBOOKVIEW_H | 25 | #define KADDRESSBOOKVIEW_H |
26 | 26 | ||
27 | #ifndef KAB_EMBEDDED | 27 | #ifndef KAB_EMBEDDED |
28 | #include <klibloader.h> | 28 | #include <klibloader.h> |
29 | #endif //KAB_EMBEDDED | 29 | #endif //KAB_EMBEDDED |
30 | 30 | ||
31 | class KConfig; | 31 | class KConfig; |
32 | class QDropEvent; | 32 | class QDropEvent; |
33 | 33 | ||
34 | #include <qstringlist.h> | 34 | #include <qstringlist.h> |
35 | #include <kabc/field.h> | 35 | #include <kabc/field.h> |
36 | #include <qwidget.h> | 36 | #include <qwidget.h> |
37 | 37 | ||
38 | #include "viewconfigurewidget.h" | 38 | #include "viewconfigurewidget.h" |
39 | #include "filter.h" | 39 | #include "filter.h" |
40 | 40 | ||
41 | #ifdef DESKTOP_VERSION | ||
42 | #include <qpaintdevicemetrics.h> | ||
43 | #include <qprinter.h> | ||
44 | #include <qpainter.h> | ||
45 | #endif | ||
46 | |||
41 | namespace KABC { class AddressBook; } | 47 | namespace KABC { class AddressBook; } |
42 | 48 | ||
43 | /** | 49 | /** |
44 | Base class for all views in kaddressbook. This class implements | 50 | Base class for all views in kaddressbook. This class implements |
45 | all the common methods needed to provide a view to the user. | 51 | all the common methods needed to provide a view to the user. |
46 | 52 | ||
47 | To implement a specific view (table, card, etc), just inherit from | 53 | To implement a specific view (table, card, etc), just inherit from |
48 | this class and implement all the pure virtuals. | 54 | this class and implement all the pure virtuals. |
49 | 55 | ||
50 | @author Mike Pilone <mpilone@slac.com> | 56 | @author Mike Pilone <mpilone@slac.com> |
51 | */ | 57 | */ |
52 | class KAddressBookView : public QWidget | 58 | class KAddressBookView : public QWidget |
53 | { | 59 | { |
54 | Q_OBJECT | 60 | Q_OBJECT |
55 | 61 | ||
56 | public: | 62 | public: |
@@ -137,58 +143,61 @@ class KAddressBookView : public QWidget | |||
137 | @return The default filter type selection. If the selection | 143 | @return The default filter type selection. If the selection |
138 | is SpecificFilter, the name of the filter can be retrieved with | 144 | is SpecificFilter, the name of the filter can be retrieved with |
139 | defaultFilterName() | 145 | defaultFilterName() |
140 | */ | 146 | */ |
141 | DefaultFilterType defaultFilterType() const; | 147 | DefaultFilterType defaultFilterType() const; |
142 | 148 | ||
143 | /** | 149 | /** |
144 | @return The name of the default filter. This string is | 150 | @return The name of the default filter. This string is |
145 | only valid if defaultFilterType() is returning SpecificFilter. | 151 | only valid if defaultFilterType() is returning SpecificFilter. |
146 | */ | 152 | */ |
147 | const QString &defaultFilterName() const; | 153 | const QString &defaultFilterName() const; |
148 | 154 | ||
149 | /** | 155 | /** |
150 | @return The address book. | 156 | @return The address book. |
151 | */ | 157 | */ |
152 | KABC::AddressBook *addressBook() const; | 158 | KABC::AddressBook *addressBook() const; |
159 | void printMyView() { emit printView() ;} | ||
153 | 160 | ||
154 | public slots: | 161 | public slots: |
155 | /** | 162 | /** |
156 | Must be overloaded in subclasses to refresh the view. | 163 | Must be overloaded in subclasses to refresh the view. |
157 | Refreshing includes updating the view to ensure that only items | 164 | Refreshing includes updating the view to ensure that only items |
158 | in the document are visible. If <i>uid</i> is valid, only the | 165 | in the document are visible. If <i>uid</i> is valid, only the |
159 | addressee with uid needs to be refreshed. This is an optimization | 166 | addressee with uid needs to be refreshed. This is an optimization |
160 | only. | 167 | only. |
161 | */ | 168 | */ |
162 | virtual void refresh( QString uid = QString::null ) = 0; | 169 | virtual void refresh( QString uid = QString::null ) = 0; |
163 | 170 | ||
164 | /** | 171 | /** |
165 | This method must be overloaded in subclasses. Select (highlight) | 172 | This method must be overloaded in subclasses. Select (highlight) |
166 | the addressee matching <i>uid</i>. If uid | 173 | the addressee matching <i>uid</i>. If uid |
167 | is equal to QString::null, then all addressees should be selected. | 174 | is equal to QString::null, then all addressees should be selected. |
168 | */ | 175 | */ |
169 | #ifndef KAB_EMBEDDED | 176 | #ifndef KAB_EMBEDDED |
170 | //MOC_SKIP_BEGIN | 177 | //MOC_SKIP_BEGIN |
171 | virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0; | 178 | virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0; |
172 | //MOC_SKIP_END | 179 | //MOC_SKIP_END |
173 | #else //KAB_EMBEDDED | 180 | #else //KAB_EMBEDDED |
174 | //US my moc can not handle the default parameters. Is this a problem ??? | 181 | //US my moc can not handle the default parameters. Is this a problem ??? |
175 | virtual void setSelected( QString uid, bool selected) = 0; | 182 | virtual void setSelected( QString uid, bool selected) = 0; |
176 | #endif //KAB_EMBEDDED | 183 | #endif //KAB_EMBEDDED |
177 | 184 | ||
178 | signals: | 185 | signals: |
186 | |||
187 | void printView(); | ||
179 | /** | 188 | /** |
180 | This signal should be emitted by a subclass whenever an addressee | 189 | This signal should be emitted by a subclass whenever an addressee |
181 | is modified. | 190 | is modified. |
182 | */ | 191 | */ |
183 | void modified(); | 192 | void modified(); |
184 | 193 | ||
185 | /** | 194 | /** |
186 | This signal should be emitted by a subclass whenever an addressee | 195 | This signal should be emitted by a subclass whenever an addressee |
187 | is selected. Selected means that the addressee was given the focus. | 196 | is selected. Selected means that the addressee was given the focus. |
188 | Some widgets may call this 'highlighted'. The view is responsible for | 197 | Some widgets may call this 'highlighted'. The view is responsible for |
189 | emitting this signal multiple times if multiple items are selected, | 198 | emitting this signal multiple times if multiple items are selected, |
190 | with the last item selected being the last emit. | 199 | with the last item selected being the last emit. |
191 | 200 | ||
192 | @param uid The uid of the selected addressee. | 201 | @param uid The uid of the selected addressee. |
193 | 202 | ||
194 | @see KListView | 203 | @see KListView |