1 /**************************************************************************** 2 ** 3 ** Copyright (C) 2016 The Qt Company Ltd. 4 ** Contact: https://www.qt.io/licensing/ 5 ** 6 ** This file is part of the QtWidgets 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 The Qt Company. For licensing terms 14 ** and conditions see https://www.qt.io/terms-conditions. For further 15 ** information use the contact form at https://www.qt.io/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 3 as published by the Free Software 20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 21 ** packaging of this file. Please review the following information to 22 ** ensure the GNU Lesser General Public License version 3 requirements 23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 24 ** 25 ** GNU General Public License Usage 26 ** Alternatively, this file may be used under the terms of the GNU 27 ** General Public License version 2.0 or (at your option) the GNU General 28 ** Public license version 3 or any later version approved by the KDE Free 29 ** Qt Foundation. The licenses are as published by the Free Software 30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 31 ** included in the packaging of this file. Please review the following 32 ** information to ensure the GNU General Public License requirements will 33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and 34 ** https://www.gnu.org/licenses/gpl-3.0.html. 35 ** 36 ** $QT_END_LICENSE$ 37 ** 38 ****************************************************************************/ 39 40 #ifndef QWINDOWSVISTASTYLE_P_P_H 41 #define QWINDOWSVISTASTYLE_P_P_H 42 43 // 44 // W A R N I N G 45 // ------------- 46 // 47 // This file is not part of the Qt API. It exists for the convenience 48 // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header 49 // file may change from version to version without notice, or even be removed. 50 // 51 // We mean it. 52 // 53 54 #include <QtWidgets/private/qtwidgetsglobal_p.h> 55 #include "qwindowsvistastyle_p.h" 56 #include "qwindowsxpstyle_p_p.h" 57 #include <private/qstyleanimation_p.h> 58 #include <private/qpaintengine_raster_p.h> 59 #include <qpaintengine.h> 60 #include <qwidget.h> 61 #include <qapplication.h> 62 #include <qpixmapcache.h> 63 #include <qstyleoption.h> 64 #if QT_CONFIG(pushbutton) 65 #include <qpushbutton.h> 66 #endif 67 #include <qradiobutton.h> 68 #if QT_CONFIG(lineedit) 69 #include <qlineedit.h> 70 #endif 71 #include <qgroupbox.h> 72 #if QT_CONFIG(toolbutton) 73 #include <qtoolbutton.h> 74 #endif 75 #if QT_CONFIG(spinbox) 76 #include <qspinbox.h> 77 #endif 78 #if QT_CONFIG(toolbar) 79 #include <qtoolbar.h> 80 #endif 81 #if QT_CONFIG(combobox) 82 #include <qcombobox.h> 83 #endif 84 #if QT_CONFIG(scrollbar) 85 #include <qscrollbar.h> 86 #endif 87 #if QT_CONFIG(progressbar) 88 #include <qprogressbar.h> 89 #endif 90 #if QT_CONFIG(dockwidget) 91 #include <qdockwidget.h> 92 #endif 93 #if QT_CONFIG(listview) 94 #include <qlistview.h> 95 #endif 96 #if QT_CONFIG(treeview) 97 #include <qtreeview.h> 98 #endif 99 #include <qtextedit.h> 100 #include <qmessagebox.h> 101 #if QT_CONFIG(dialogbuttonbox) 102 #include <qdialogbuttonbox.h> 103 #endif 104 #include <qinputdialog.h> 105 #if QT_CONFIG(tableview) 106 #include <qtableview.h> 107 #endif 108 #include <qdatetime.h> 109 #if QT_CONFIG(commandlinkbutton) 110 #include <qcommandlinkbutton.h> 111 #endif 112 113 QT_BEGIN_NAMESPACE 114 115 #if !defined(SCHEMA_VERIFY_VSSYM32) 116 #define TMT_ANIMATIONDURATION 5006 117 #define TMT_TRANSITIONDURATIONS 6000 118 #define EP_EDITBORDER_NOSCROLL 6 119 #define EP_EDITBORDER_HVSCROLL 9 120 #define EP_BACKGROUND 3 121 #define EBS_NORMAL 1 122 #define EBS_HOT 2 123 #define EBS_DISABLED 3 124 #define EBS_READONLY 5 125 #define PBS_DEFAULTED_ANIMATING 6 126 #define MBI_NORMAL 1 127 #define MBI_HOT 2 128 #define MBI_PUSHED 3 129 #define MBI_DISABLED 4 130 #define MB_ACTIVE 1 131 #define MB_INACTIVE 2 132 #define PP_FILL 5 133 #define PP_FILLVERT 6 134 #define PP_MOVEOVERLAY 8 135 #define PP_MOVEOVERLAYVERT 10 136 #define MENU_BARBACKGROUND 7 137 #define MENU_BARITEM 8 138 #define MENU_POPUPCHECK 11 139 #define MENU_POPUPCHECKBACKGROUND 12 140 #define MENU_POPUPGUTTER 13 141 #define MENU_POPUPITEM 14 142 #define MENU_POPUPBORDERS 10 143 #define MENU_POPUPSEPARATOR 15 144 #define MC_CHECKMARKNORMAL 1 145 #define MC_CHECKMARKDISABLED 2 146 #define MC_BULLETNORMAL 3 147 #define MC_BULLETDISABLED 4 148 #define ABS_UPHOVER 17 149 #define ABS_DOWNHOVER 18 150 #define ABS_LEFTHOVER 19 151 #define ABS_RIGHTHOVER 20 152 #define CP_DROPDOWNBUTTONRIGHT 6 153 #define CP_DROPDOWNBUTTONLEFT 7 154 #define SCRBS_HOVER 5 155 #define TVP_HOTGLYPH 4 156 #define SPI_GETCLIENTAREAANIMATION 0x1042 157 #define TDLG_PRIMARYPANEL 1 158 #define TDLG_SECONDARYPANEL 8 159 #endif 160 161 class QWindowsVistaAnimation : public QBlendStyleAnimation 162 { 163 Q_OBJECT 164 public: QWindowsVistaAnimation(Type type,QObject * target)165 QWindowsVistaAnimation(Type type, QObject *target) : QBlendStyleAnimation(type, target) { } 166 167 bool isUpdateNeeded() const override; 168 void paint(QPainter *painter, const QStyleOption *option); 169 }; 170 171 172 // Handles state transition animations 173 class QWindowsVistaTransition : public QWindowsVistaAnimation 174 { 175 Q_OBJECT 176 public: QWindowsVistaTransition(QObject * target)177 QWindowsVistaTransition(QObject *target) : QWindowsVistaAnimation(Transition, target) {} 178 }; 179 180 181 // Handles pulse animations (default buttons) 182 class QWindowsVistaPulse: public QWindowsVistaAnimation 183 { 184 Q_OBJECT 185 public: QWindowsVistaPulse(QObject * target)186 QWindowsVistaPulse(QObject *target) : QWindowsVistaAnimation(Pulse, target) {} 187 }; 188 189 190 class QWindowsVistaStylePrivate : public QWindowsXPStylePrivate 191 { 192 Q_DECLARE_PUBLIC(QWindowsVistaStyle) 193 194 public: 195 QWindowsVistaStylePrivate(); 196 197 static int fixedPixelMetric(QStyle::PixelMetric pm); 198 static inline bool useVista(); 199 bool transitionsEnabled() const; 200 }; 201 202 QT_END_NAMESPACE 203 204 #endif // QWINDOWSVISTASTYLE_P_P_H 205