|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the QtGui module of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #ifndef QFRAME_H |
|
43 #define QFRAME_H |
|
44 |
|
45 #include <QtGui/qwidget.h> |
|
46 |
|
47 QT_BEGIN_HEADER |
|
48 |
|
49 QT_BEGIN_NAMESPACE |
|
50 |
|
51 QT_MODULE(Gui) |
|
52 |
|
53 class QFramePrivate; |
|
54 |
|
55 class Q_GUI_EXPORT QFrame : public QWidget |
|
56 { |
|
57 Q_OBJECT |
|
58 |
|
59 Q_ENUMS(Shape Shadow) |
|
60 Q_PROPERTY(Shape frameShape READ frameShape WRITE setFrameShape) |
|
61 Q_PROPERTY(Shadow frameShadow READ frameShadow WRITE setFrameShadow) |
|
62 Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth) |
|
63 Q_PROPERTY(int midLineWidth READ midLineWidth WRITE setMidLineWidth) |
|
64 Q_PROPERTY(int frameWidth READ frameWidth) |
|
65 Q_PROPERTY(QRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false) |
|
66 |
|
67 public: |
|
68 explicit QFrame(QWidget* parent = 0, Qt::WindowFlags f = 0); |
|
69 ~QFrame(); |
|
70 |
|
71 int frameStyle() const; |
|
72 void setFrameStyle(int); |
|
73 |
|
74 int frameWidth() const; |
|
75 |
|
76 QSize sizeHint() const; |
|
77 |
|
78 enum Shape { |
|
79 NoFrame = 0, // no frame |
|
80 Box = 0x0001, // rectangular box |
|
81 Panel = 0x0002, // rectangular panel |
|
82 WinPanel = 0x0003, // rectangular panel (Windows) |
|
83 HLine = 0x0004, // horizontal line |
|
84 VLine = 0x0005, // vertical line |
|
85 StyledPanel = 0x0006 // rectangular panel depending on the GUI style |
|
86 |
|
87 #if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) |
|
88 ,PopupPanel = StyledPanel, // rectangular panel depending on the GUI style |
|
89 MenuBarPanel = StyledPanel, |
|
90 ToolBarPanel = StyledPanel, |
|
91 LineEditPanel = StyledPanel, |
|
92 TabWidgetPanel = StyledPanel, |
|
93 GroupBoxPanel = StyledPanel |
|
94 #endif |
|
95 }; |
|
96 enum Shadow { |
|
97 Plain = 0x0010, // plain line |
|
98 Raised = 0x0020, // raised shadow effect |
|
99 Sunken = 0x0030 // sunken shadow effect |
|
100 }; |
|
101 |
|
102 enum StyleMask { |
|
103 Shadow_Mask = 0x00f0, // mask for the shadow |
|
104 Shape_Mask = 0x000f // mask for the shape |
|
105 #if defined(QT3_SUPPORT) |
|
106 ,MShadow = Shadow_Mask, |
|
107 MShape = Shape_Mask |
|
108 #endif |
|
109 }; |
|
110 |
|
111 Shape frameShape() const; |
|
112 void setFrameShape(Shape); |
|
113 Shadow frameShadow() const; |
|
114 void setFrameShadow(Shadow); |
|
115 |
|
116 int lineWidth() const; |
|
117 void setLineWidth(int); |
|
118 |
|
119 int midLineWidth() const; |
|
120 void setMidLineWidth(int); |
|
121 |
|
122 QRect frameRect() const; |
|
123 void setFrameRect(const QRect &); |
|
124 |
|
125 protected: |
|
126 bool event(QEvent *e); |
|
127 void paintEvent(QPaintEvent *); |
|
128 void changeEvent(QEvent *); |
|
129 void drawFrame(QPainter *); |
|
130 |
|
131 #ifdef QT3_SUPPORT |
|
132 public: |
|
133 QT3_SUPPORT_CONSTRUCTOR QFrame(QWidget* parent, const char* name, Qt::WindowFlags f = 0); |
|
134 #endif |
|
135 |
|
136 protected: |
|
137 QFrame(QFramePrivate &dd, QWidget* parent = 0, Qt::WindowFlags f = 0); |
|
138 |
|
139 private: |
|
140 Q_DISABLE_COPY(QFrame) |
|
141 Q_DECLARE_PRIVATE(QFrame) |
|
142 }; |
|
143 |
|
144 QT_END_NAMESPACE |
|
145 |
|
146 QT_END_HEADER |
|
147 |
|
148 #endif // QFRAME_H |