summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/cornucopia/olistview.h
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/cornucopia/olistview.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/cornucopia/olistview.h81
1 files changed, 75 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.h b/noncore/net/wellenreiter/cornucopia/olistview.h
index 4b9e4b0..9df5500 100644
--- a/noncore/net/wellenreiter/cornucopia/olistview.h
+++ b/noncore/net/wellenreiter/cornucopia/olistview.h
@@ -34,12 +34,15 @@
#define OLISTVIEW_H
-#include <qlistview.h>
#include <qcolor.h>
+#include <qlistview.h>
#include <qpen.h>
+#include <qdatastream.h>
+
+class OListViewFactory;
/**
- * A @ref QListView variant featuring visual enhancements
- * like an alternate background for odd rows and an autostretch
- * mode for the width of the 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@tm.informatik.uni-frankfurt.de>
@@ -113,11 +116,49 @@
const QPen& columnSeparator() const;
+ #ifndef QT_NO_DATASTREAM
+ /**
+ * serialize this object to a @ref QDataStream
+ * @param s the stream used to serialize this object.
+ */
+ virtual void serializeTo( QDataStream& s ) const;
+
+ /**
+ * serialize this object from a @ref QDataStream
+ * @param s the stream used to serialize this object.
+ */
+ virtual void serializeFrom( QDataStream& s );
+ #endif
+
+ /**
+ * returns a factory for OListView classes
+ * creates one on the fly if it doesn't exist
+ * @return the XML Factory
+ */
+ #ifndef QT_NO_XML
+ //OListViewFactory* Factory();
+ #endif
+
private:
QColor m_alternateBackground;
bool m_fullWidth;
QPen m_columnSeparator;
-
+ #ifndef QT_NO_XML
+ //OListViewFactory* m_Factory;
+ #endif
};
+#ifndef QT_NO_DATASTREAM
+/**
+ * \relates QListView
+ * Writes a listview to the stream and returns a reference to the stream.
+ */
+QDataStream& operator<<( QDataStream& s, const OListView& lv );
+/**
+ * \relates QListView
+ * Reads a listview from the stream and returns a reference to the stream.
+ */
+QDataStream& operator>>( QDataStream& s, OListView& lv );
+#endif // QT_NO_DATASTREAM
+
//****************************** OListViewItem ******************************************************************
@@ -161,4 +202,18 @@ class OListViewItem: public QListViewItem
void init();
+ #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
+
private:
bool m_known;
@@ -166,3 +221,17 @@ class OListViewItem: public QListViewItem
};
-#endif
+#ifndef QT_NO_DATASTREAM
+/**
+ * \relates QListViewItem
+ * Writes a listview item and all subitems recursively to the stream
+ * and returns a reference to the stream.
+ */
+QDataStream& operator<<( QDataStream &s, const OListViewItem& lvi );
+/**
+ * \relates QListViewItem
+ * Reads a listview item from the stream and returns a reference to the stream.
+ */
+QDataStream& operator>>( QDataStream &s, OListViewItem& lvi );
+#endif // QT_NO_DATASTREAM
+
+#endif // OLISTVIEW_H