-rw-r--r-- | libopie2/opieui/olistview.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h index 99770bf..1bbdd5b 100644 --- a/libopie2/opieui/olistview.h +++ b/libopie2/opieui/olistview.h | |||
@@ -238,16 +238,18 @@ QDataStream& operator>>( QDataStream& stream, OListViewItem& item ); | |||
238 | #endif // QT_NO_DATASTREAM | 238 | #endif // QT_NO_DATASTREAM |
239 | 239 | ||
240 | /*====================================================================================== | 240 | /*====================================================================================== |
241 | * ONamedListView | 241 | * ONamedListView |
242 | *======================================================================================*/ | 242 | *======================================================================================*/ |
243 | 243 | ||
244 | class ONamedListViewItem; | ||
245 | |||
244 | /** | 246 | /** |
245 | * @brief An OListView variant with named columns. | 247 | * @brief An OListView variant with named columns. |
246 | * | 248 | * |
247 | * This class provides a higher-level interface to the columns in an OListView. | 249 | * This class provides a higher-level interface to an OListView. |
248 | * | 250 | * |
249 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 251 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
250 | */ | 252 | */ |
251 | class ONamedListView: public OListView | 253 | class ONamedListView: public OListView |
252 | { | 254 | { |
253 | public: | 255 | public: |
@@ -263,22 +265,40 @@ class ONamedListView: public OListView | |||
263 | */ | 265 | */ |
264 | virtual ~ONamedListView(); | 266 | virtual ~ONamedListView(); |
265 | /** | 267 | /** |
266 | * Add a number of @a columns to the listview. | 268 | * Add a number of @a columns to the listview. |
267 | */ | 269 | */ |
268 | virtual void addColumns( const QStringList& columns ); | 270 | virtual void addColumns( const QStringList& columns ); |
271 | /** | ||
272 | * @returns the column index matching to @a text or -1 if not found. | ||
273 | */ | ||
274 | virtual int findColumn( const QString& text ) const; | ||
275 | /** | ||
276 | * @returns the first item which has a @a text in column @a column. | ||
277 | * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> | ||
278 | * <li>set it to 0 to search only among direct childs, | ||
279 | * <li>set it to 1 to search direct childs and all 1st order subchilds | ||
280 | * <li>set it to -1 for maximum recursion. | ||
281 | * </ul> | ||
282 | * @sa ONamedListViewItem::find() | ||
283 | */ | ||
284 | virtual ONamedListViewItem* find( ONamedListViewItem* start, int column, const QString& text, int recurse = -1 ) const; | ||
285 | virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; | ||
286 | |||
287 | virtual ONamedListViewItem* find( ONamedListViewItem* start, const QString& column, const QString& text, int recurse = -1 ) const; | ||
288 | virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; | ||
269 | }; | 289 | }; |
270 | 290 | ||
271 | /*====================================================================================== | 291 | /*====================================================================================== |
272 | * ONamedListViewItem | 292 | * ONamedListViewItem |
273 | *======================================================================================*/ | 293 | *======================================================================================*/ |
274 | 294 | ||
275 | /** | 295 | /** |
276 | * @brief An OListView variant with named columns. | 296 | * @brief An OListView variant with named columns. |
277 | * | 297 | * |
278 | * This class provides a higher-level interface to the columns in an OListViewItem. | 298 | * This class provides a higher-level interface to an OListViewItem. |
279 | * | 299 | * |
280 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 300 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
281 | */ | 301 | */ |
282 | class ONamedListViewItem: public OListViewItem | 302 | class ONamedListViewItem: public OListViewItem |
283 | { | 303 | { |
284 | public: | 304 | public: |
@@ -301,10 +321,21 @@ class ONamedListViewItem: public OListViewItem | |||
301 | */ | 321 | */ |
302 | virtual void setText( const QString& column, const QString& text ); | 322 | virtual void setText( const QString& column, const QString& text ); |
303 | /** | 323 | /** |
304 | * Sets a number of @a texts for this item. | 324 | * Sets a number of @a texts for this item. |
305 | */ | 325 | */ |
306 | virtual void setText( const QStringList& texts ); | 326 | virtual void setText( const QStringList& texts ); |
327 | /** | ||
328 | * @returns the first child which has a @a text in column @a column. | ||
329 | * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> | ||
330 | * <li>set it to 0 to search only among direct childs, | ||
331 | * <li>set it to 1 to search direct childs and all 1st order subchilds | ||
332 | * <li>set it to -1 for maximum recursion. | ||
333 | * </ul> | ||
334 | * @sa ONamedListView::find() | ||
335 | */ | ||
336 | virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; | ||
337 | virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; | ||
307 | }; | 338 | }; |
308 | 339 | ||
309 | 340 | ||
310 | #endif // OLISTVIEW_H | 341 | #endif // OLISTVIEW_H |