Qt 4.8
qwindowsvistastyle_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QWINDOWSVISTASTYLE_P_H
43 #define QWINDOWSVISTASTYLE_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists for the convenience
50 // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
51 // file may change from version to version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "qwindowsvistastyle.h"
57 
58 #if !defined(QT_NO_STYLE_WINDOWSVISTA)
59 #include <private/qwindowsxpstyle_p.h>
60 #include <private/qpaintengine_raster_p.h>
61 #include <qlibrary.h>
62 #include <qpaintengine.h>
63 #include <qwidget.h>
64 #include <qapplication.h>
65 #include <qpixmapcache.h>
66 #include <qstyleoption.h>
67 #include <qpushbutton.h>
68 #include <qradiobutton.h>
69 #include <qcheckbox.h>
70 #include <qlineedit.h>
71 #include <qgroupbox.h>
72 #include <qtoolbutton.h>
73 #include <qspinbox.h>
74 #include <qtoolbar.h>
75 #include <qcombobox.h>
76 #include <qscrollbar.h>
77 #include <qprogressbar.h>
78 #include <qdockwidget.h>
79 #include <qlistview.h>
80 #include <qtreeview.h>
81 #include <qtextedit.h>
82 #include <qmessagebox.h>
83 #include <qdialogbuttonbox.h>
84 #include <qinputdialog.h>
85 #include <qtreeview.h>
86 #include <qlistview.h>
87 #include <qtableview.h>
88 #include <qbasictimer.h>
89 #include <qdatetime.h>
90 #include <qcommandlinkbutton.h>
91 
93 
94 #if !defined(SCHEMA_VERIFY_VSSYM32)
95 #define TMT_ANIMATIONDURATION 5006
96 #define TMT_TRANSITIONDURATIONS 6000
97 #define EP_EDITBORDER_NOSCROLL 6
98 #define EP_EDITBORDER_HVSCROLL 9
99 #define EP_BACKGROUND 3
100 #define EBS_NORMAL 1
101 #define EBS_HOT 2
102 #define EBS_DISABLED 3
103 #define EBS_READONLY 5
104 #define PBS_DEFAULTED_ANIMATING 6
105 #define MBI_NORMAL 1
106 #define MBI_HOT 2
107 #define MBI_PUSHED 3
108 #define MBI_DISABLED 4
109 #define MB_ACTIVE 1
110 #define MB_INACTIVE 2
111 #define PP_FILL 5
112 #define PP_FILLVERT 6
113 #define PP_MOVEOVERLAY 8
114 #define PP_MOVEOVERLAYVERT 10
115 #define MENU_BARBACKGROUND 7
116 #define MENU_BARITEM 8
117 #define MENU_POPUPCHECK 11
118 #define MENU_POPUPCHECKBACKGROUND 12
119 #define MENU_POPUPGUTTER 13
120 #define MENU_POPUPITEM 14
121 #define MENU_POPUPBORDERS 10
122 #define MENU_POPUPSEPARATOR 15
123 #define MC_CHECKMARKNORMAL 1
124 #define MC_CHECKMARKDISABLED 2
125 #define MC_BULLETNORMAL 3
126 #define MC_BULLETDISABLED 4
127 #define ABS_UPHOVER 17
128 #define ABS_DOWNHOVER 18
129 #define ABS_LEFTHOVER 19
130 #define ABS_RIGHTHOVER 20
131 #define CP_DROPDOWNBUTTONRIGHT 6
132 #define CP_DROPDOWNBUTTONLEFT 7
133 #define SCRBS_HOVER 5
134 #define TVP_HOTGLYPH 4
135 #define SPI_GETCLIENTAREAANIMATION 0x1042
136 #define TDLG_PRIMARYPANEL 1
137 #define TDLG_SECONDARYPANEL 8
138 #endif
139 
141 {
142 public :
145  QWidget * widget() const { return _widget; }
146  bool running() const { return _running; }
147  const QTime &startTime() const { return _startTime; }
148  void setRunning(bool val) { _running = val; }
151  virtual void paint(QPainter *painter, const QStyleOption *option);
152 
153 protected:
154  void drawBlendedImage(QPainter *painter, QRect rect, float value);
160  bool _running;
161 };
162 
163 
164 // Handles state transition animations
166 {
167 public :
170  void setDuration(int duration) { _duration = duration; }
171  void setStartImage(const QImage &image) { _primaryImage = image; }
172  void setEndImage(const QImage &image) { _secondaryImage = image; }
173  virtual void paint(QPainter *painter, const QStyleOption *option);
174  int duration() const { return _duration; }
175  int _duration; //set time in ms to complete a state transition
176 };
177 
178 
179 // Handles pulse animations (default buttons)
181 {
182 public :
184  virtual ~QWindowsVistaPulse() { }
185  void setDuration(int duration) { _duration = duration; }
186  void setPrimaryImage(const QImage &image) { _primaryImage = image; }
187  void setAlternateImage(const QImage &image) { _secondaryImage = image; }
188  virtual void paint(QPainter *painter, const QStyleOption *option);
189  int duration() const { return _duration; }
190  int _duration; //time in ms to complete a pulse cycle
191 };
192 
193 
195 {
197 
198 public:
201  static bool resolveSymbols();
202  static inline bool useVista();
203  void startAnimation(QWindowsVistaAnimation *);
204  void stopAnimation(const QWidget *);
205  QWindowsVistaAnimation* widgetAnimation(const QWidget *) const;
206  void timerEvent();
207  bool transitionsEnabled() const;
208  QWidget *treeViewHelper();
209 
210 private:
214 };
215 
217 
218 #endif // QT_NO_STYLE_WINDOWSVISTA
219 
220 #endif // QWINDOWSVISTASTYLE_P_H
void setDuration(int duration)
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
The QWindowsVistaStyle class provides a look and feel suitable for applications on Microsoft Windows ...
virtual void paint(QPainter *painter, const QStyleOption *option)
void setWidget(QWidget *widget)
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
const QTime & startTime() const
void drawBlendedImage(QPainter *painter, QRect rect, float value)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QPointer< QWidget > _widget
The QTime class provides clock time functions.
Definition: qdatetime.h:148
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
void setEndImage(const QImage &image)
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
void setPrimaryImage(const QImage &image)
void setAlternateImage(const QImage &image)
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
The QBasicTimer class provides timer events for objects.
Definition: qbasictimer.h:55
QList< QWindowsVistaAnimation * > animations
void setStartImage(const QImage &image)
void setDuration(int duration)
void setStartTime(const QTime &startTime)
The QList class is a template class that provides lists.
Definition: qdatastream.h:62