-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 ); #endif // QT_NO_DATASTREAM /*====================================================================================== * ONamedListView *======================================================================================*/ +class ONamedListViewItem; + /** * @brief An OListView variant with named columns. * - * This class provides a higher-level interface to the columns in an OListView. + * This class provides a higher-level interface to an OListView. * * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> */ class ONamedListView: public OListView { public: @@ -263,22 +265,40 @@ class ONamedListView: public OListView */ virtual ~ONamedListView(); /** * Add a number of @a columns to the listview. */ virtual void addColumns( const QStringList& columns ); + /** + * @returns the column index matching to @a text or -1 if not found. + */ + virtual int findColumn( const QString& text ) const; + /** + * @returns the first item which has a @a text in column @a column. + * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> + * <li>set it to 0 to search only among direct childs, + * <li>set it to 1 to search direct childs and all 1st order subchilds + * <li>set it to -1 for maximum recursion. + * </ul> + * @sa ONamedListViewItem::find() + */ + virtual ONamedListViewItem* find( ONamedListViewItem* start, int column, const QString& text, int recurse = -1 ) const; + virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; + + virtual ONamedListViewItem* find( ONamedListViewItem* start, const QString& column, const QString& text, int recurse = -1 ) const; + virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; }; /*====================================================================================== * ONamedListViewItem *======================================================================================*/ /** * @brief An OListView variant with named columns. * - * This class provides a higher-level interface to the columns in an OListViewItem. + * This class provides a higher-level interface to an OListViewItem. * * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> */ class ONamedListViewItem: public OListViewItem { public: @@ -301,10 +321,21 @@ class ONamedListViewItem: public OListViewItem */ virtual void setText( const QString& column, const QString& text ); /** * Sets a number of @a texts for this item. */ virtual void setText( const QStringList& texts ); + /** + * @returns the first child which has a @a text in column @a column. + * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> + * <li>set it to 0 to search only among direct childs, + * <li>set it to 1 to search direct childs and all 1st order subchilds + * <li>set it to -1 for maximum recursion. + * </ul> + * @sa ONamedListView::find() + */ + virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; + virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; }; #endif // OLISTVIEW_H |