added all files
[ffqwlibrary] / libffqw-n810-1.0 / sources / ffabstractwidget.h
1 /*
2           GNU GENERAL PUBLIC LICENSE
3                        Version 3, 29 June 2007
4
5  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
6  Everyone is permitted to copy and distribute verbatim copies
7  of this license document, but changing it is not allowed.
8
9                             Preamble
10
11   The GNU General Public License is a free, copyleft license for
12 software and other kinds of works.
13
14   The licenses for most software and other practical works are designed
15 to take away your freedom to share and change the works.  By contrast,
16 the GNU General Public License is intended to guarantee your freedom to
17 share and change all versions of a program--to make sure it remains free
18 software for all its users.  We, the Free Software Foundation, use the
19 GNU General Public License for most of our software; it applies also to
20 any other work released this way by its authors.  You can apply it to
21 your programs, too.
22
23   When we speak of free software, we are referring to freedom, not
24 price.  Our General Public Licenses are designed to make sure that you
25 have the freedom to distribute copies of free software (and charge for
26 them if you wish), that you receive source code or can get it if you
27 want it, that you can change the software or use pieces of it in new
28 free programs, and that you know you can do these things.
29
30   To protect your rights, we need to prevent others from denying you
31 these rights or asking you to surrender the rights.  Therefore, you have
32 certain responsibilities if you distribute copies of the software, or if
33 you modify it: responsibilities to respect the freedom of others.
34
35   For example, if you distribute copies of such a program, whether
36 gratis or for a fee, you must pass on to the recipients the same
37 freedoms that you received.  You must make sure that they, too, receive
38 or can get the source code.  And you must show them these terms so they
39 know their rights.
40
41   Developers that use the GNU GPL protect your rights with two steps:
42 (1) assert copyright on the software, and (2) offer you this License
43 giving you legal permission to copy, distribute and/or modify it.
44
45   For the developers' and authors' protection, the GPL clearly explains
46 that there is no warranty for this free software.  For both users' and
47 authors' sake, the GPL requires that modified versions be marked as
48 changed, so that their problems will not be attributed erroneously to
49 authors of previous versions.
50
51   Some devices are designed to deny users access to install or run
52 modified versions of the software inside them, although the manufacturer
53 can do so.  This is fundamentally incompatible with the aim of
54 protecting users' freedom to change the software.  The systematic
55 pattern of such abuse occurs in the area of products for individuals to
56 use, which is precisely where it is most unacceptable.  Therefore, we
57 have designed this version of the GPL to prohibit the practice for those
58 products.  If such problems arise substantially in other domains, we
59 stand ready to extend this provision to those domains in future versions
60 of the GPL, as needed to protect the freedom of users.
61
62   Finally, every program is threatened constantly by software patents.
63 States should not allow patents to restrict development and use of
64 software on general-purpose computers, but in those that do, we wish to
65 avoid the special danger that patents applied to a free program could
66 make it effectively proprietary.  To prevent this, the GPL assures that
67 patents cannot be used to render the program non-free.
68
69   The precise terms and conditions for copying, distribution and
70 modification follow.
71
72 http://www.gnu.org/licenses/gpl-3.0.txt
73 */
74 /**
75  * @file ffabstractwidget.h
76  * @brief contains all required declarations and basic utilities functions
77  *
78  * @author ComArch S.A.
79  * @date 2009.07.31
80  * @version 1.0
81  */
82 #ifndef FFABSTRACTWIDGET_H_
83 #define FFABSTRACTWIDGET_H_
84
85 #include <QWidget>
86
87 class FFAbstractWidget;
88 typedef FFAbstractWidget FF;
89
90 /**
91  * Defines default title text color for button
92  */
93 const QColor FF_TITLE_COLOR = QColor(14,221,26);
94 /**
95  * Defines default description text color for button
96  */
97 const QColor FF_DESCRIPTION_COLOR = QColor(100,100,100);
98 /**
99  * Defines default button height
100  */
101 const int DEFAULT_BUTTON_HEIGHT = 65;
102 /**
103  * Defines default combo button height
104  */
105 const int DEFAULT_COMBO_HEIGHT = 65;
106 /**
107  * Defines color for legend widget used on FFChart
108  */
109 const QColor DEFAULT_LEGEND_BACKGROUND_COLOR = QColor(26,26,26);
110 /**
111  * Defines opacity for legend widget used on FFChart
112  */
113 const qreal DEFAULT_LEGEND_BACKGROUND_OPACITY = 0.8;
114
115 /**
116  * Defines default font name for widget title
117  */
118 const QString FONT_TITLE_DEF = "Arial";
119 /**
120  * Defines default font name for widget description
121  */
122 const QString FONT_TEXT_DEF = "Arial";
123
124 /**
125  * Defines title text color for scrolling label
126  */
127 const QColor COLOR_TITLE_DEF = QColor(50, 255, 50);
128 /**
129  * Defines description text color for scrolling label
130  */
131 const QColor COLOR_TEXT_DEF = QColor(50, 50, 255);
132 /**
133  * Defines bright background color
134  */
135 const QColor COLOR_BRIGHT_BACKGROUND_DEF = QColor(250, 255, 250);
136 /**
137  * Defines dark background color
138  */
139 const QColor COLOR_DARK_BACKGROUND_DEF = QColor(250, 255, 250);
140 /**
141  * Defines bright foreground color
142  */
143 const QColor COLOR_BRIGHT_FOREGROUND_DEF = QColor(250, 255, 250);
144 /**
145  * Defines dark foreground color
146  */
147 const QColor COLOR_DARK_FOREGROUND_DEF = QColor(250, 255, 250);
148
149 /**
150  * @author ComArch S.A.
151  * @date 2009.07.30
152  * @version 1.0
153  *
154  * @brief A parent-class for all widgets included in FFQW Library
155  */
156
157 class FFAbstractWidget : public QWidget
158 {
159         Q_OBJECT
160
161 public:
162         FFAbstractWidget(QWidget* parent = 0);
163         virtual ~FFAbstractWidget();
164
165 /**
166  * describes standard FF widgets' sizes
167  */
168 enum Size
169 {
170         SIZE_TINY = 0x0001,
171         SIZE_SMALL = 0x0002,
172         SIZE_NORMAL = 0x0004,
173         SIZE_LARGE = 0x0008,
174         SIZE_HUGE = 0x0010
175 };
176
177 /**
178  * describes standard FF widgets' fonts
179  */
180 enum Font
181 {
182         FONT_TITLE = 0x0020, FONT_TEXT = 0x0040
183 };
184
185 /**
186  * describes standard FF widgets' colors
187  */
188 enum Color
189 {
190         COLOR_TITLE = 0x0080,
191         COLOR_TEXT = 0x0100,
192         COLOR_BRIGHT_BACKGROUND = 0x0200,
193         COLOR_DARK_BACKGROUND = 0x0400,
194         COLOR_BRIGHT_FOREGROUND = 0x0800,
195         COLOR_DARK_FOREGROUND = 0x1000
196 };
197
198 /**
199  * defines standard FF widgets' alignment
200  */
201 enum Alignment
202 {
203         ALIGNMENT_LEFT = 0x2000,
204         ALIGNMENT_RIGHT = 0x4000,
205         ALIGNMENT_CENTER = 0x8000
206 };
207
208 /**
209  * defines standard FF widgets' scrolling type
210  */
211 enum Scroll
212 {
213         SCROLL_SIDE_TO_SIDE = 0x0001
214 };
215
216 };
217 /**
218  * Mask for checking size
219  */
220 const int SIZE_MASK = FF::SIZE_TINY |
221                 FF::SIZE_SMALL |
222                 FF::SIZE_NORMAL |
223                 FF::SIZE_LARGE |
224                 FF::SIZE_HUGE;
225 /**
226  * Mask for checking font type
227  */
228 const int FONT_MASK = FF::FONT_TITLE | FF::FONT_TEXT;
229
230 /**
231  * Mask for checking color
232  */
233 const int COLOR_MASK = FF::COLOR_TITLE |
234                 FF::COLOR_BRIGHT_BACKGROUND |
235                 FF::COLOR_DARK_BACKGROUND |
236                 FF::COLOR_BRIGHT_FOREGROUND |
237                 FF::COLOR_DARK_FOREGROUND;
238 /**
239  * Mask for checking alignment
240  */
241 const int ALIGNMENT_MASK = FF::ALIGNMENT_LEFT | FF::ALIGNMENT_RIGHT | FF::ALIGNMENT_CENTER;
242
243 #endif // FFABSTRACTWIDGET_H