-rw-r--r-- | libopie2/opieui/olistview.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h index 1bbdd5b..109e309 100644 --- a/libopie2/opieui/olistview.h +++ b/libopie2/opieui/olistview.h | |||
@@ -1,168 +1,170 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 4 | =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef OLISTVIEW_H | 31 | #ifndef OLISTVIEW_H |
32 | #define OLISTVIEW_H | 32 | #define OLISTVIEW_H |
33 | 33 | ||
34 | #include <qcolor.h> | 34 | #include <qcolor.h> |
35 | #include <qlistview.h> | 35 | #include <qlistview.h> |
36 | #include <qpen.h> | 36 | #include <qpen.h> |
37 | #include <qdatastream.h> | 37 | #include <qdatastream.h> |
38 | #include <qstringlist.h> | ||
38 | 39 | ||
39 | class OListViewItem; | 40 | class OListViewItem; |
40 | 41 | ||
42 | |||
41 | /*====================================================================================== | 43 | /*====================================================================================== |
42 | * OListView | 44 | * OListView |
43 | *======================================================================================*/ | 45 | *======================================================================================*/ |
44 | 46 | ||
45 | /** | 47 | /** |
46 | * @brief A list/tree widget. | 48 | * @brief A list/tree widget. |
47 | * | 49 | * |
48 | * A @ref QListView variant featuring visual and functional enhancements | 50 | * A @ref QListView variant featuring visual and functional enhancements |
49 | * like an alternate background for odd rows, an autostretch mode | 51 | * like an alternate background for odd rows, an autostretch mode |
50 | * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. | 52 | * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. |
51 | * | 53 | * |
52 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 54 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
53 | */ | 55 | */ |
54 | class OListView: public QListView | 56 | class OListView: public QListView |
55 | { | 57 | { |
56 | public: | 58 | public: |
57 | /** | 59 | /** |
58 | * Constructor. | 60 | * Constructor. |
59 | * | 61 | * |
60 | * The parameters @a parent and @a name are handled by | 62 | * The parameters @a parent and @a name are handled by |
61 | * @ref QListView, as usual. | 63 | * @ref QListView, as usual. |
62 | */ | 64 | */ |
63 | OListView( QWidget* parent = 0, const char* name = 0 ); | 65 | OListView( QWidget* parent = 0, const char* name = 0 ); |
64 | /** | 66 | /** |
65 | * Destructor. | 67 | * Destructor. |
66 | */ | 68 | */ |
67 | virtual ~OListView(); | 69 | virtual ~OListView(); |
68 | /** | 70 | /** |
69 | * Let the last column fit exactly all the available width. | 71 | * Let the last column fit exactly all the available width. |
70 | */ | 72 | */ |
71 | void setFullWidth( bool fullWidth ); | 73 | void setFullWidth( bool fullWidth ); |
72 | /** | 74 | /** |
73 | * Returns whether the last column is set to fit the available width. | 75 | * Returns whether the last column is set to fit the available width. |
74 | */ | 76 | */ |
75 | bool fullWidth() const; | 77 | bool fullWidth() const; |
76 | /** | 78 | /** |
77 | * Reimplemented for full width support | 79 | * Reimplemented for full width support |
78 | */ | 80 | */ |
79 | virtual int addColumn( const QString& label, int width = -1 ); | 81 | virtual int addColumn( const QString& label, int width = -1 ); |
80 | /** | 82 | /** |
81 | * Reimplemented for full width support | 83 | * Reimplemented for full width support |
82 | */ | 84 | */ |
83 | virtual int addColumn( const QIconSet& iconset, const QString& label, int width = -1 ); | 85 | virtual int addColumn( const QIconSet& iconset, const QString& label, int width = -1 ); |
84 | /** | 86 | /** |
85 | * Reimplemented for full width support | 87 | * Reimplemented for full width support |
86 | */ | 88 | */ |
87 | virtual void removeColumn(int index); | 89 | virtual void removeColumn(int index); |
88 | /** | 90 | /** |
89 | * Set the alternate background background @a color. | 91 | * Set the alternate background background @a color. |
90 | * Set to an invalid color to disable alternate colors. | 92 | * Set to an invalid color to disable alternate colors. |
91 | * This only has an effect if the items are OListViewItems | 93 | * This only has an effect if the items are OListViewItems |
92 | */ | 94 | */ |
93 | void setAlternateBackground( const QColor& color ); | 95 | void setAlternateBackground( const QColor& color ); |
94 | /** | 96 | /** |
95 | * Sets the column separator @a pen. | 97 | * Sets the column separator @a pen. |
96 | */ | 98 | */ |
97 | void setColumnSeparator( const QPen& pen ); | 99 | void setColumnSeparator( const QPen& pen ); |
98 | 100 | ||
99 | /** | 101 | /** |
100 | * @returns the alternate background color | 102 | * @returns the alternate background color |
101 | */ | 103 | */ |
102 | const QColor& alternateBackground() const; | 104 | const QColor& alternateBackground() const; |
103 | /** | 105 | /** |
104 | * @return the column separator pen | 106 | * @return the column separator pen |
105 | */ | 107 | */ |
106 | const QPen& columnSeparator() const; | 108 | const QPen& columnSeparator() const; |
107 | /** | 109 | /** |
108 | * Create a list view item as child of this object | 110 | * Create a list view item as child of this object |
109 | * @returns the new object | 111 | * @returns the new object |
110 | */ | 112 | */ |
111 | virtual OListViewItem* childFactory(); | 113 | virtual OListViewItem* childFactory(); |
112 | #ifndef QT_NO_DATASTREAM | 114 | #ifndef QT_NO_DATASTREAM |
113 | /** | 115 | /** |
114 | * Serialize this object to @ref QDataStream @a stream | 116 | * Serialize this object to @ref QDataStream @a stream |
115 | */ | 117 | */ |
116 | virtual void serializeTo( QDataStream& stream ) const; | 118 | virtual void serializeTo( QDataStream& stream ) const; |
117 | /** | 119 | /** |
118 | * Serialize this object from a @ref QDataStream @a stream | 120 | * Serialize this object from a @ref QDataStream @a stream |
119 | */ | 121 | */ |
120 | virtual void serializeFrom( QDataStream& s ); | 122 | virtual void serializeFrom( QDataStream& s ); |
121 | #endif | 123 | #endif |
122 | 124 | ||
123 | private: | 125 | private: |
124 | QColor m_alternateBackground; | 126 | QColor m_alternateBackground; |
125 | bool m_fullWidth; | 127 | bool m_fullWidth; |
126 | QPen m_columnSeparator; | 128 | QPen m_columnSeparator; |
127 | }; | 129 | }; |
128 | 130 | ||
129 | #ifndef QT_NO_DATASTREAM | 131 | #ifndef QT_NO_DATASTREAM |
130 | /** | 132 | /** |
131 | * @relates OListView | 133 | * @relates OListView |
132 | * Writes @a listview to the @a stream and returns a reference to the stream. | 134 | * Writes @a listview to the @a stream and returns a reference to the stream. |
133 | */ | 135 | */ |
134 | QDataStream& operator<<( QDataStream& stream, const OListView& listview ); | 136 | QDataStream& operator<<( QDataStream& stream, const OListView& listview ); |
135 | /** | 137 | /** |
136 | * @relates OListView | 138 | * @relates OListView |
137 | * Reads @a listview from the @a stream and returns a reference to the stream. | 139 | * Reads @a listview from the @a stream and returns a reference to the stream. |
138 | */ | 140 | */ |
139 | QDataStream& operator>>( QDataStream& stream, OListView& listview ); | 141 | QDataStream& operator>>( QDataStream& stream, OListView& listview ); |
140 | #endif // QT_NO_DATASTREAM | 142 | #endif // QT_NO_DATASTREAM |
141 | 143 | ||
142 | /*====================================================================================== | 144 | /*====================================================================================== |
143 | * OListViewItem | 145 | * OListViewItem |
144 | *======================================================================================*/ | 146 | *======================================================================================*/ |
145 | 147 | ||
146 | class OListViewItem: public QListViewItem | 148 | class OListViewItem: public QListViewItem |
147 | { | 149 | { |
148 | public: | 150 | public: |
149 | /** | 151 | /** |
150 | * Constructors. | 152 | * Constructors. |
151 | */ | 153 | */ |
152 | OListViewItem( QListView * parent ); | 154 | OListViewItem( QListView * parent ); |
153 | OListViewItem( QListViewItem * parent ); | 155 | OListViewItem( QListViewItem * parent ); |
154 | OListViewItem( QListView * parent, QListViewItem * after ); | 156 | OListViewItem( QListView * parent, QListViewItem * after ); |
155 | OListViewItem( QListViewItem * parent, QListViewItem * after ); | 157 | OListViewItem( QListViewItem * parent, QListViewItem * after ); |
156 | 158 | ||
157 | OListViewItem( QListView * parent, | 159 | OListViewItem( QListView * parent, |
158 | QString, QString = QString::null, | 160 | QString, QString = QString::null, |
159 | QString = QString::null, QString = QString::null, | 161 | QString = QString::null, QString = QString::null, |
160 | QString = QString::null, QString = QString::null, | 162 | QString = QString::null, QString = QString::null, |
161 | QString = QString::null, QString = QString::null ); | 163 | QString = QString::null, QString = QString::null ); |
162 | 164 | ||
163 | OListViewItem( QListViewItem * parent, | 165 | OListViewItem( QListViewItem * parent, |
164 | QString, QString = QString::null, | 166 | QString, QString = QString::null, |
165 | QString = QString::null, QString = QString::null, | 167 | QString = QString::null, QString = QString::null, |
166 | QString = QString::null, QString = QString::null, | 168 | QString = QString::null, QString = QString::null, |
167 | QString = QString::null, QString = QString::null ); | 169 | QString = QString::null, QString = QString::null ); |
168 | 170 | ||