summaryrefslogtreecommitdiff
path: root/libopie2/opieui/olistview.h
Side-by-side diff
Diffstat (limited to 'libopie2/opieui/olistview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/olistview.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h
index 59b0973..8195a62 100644
--- a/libopie2/opieui/olistview.h
+++ b/libopie2/opieui/olistview.h
@@ -15,66 +15,70 @@
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OLISTVIEW_H
#define OLISTVIEW_H
#include <qcolor.h>
#include <qlistview.h>
#include <qpen.h>
#include <qdatastream.h>
#include <qstringlist.h>
+
+namespace Opie {
+namespace Ui {
class OListViewItem;
/*======================================================================================
* OListView
*======================================================================================*/
/**
* @brief A list/tree widget.
*
* A @ref QListView variant featuring visual and functional enhancements
* like an alternate background for odd rows, an autostretch mode
* for the width of the widget ( >= Qt 3 only ) and persistence capabilities.
*
* @author Michael 'Mickey' Lauer <mickey@vanille.de>
*/
class OListView: public QListView
{
+ Q_OBJECT
public:
/**
* Constructor.
*
* The parameters @a parent and @a name are handled by
* @ref QListView, as usual.
*/
OListView( QWidget* parent = 0, const char* name = 0 );
/**
* Destructor.
*/
virtual ~OListView();
/**
* Let the last column fit exactly all the available width.
*/
void setFullWidth( bool fullWidth );
/**
* Returns whether the last column is set to fit the available width.
*/
bool fullWidth() const;
/**
* Reimplemented for full width support
*/
virtual int addColumn( const QString& label, int width = -1 );
@@ -118,50 +122,52 @@ class OListView: public QListView
/**
* Serialize this object from a @ref QDataStream @a stream
*/
virtual void serializeFrom( QDataStream& s );
#endif
public slots:
/**
* Expand all items
*/
void expand();
/**
* Collapse all items
*/
void collapse();
protected slots:
/**
* expand the current OListViewItem
*/
void expand(QListViewItem*);
private:
QColor m_alternateBackground;
- bool m_fullWidth;
+ bool m_fullWidth : 1;
QPen m_columnSeparator;
+ class Private;
+ Private *d;
};
#ifndef QT_NO_DATASTREAM
/**
* @relates OListView
* Writes @a listview to the @a stream and returns a reference to the stream.
*/
QDataStream& operator<<( QDataStream& stream, const OListView& listview );
/**
* @relates OListView
* Reads @a listview from the @a stream and returns a reference to the stream.
*/
QDataStream& operator>>( QDataStream& stream, OListView& listview );
#endif // QT_NO_DATASTREAM
/*======================================================================================
* OListViewItem
*======================================================================================*/
class OListViewItem: public QListViewItem
{
friend class OCheckListItem;
public:
/**
@@ -221,50 +227,52 @@ class OListViewItem: public QListViewItem
* create a list view item as child of this object
* @returns the new object
*/
virtual OListViewItem* childFactory();
#ifndef QT_NO_DATASTREAM
/**
* serialize this object to or from a @ref QDataStream
* @param s the stream used to serialize this object.
*/
virtual void serializeTo( QDataStream& s ) const;
/**
* serialize this object to or from a @ref QDataStream
* @param s the stream used to serialize this object.
*/
virtual void serializeFrom( QDataStream& s );
#endif
/**
* expand the the item
*/
virtual void expand(){};
private:
- bool m_known;
- bool m_odd;
+ bool m_known : 1;
+ bool m_odd : 1;
+ class Private;
+ Private *d;
};
#ifndef QT_NO_DATASTREAM
/**
* @relates QListViewItem
* Writes listview @a item and all subitems recursively to @a stream
* and returns a reference to the stream.
*/
QDataStream& operator<<( QDataStream& stream, const OListViewItem& item );
/**
* @relates QListViewItem
* Reads listview @a item from @a stream and returns a reference to the stream.
*/
QDataStream& operator>>( QDataStream& stream, OListViewItem& item );
#endif // QT_NO_DATASTREAM
/*======================================================================================
* OCheckListItem
*======================================================================================*/
class OCheckListItem : public QCheckListItem
{
public:
@@ -333,48 +341,51 @@ 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;
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
* ONamedListViewItem
*======================================================================================*/
/**
* @brief An OListView variant with named columns.
*
* This class provides a higher-level interface to an OListViewItem.
*
* @author Michael 'Mickey' Lauer <mickey@vanille.de>
*/
class ONamedListViewItem: public OListViewItem
{
public:
/**
* Constructor. Accepts the same parameters as a @ref OListViewItem,
* plus a @ref QStringList which holds an arbitrary number of @a texts.
*/
ONamedListViewItem( QListView* parent, const QStringList& texts );
ONamedListViewItem( QListViewItem* parent, const QStringList& texts );
ONamedListViewItem( QListView* parent, QListViewItem* after, const QStringList& texts );
ONamedListViewItem( QListViewItem* parent, QListViewItem* after, const QStringList& texts );
@@ -382,28 +393,34 @@ class ONamedListViewItem: public OListViewItem
* Destructor.
*/
virtual ~ONamedListViewItem();
/**
* Sets the text in column @a column to @a text.
* This method differs from @ref QListViewItem::setText() in that it
* accepts a string as column indicator instead of an int.
*/
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;
-};
+ private:
+ class Private;
+ Private *d;
+
+};
+}
+}
#endif // OLISTVIEW_H