-rw-r--r-- | libopie/otabinfo.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/libopie/otabinfo.h b/libopie/otabinfo.h new file mode 100644 index 0000000..afdd225 --- a/dev/null +++ b/libopie/otabinfo.h | |||
@@ -0,0 +1,116 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | |||
30 | */ | ||
31 | |||
32 | #ifndef OTABINFO_H | ||
33 | #define OTABINFO_H | ||
34 | |||
35 | #include <qlist.h> | ||
36 | #include <qstring.h> | ||
37 | |||
38 | class QWidget; | ||
39 | |||
40 | /** | ||
41 | * @class OTabInfo | ||
42 | * @brief The OTabInfo class is used internally by OTabWidget to keep track | ||
43 | * of widgets added to the control. | ||
44 | * | ||
45 | * OTabInfo provides the following information about a widget added to an | ||
46 | * OTabWidget control: | ||
47 | * | ||
48 | * ID - integer tab bar ID | ||
49 | * Control - QWidget pointer to child widget | ||
50 | * Label - QString text label for OTabWidget selection control | ||
51 | * Icon - QString name of icon file | ||
52 | */ | ||
53 | class OTabInfo | ||
54 | { | ||
55 | public: | ||
56 | /** | ||
57 | * @fn OTabInfo() | ||
58 | * @brief Object constructor. | ||
59 | * | ||
60 | * @param parent Pointer to parent of this control. | ||
61 | * @param name Name of control. | ||
62 | * @param s Style of widget selection control. | ||
63 | * @param p Position of the widget selection control. | ||
64 | */ | ||
65 | OTabInfo() : i( -1 ), c( 0 ), p( 0 ), l( QString::null ) {} | ||
66 | |||
67 | /** | ||
68 | * @fn OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) | ||
69 | * @brief Object constructor. | ||
70 | * | ||
71 | * @param id TabBar identifier for widget. | ||
72 | * @param control QWidget pointer to widget. | ||
73 | * @param icon QString name of icon file. | ||
74 | * @param label QString text label for OTabWidget selection control. | ||
75 | */ | ||
76 | OTabInfo( int id, QWidget *control, const QString &icon, const QString &label ) | ||
77 | : i( id ), c( control ), p( icon ), l( label ) {} | ||
78 | |||
79 | /** | ||
80 | * @fn id() | ||
81 | * @brief Returns TabBar ID. | ||
82 | */ | ||
83 | int id() const { return i; } | ||
84 | |||
85 | /** | ||
86 | * @fn label() | ||
87 | * @brief Returns text label for widget. | ||
88 | */ | ||
89 | const QString &label() const { return l; } | ||
90 | |||
91 | /** | ||
92 | * @fn control() | ||
93 | * @brief Returns pointer to widget. | ||
94 | */ | ||
95 | QWidget *control() const { return c; } | ||
96 | |||
97 | /** | ||
98 | * @fn icon() | ||
99 | * @brief Returns name of icon file. | ||
100 | */ | ||
101 | const QString &icon() const { return p; } | ||
102 | |||
103 | private: | ||
104 | int i; | ||
105 | QWidget *c; | ||
106 | QString p; | ||
107 | QString l; | ||
108 | }; | ||
109 | |||
110 | /** | ||
111 | * @class OTabInfoList | ||
112 | * @brief A list of OTabInfo objects used by OTabWidget. | ||
113 | */ | ||
114 | typedef QList<OTabInfo> OTabInfoList; | ||
115 | |||
116 | #endif | ||