QWindowsClassicStyle.h

00001 /*
00002  * @(#)QWindowsClassicStyle.h  0.2.0 / 2007-10-11
00003  *
00004  * Copyright (c) 2007, ETF and contributors. All rights reserved.
00005  *
00006  * This software is licensed under the LGPL, version 2.1, license.
00007  * A copy of the license is included in the file LICENSE-LGPL.txt.
00008  */
00009 #ifndef QWINDOWSCLASSICSTYLE_H
00010 #define QWINDOWSCLASSICSTYLE_H
00011 
00012 #include <QWindowsStyle>
00013 
00014 /*^**************************************************************************^*/
00015 /*- QWindowsClassicStyle Class.                                              -*/
00016 /*^**************************************************************************^*/
00017 
00024 class QWindowsClassicStyle : public QWindowsStyle
00025 {
00026   Q_OBJECT
00027 public:
00028   QWindowsClassicStyle();
00029 public:
00030   bool isPatchEnabled();
00031   void setPatchEnabled(bool enabled);
00032 public:
00033   virtual int pixelMetric(PixelMetric metric, const QStyleOption *option,
00034                           const QWidget *widget) const;
00035   virtual void drawPrimitive(PrimitiveElement element,
00036                              const QStyleOption *option, QPainter *painter,
00037                              const QWidget *widget) const;
00038   virtual void drawComplexControl(ComplexControl control,
00039                                   const QStyleOptionComplex *option,
00040                                   QPainter *painter,
00041                                   const QWidget *widget) const;
00042   virtual int styleHint(StyleHint hint, const QStyleOption *option = 0,
00043                         const QWidget *widget = 0,
00044                         QStyleHintReturn *returnData = 0) const;
00045   virtual QRect subElementRect(SubElement sr, const QStyleOption *opt,
00046                                const QWidget *widget) const;
00047   virtual QPalette standardPalette() const;
00048 private:
00049   bool m_patchDisabled;
00050   mutable QColor m_leftTitleBarColor;
00051   mutable QColor m_rightTitleBarColor;
00052   mutable QColor m_leftTitleBarInactiveColor;
00053   mutable QColor m_rightTitleBarInactiveColor;
00054 };
00055 
00056 /*^**************************************************************************^*/
00057 /*- QWindowsClassicStyle :: Public Inline Member Functions.                  -*/
00058 /*^**************************************************************************^*/
00059 
00065 inline bool QWindowsClassicStyle::isPatchEnabled()
00066 {
00067   return !m_patchDisabled;
00068 }
00069 
00075 inline void QWindowsClassicStyle::setPatchEnabled(bool enabled)
00076 {
00077   m_patchDisabled = !enabled;
00078 }
00079 
00080 #endif // QWINDOWSCLASSICSTYLE_H
00081 
00082 /*^*****************************************************************************
00083   File History:
00084 
00085  - 2007-10-11 07:50:24 Slobodan
00086    Initial version
00087 
00088 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.