- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# qstyle.h

Go to the documentation of this file.

    00001 /****************************************************************************
    00002 **
    00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    00004 ** All rights reserved.
    00005 ** Contact: Nokia Corporation (qt-info@nokia.com)
    00006 **
    00007 ** This file is part of the QtGui module of the Qt Toolkit.
    00008 **
    00009 ** $QT_BEGIN_LICENSE:LGPL$
    00010 ** Commercial Usage
    00011 ** Licensees holding valid Qt Commercial licenses may use this file in
    00012 ** accordance with the Qt Commercial License Agreement provided with the
    00013 ** Software or, alternatively, in accordance with the terms contained in
    00014 ** a written agreement between you and Nokia.
    00015 **
    00016 ** GNU Lesser General Public License Usage
    00017 ** Alternatively, this file may be used under the terms of the GNU Lesser
    00018 ** General Public License version 2.1 as published by the Free Software
    00019 ** Foundation and appearing in the file LICENSE.LGPL included in the
    00020 ** packaging of this file.  Please review the following information to
    00021 ** ensure the GNU Lesser General Public License version 2.1 requirements
    00022 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    00023 **
    00024 ** In addition, as a special exception, Nokia gives you certain additional
    00025 ** rights.  These rights are described in the Nokia Qt LGPL Exception
    00026 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this module.
    00027 **
    00028 ** GNU General Public License Usage
    00029 ** Alternatively, this file may be used under the terms of the GNU
    00030 ** General Public License version 3.0 as published by the Free Software
    00031 ** Foundation and appearing in the file LICENSE.GPL included in the
    00032 ** packaging of this file.  Please review the following information to
    00033 ** ensure the GNU General Public License version 3.0 requirements will be
    00034 ** met: http://www.gnu.org/copyleft/gpl.html.
    00035 **
    00036 ** If you have questions regarding the use of this file, please contact
    00037 ** Nokia at qt-info@nokia.com.
    00038 ** $QT_END_LICENSE$
    00039 **
    00040 ****************************************************************************/
    00041
    00042 #ifndef QSTYLE_H
    00043 #define QSTYLE_H
    00044
    00045 #include <QtCore/qobject.h>
    00046 #include <QtCore/qrect.h>
    00047 #include <QtCore/qsize.h>
    00048 #include <QtGui/qicon.h>
    00049 #include <QtGui/qpixmap.h>
    00050 #include <QtGui/qpalette.h>
    00051 #include <QtGui/qsizepolicy.h>
    00052
    00053 QT_BEGIN_HEADER
    00054
    00055 QT_BEGIN_NAMESPACE
    00056
    00057 QT_MODULE(Gui)
    00058
    00059 class QAction;
    00060 class QDebug;
    00061 class QTab;
    00062 class QFontMetrics;
    00063 class QStyleHintReturn;
    00064 class QStyleOption;
    00065 class QStyleOptionComplex;
    00066 class QStylePrivate;
    00067
    00068 class Q_GUI_EXPORT QStyle : public QObject
    00069 {
    00070     Q_OBJECT
    00071     Q_DECLARE_PRIVATE(QStyle)
    00072
    00073 protected:
    00074     QStyle(QStylePrivate &dd);
    00075
    00076 public:
    00077     QStyle();
    00078     virtual ~QStyle();
    00079
    00080     virtual void polish(QWidget *);
    00081     virtual void unpolish(QWidget *);
    00082
    00083     virtual void polish(QApplication *);
    00084     virtual void unpolish(QApplication *);
    00085
    00086     virtual void polish(QPalette &);
    00087
    00088     virtual QRect itemTextRect(const QFontMetrics &fm, const QRect &r,
    00089                            int flags, bool enabled,
    00090                            const QString &text) const;
    00091
    00092     virtual QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const;
    00093
    00094     virtual void drawItemText(QPainter *painter, const QRect &rect,
    00095                               int flags, const QPalette &pal, bool enabled,
    00096                               const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const;
    00097
    00098     virtual void drawItemPixmap(QPainter *painter, const QRect &rect,
    00099                                 int alignment, const QPixmap &pixmap) const;
    00100
    00101     virtual QPalette standardPalette() const;
    00102
    00103     enum StateFlag {
    00104         State_None =                0x00000000,
    00105 #ifdef QT3_SUPPORT
    00106         State_Default =             State_None,
    00107 #endif
    00108         State_Enabled =             0x00000001,
    00109         State_Raised =              0x00000002,
    00110         State_Sunken =              0x00000004,
    00111         State_Off =                 0x00000008,
    00112         State_NoChange =            0x00000010,
    00113         State_On =                  0x00000020,
    00114         State_DownArrow =           0x00000040,
    00115         State_Horizontal =          0x00000080,
    00116         State_HasFocus =            0x00000100,
    00117         State_Top =                 0x00000200,
    00118         State_Bottom =              0x00000400,
    00119         State_FocusAtBorder =       0x00000800,
    00120         State_AutoRaise =           0x00001000,
    00121         State_MouseOver =           0x00002000,
    00122         State_UpArrow =             0x00004000,
    00123         State_Selected =            0x00008000,
    00124         State_Active =              0x00010000,
    00125         State_Window =              0x00020000,
    00126         State_Open =                0x00040000,
    00127         State_Children =            0x00080000,
    00128         State_Item =                0x00100000,
    00129         State_Sibling =             0x00200000,
    00130         State_Editing =             0x00400000,
    00131         State_KeyboardFocusChange = 0x00800000,
    00132 #ifdef QT_KEYPAD_NAVIGATION
    00133         State_HasEditFocus =        0x01000000,
    00134 #endif
    00135         State_ReadOnly =            0x02000000,
    00136         State_Small =               0x04000000,
    00137         State_Mini =                0x08000000
    00138     };
    00139     Q_DECLARE_FLAGS(State, StateFlag)
    00140
    00141 #ifdef QT3_SUPPORT
    00142     typedef State SFlags;
    00143 #endif
    00144
    00145     enum PrimitiveElement {
    00146         PE_Q3CheckListController,
    00147         PE_Q3CheckListExclusiveIndicator,
    00148         PE_Q3CheckListIndicator,
    00149         PE_Q3DockWindowSeparator,
    00150         PE_Q3Separator,
    00151
    00152         PE_Frame,
    00153         PE_FrameDefaultButton,
    00154         PE_FrameDockWidget,
    00155         PE_FrameFocusRect,
    00156         PE_FrameGroupBox,
    00157         PE_FrameLineEdit,
    00158         PE_FrameMenu,
    00159         PE_FrameStatusBar, // obsolete
    00160         PE_FrameStatusBarItem = PE_FrameStatusBar,
    00161         PE_FrameTabWidget,
    00162         PE_FrameWindow,
    00163         PE_FrameButtonBevel,
    00164         PE_FrameButtonTool,
    00165         PE_FrameTabBarBase,
    00166
    00167         PE_PanelButtonCommand,
    00168         PE_PanelButtonBevel,
    00169         PE_PanelButtonTool,
    00170         PE_PanelMenuBar,
    00171         PE_PanelToolBar,
    00172         PE_PanelLineEdit,
    00173
    00174         PE_IndicatorArrowDown,
    00175         PE_IndicatorArrowLeft,
    00176         PE_IndicatorArrowRight,
    00177         PE_IndicatorArrowUp,
    00178         PE_IndicatorBranch,
    00179         PE_IndicatorButtonDropDown,
    00180         PE_IndicatorViewItemCheck,
    00181         PE_IndicatorItemViewItemCheck = PE_IndicatorViewItemCheck,
    00182         PE_IndicatorCheckBox,
    00183         PE_IndicatorDockWidgetResizeHandle,
    00184         PE_IndicatorHeaderArrow,
    00185         PE_IndicatorMenuCheckMark,
    00186         PE_IndicatorProgressChunk,
    00187         PE_IndicatorRadioButton,
    00188         PE_IndicatorSpinDown,
    00189         PE_IndicatorSpinMinus,
    00190         PE_IndicatorSpinPlus,
    00191         PE_IndicatorSpinUp,
    00192         PE_IndicatorToolBarHandle,
    00193         PE_IndicatorToolBarSeparator,
    00194         PE_PanelTipLabel,
    00195         PE_IndicatorTabTear,
    00196         PE_PanelScrollAreaCorner,
    00197
    00198         PE_Widget,
    00199
    00200         PE_IndicatorColumnViewArrow,
    00201         PE_IndicatorItemViewItemDrop,
    00202
    00203         PE_PanelItemViewItem,
    00204         PE_PanelItemViewRow, // ### Qt 5: remove
    00205
    00206         PE_PanelStatusBar,
    00207
    00208         PE_IndicatorTabClose,
    00209         PE_PanelMenu,
    00210
    00211         // do not add any values below/greater this
    00212         PE_CustomBase = 0xf000000
    00213     };
    00214
    00215     virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
    00216                                const QWidget *w = 0) const = 0;
    00217     enum ControlElement {
    00218         CE_PushButton,
    00219         CE_PushButtonBevel,
    00220         CE_PushButtonLabel,
    00221
    00222         CE_CheckBox,
    00223         CE_CheckBoxLabel,
    00224
    00225         CE_RadioButton,
    00226         CE_RadioButtonLabel,
    00227
    00228         CE_TabBarTab,
    00229         CE_TabBarTabShape,
    00230         CE_TabBarTabLabel,
    00231
    00232         CE_ProgressBar,
    00233         CE_ProgressBarGroove,
    00234         CE_ProgressBarContents,
    00235         CE_ProgressBarLabel,
    00236
    00237         CE_MenuItem,
    00238         CE_MenuScroller,
    00239         CE_MenuVMargin,
    00240         CE_MenuHMargin,
    00241         CE_MenuTearoff,
    00242         CE_MenuEmptyArea,
    00243
    00244         CE_MenuBarItem,
    00245         CE_MenuBarEmptyArea,
    00246
    00247         CE_ToolButtonLabel,
    00248
    00249         CE_Header,
    00250         CE_HeaderSection,
    00251         CE_HeaderLabel,
    00252
    00253         CE_Q3DockWindowEmptyArea,
    00254         CE_ToolBoxTab,
    00255         CE_SizeGrip,
    00256         CE_Splitter,
    00257         CE_RubberBand,
    00258         CE_DockWidgetTitle,
    00259
    00260         CE_ScrollBarAddLine,
    00261         CE_ScrollBarSubLine,
    00262         CE_ScrollBarAddPage,
    00263         CE_ScrollBarSubPage,
    00264         CE_ScrollBarSlider,
    00265         CE_ScrollBarFirst,
    00266         CE_ScrollBarLast,
    00267
    00268         CE_FocusFrame,
    00269         CE_ComboBoxLabel,
    00270
    00271         CE_ToolBar,
    00272         CE_ToolBoxTabShape,
    00273         CE_ToolBoxTabLabel,
    00274         CE_HeaderEmptyArea,
    00275
    00276         CE_ColumnViewGrip,
    00277
    00278         CE_ItemViewItem,
    00279
    00280         CE_ShapedFrame,
    00281
    00282         // do not add any values below/greater than this
    00283         CE_CustomBase = 0xf0000000
    00284     };
    00285
    00286     virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
    00287                              const QWidget *w = 0) const = 0;
    00288
    00289     enum SubElement {
    00290         SE_PushButtonContents,
    00291         SE_PushButtonFocusRect,
    00292
    00293         SE_CheckBoxIndicator,
    00294         SE_CheckBoxContents,
    00295         SE_CheckBoxFocusRect,
    00296         SE_CheckBoxClickRect,
    00297
    00298         SE_RadioButtonIndicator,
    00299         SE_RadioButtonContents,
    00300         SE_RadioButtonFocusRect,
    00301         SE_RadioButtonClickRect,
    00302
    00303         SE_ComboBoxFocusRect,
    00304
    00305         SE_SliderFocusRect,
    00306
    00307         SE_Q3DockWindowHandleRect,
    00308
    00309         SE_ProgressBarGroove,
    00310         SE_ProgressBarContents,
    00311         SE_ProgressBarLabel,
    00312
    00313         // ### Qt 5: These values are unused; eliminate them
    00314         SE_DialogButtonAccept,
    00315         SE_DialogButtonReject,
    00316         SE_DialogButtonApply,
    00317         SE_DialogButtonHelp,
    00318         SE_DialogButtonAll,
    00319         SE_DialogButtonAbort,
    00320         SE_DialogButtonIgnore,
    00321         SE_DialogButtonRetry,
    00322         SE_DialogButtonCustom,
    00323
    00324         SE_ToolBoxTabContents,
    00325
    00326         SE_HeaderLabel,
    00327         SE_HeaderArrow,
    00328
    00329         SE_TabWidgetTabBar,
    00330         SE_TabWidgetTabPane,
    00331         SE_TabWidgetTabContents,
    00332         SE_TabWidgetLeftCorner,
    00333         SE_TabWidgetRightCorner,
    00334
    00335         SE_ViewItemCheckIndicator,
    00336         SE_ItemViewItemCheckIndicator = SE_ViewItemCheckIndicator,
    00337
    00338         SE_TabBarTearIndicator,
    00339
    00340         SE_TreeViewDisclosureItem,
    00341
    00342         SE_LineEditContents,
    00343         SE_FrameContents,
    00344
    00345         SE_DockWidgetCloseButton,
    00346         SE_DockWidgetFloatButton,
    00347         SE_DockWidgetTitleBarText,
    00348         SE_DockWidgetIcon,
    00349
    00350         SE_CheckBoxLayoutItem,
    00351         SE_ComboBoxLayoutItem,
    00352         SE_DateTimeEditLayoutItem,
    00353         SE_DialogButtonBoxLayoutItem, // ### remove
    00354         SE_LabelLayoutItem,
    00355         SE_ProgressBarLayoutItem,
    00356         SE_PushButtonLayoutItem,
    00357         SE_RadioButtonLayoutItem,
    00358         SE_SliderLayoutItem,
    00359         SE_SpinBoxLayoutItem,
    00360         SE_ToolButtonLayoutItem,
    00361
    00362         SE_FrameLayoutItem,
    00363         SE_GroupBoxLayoutItem,
    00364         SE_TabWidgetLayoutItem,
    00365
    00366         SE_ItemViewItemDecoration,
    00367         SE_ItemViewItemText,
    00368         SE_ItemViewItemFocusRect,
    00369
    00370         SE_TabBarTabLeftButton,
    00371         SE_TabBarTabRightButton,
    00372         SE_TabBarTabText,
    00373
    00374         SE_ShapedFrameContents,
    00375
    00376         SE_ToolBarHandle,
    00377
    00378         // do not add any values below/greater than this
    00379         SE_CustomBase = 0xf0000000
    00380     };
    00381
    00382     virtual QRect subElementRect(SubElement subElement, const QStyleOption *option,
    00383                                  const QWidget *widget = 0) const = 0;
    00384
    00385
    00386     enum ComplexControl {
    00387         CC_SpinBox,
    00388         CC_ComboBox,
    00389         CC_ScrollBar,
    00390         CC_Slider,
    00391         CC_ToolButton,
    00392         CC_TitleBar,
    00393         CC_Q3ListView,
    00394         CC_Dial,
    00395         CC_GroupBox,
    00396         CC_MdiControls,
    00397
    00398         // do not add any values below/greater than this
    00399         CC_CustomBase = 0xf0000000
    00400     };
    00401
    00402     enum SubControl {
    00403         SC_None =                  0x00000000,
    00404
    00405         SC_ScrollBarAddLine =      0x00000001,
    00406         SC_ScrollBarSubLine =      0x00000002,
    00407         SC_ScrollBarAddPage =      0x00000004,
    00408         SC_ScrollBarSubPage =      0x00000008,
    00409         SC_ScrollBarFirst =        0x00000010,
    00410         SC_ScrollBarLast =         0x00000020,
    00411         SC_ScrollBarSlider =       0x00000040,
    00412         SC_ScrollBarGroove =       0x00000080,
    00413
    00414         SC_SpinBoxUp =             0x00000001,
    00415         SC_SpinBoxDown =           0x00000002,
    00416         SC_SpinBoxFrame =          0x00000004,
    00417         SC_SpinBoxEditField =      0x00000008,
    00418
    00419         SC_ComboBoxFrame =         0x00000001,
    00420         SC_ComboBoxEditField =     0x00000002,
    00421         SC_ComboBoxArrow =         0x00000004,
    00422         SC_ComboBoxListBoxPopup =  0x00000008,
    00423
    00424         SC_SliderGroove =          0x00000001,
    00425         SC_SliderHandle =          0x00000002,
    00426         SC_SliderTickmarks =       0x00000004,
    00427
    00428         SC_ToolButton =            0x00000001,
    00429         SC_ToolButtonMenu =        0x00000002,
    00430
    00431         SC_TitleBarSysMenu =       0x00000001,
    00432         SC_TitleBarMinButton =     0x00000002,
    00433         SC_TitleBarMaxButton =     0x00000004,
    00434         SC_TitleBarCloseButton =   0x00000008,
    00435         SC_TitleBarNormalButton =  0x00000010,
    00436         SC_TitleBarShadeButton =   0x00000020,
    00437         SC_TitleBarUnshadeButton = 0x00000040,
    00438         SC_TitleBarContextHelpButton = 0x00000080,
    00439         SC_TitleBarLabel =         0x00000100,
    00440
    00441         SC_Q3ListView =            0x00000001,
    00442         SC_Q3ListViewBranch =      0x00000002,
    00443         SC_Q3ListViewExpand =      0x00000004,
    00444
    00445         SC_DialGroove =            0x00000001,
    00446         SC_DialHandle =            0x00000002,
    00447         SC_DialTickmarks =         0x00000004,
    00448
    00449         SC_GroupBoxCheckBox =      0x00000001,
    00450         SC_GroupBoxLabel =         0x00000002,
    00451         SC_GroupBoxContents =      0x00000004,
    00452         SC_GroupBoxFrame =         0x00000008,
    00453
    00454         SC_MdiMinButton     =      0x00000001,
    00455         SC_MdiNormalButton  =      0x00000002,
    00456         SC_MdiCloseButton   =      0x00000004,
    00457
    00458         SC_CustomBase =            0xf0000000,
    00459         SC_All =                   0xffffffff
    00460     };
    00461     Q_DECLARE_FLAGS(SubControls, SubControl)
    00462
    00463 #ifdef QT3_SUPPORT
    00464     typedef SubControls SCFlags;
    00465 #endif
    00466
    00467     virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
    00468                                     const QWidget *widget = 0) const = 0;
    00469     virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
    00470                                              const QPoint &pt, const QWidget *widget = 0) const = 0;
    00471     virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
    00472                                  SubControl sc, const QWidget *widget = 0) const = 0;
    00473
    00474     enum PixelMetric {
    00475         PM_ButtonMargin,
    00476         PM_ButtonDefaultIndicator,
    00477         PM_MenuButtonIndicator,
    00478         PM_ButtonShiftHorizontal,
    00479         PM_ButtonShiftVertical,
    00480
    00481         PM_DefaultFrameWidth,
    00482         PM_SpinBoxFrameWidth,
    00483         PM_ComboBoxFrameWidth,
    00484
    00485         PM_MaximumDragDistance,
    00486
    00487         PM_ScrollBarExtent,
    00488         PM_ScrollBarSliderMin,
    00489
    00490         PM_SliderThickness,             // total slider thickness
    00491         PM_SliderControlThickness,      // thickness of the business part
    00492         PM_SliderLength,                // total length of slider
    00493         PM_SliderTickmarkOffset,        //
    00494         PM_SliderSpaceAvailable,        // available space for slider to move
    00495
    00496         PM_DockWidgetSeparatorExtent,
    00497         PM_DockWidgetHandleExtent,
    00498         PM_DockWidgetFrameWidth,
    00499
    00500         PM_TabBarTabOverlap,
    00501         PM_TabBarTabHSpace,
    00502         PM_TabBarTabVSpace,
    00503         PM_TabBarBaseHeight,
    00504         PM_TabBarBaseOverlap,
    00505
    00506         PM_ProgressBarChunkWidth,
    00507
    00508         PM_SplitterWidth,
    00509         PM_TitleBarHeight,
    00510
    00511         PM_MenuScrollerHeight,
    00512         PM_MenuHMargin,
    00513         PM_MenuVMargin,
    00514         PM_MenuPanelWidth,
    00515         PM_MenuTearoffHeight,
    00516         PM_MenuDesktopFrameWidth,
    00517
    00518         PM_MenuBarPanelWidth,
    00519         PM_MenuBarItemSpacing,
    00520         PM_MenuBarVMargin,
    00521         PM_MenuBarHMargin,
    00522
    00523         PM_IndicatorWidth,
    00524         PM_IndicatorHeight,
    00525         PM_ExclusiveIndicatorWidth,
    00526         PM_ExclusiveIndicatorHeight,
    00527         PM_CheckListButtonSize,
    00528         PM_CheckListControllerSize,
    00529
    00530         PM_DialogButtonsSeparator,
    00531         PM_DialogButtonsButtonWidth,
    00532         PM_DialogButtonsButtonHeight,
    00533
    00534         PM_MdiSubWindowFrameWidth,
    00535         PM_MDIFrameWidth = PM_MdiSubWindowFrameWidth,            //obsolete
    00536         PM_MdiSubWindowMinimizedWidth,
    00537         PM_MDIMinimizedWidth = PM_MdiSubWindowMinimizedWidth,    //obsolete
    00538
    00539         PM_HeaderMargin,
    00540         PM_HeaderMarkSize,
    00541         PM_HeaderGripMargin,
    00542         PM_TabBarTabShiftHorizontal,
    00543         PM_TabBarTabShiftVertical,
    00544         PM_TabBarScrollButtonWidth,
    00545
    00546         PM_ToolBarFrameWidth,
    00547         PM_ToolBarHandleExtent,
    00548         PM_ToolBarItemSpacing,
    00549         PM_ToolBarItemMargin,
    00550         PM_ToolBarSeparatorExtent,
    00551         PM_ToolBarExtensionExtent,
    00552
    00553         PM_SpinBoxSliderHeight,
    00554
    00555         PM_DefaultTopLevelMargin,
    00556         PM_DefaultChildMargin,
    00557         PM_DefaultLayoutSpacing,
    00558
    00559         PM_ToolBarIconSize,
    00560         PM_ListViewIconSize,
    00561         PM_IconViewIconSize,
    00562         PM_SmallIconSize,
    00563         PM_LargeIconSize,
    00564
    00565         PM_FocusFrameVMargin,
    00566         PM_FocusFrameHMargin,
    00567
    00568         PM_ToolTipLabelFrameWidth,
    00569         PM_CheckBoxLabelSpacing,
    00570         PM_TabBarIconSize,
    00571         PM_SizeGripSize,
    00572         PM_DockWidgetTitleMargin,
    00573         PM_MessageBoxIconSize,
    00574         PM_ButtonIconSize,
    00575
    00576         PM_DockWidgetTitleBarButtonMargin,
    00577
    00578         PM_RadioButtonLabelSpacing,
    00579         PM_LayoutLeftMargin,
    00580         PM_LayoutTopMargin,
    00581         PM_LayoutRightMargin,
    00582         PM_LayoutBottomMargin,
    00583         PM_LayoutHorizontalSpacing,
    00584         PM_LayoutVerticalSpacing,
    00585         PM_TabBar_ScrollButtonOverlap,
    00586
    00587         PM_TextCursorWidth,
    00588
    00589         PM_TabCloseIndicatorWidth,
    00590         PM_TabCloseIndicatorHeight,
    00591
    00592         PM_ScrollView_ScrollBarSpacing,
    00593         PM_SubMenuOverlap,
    00594
    00595         // do not add any values below/greater than this
    00596         PM_CustomBase = 0xf0000000
    00597     };
    00598
    00599     virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = 0,
    00600                             const QWidget *widget = 0) const = 0;
    00601
    00602     enum ContentsType {
    00603         CT_PushButton,
    00604         CT_CheckBox,
    00605         CT_RadioButton,
    00606         CT_ToolButton,
    00607         CT_ComboBox,
    00608         CT_Splitter,
    00609         CT_Q3DockWindow,
    00610         CT_ProgressBar,
    00611         CT_MenuItem,
    00612         CT_MenuBarItem,
    00613         CT_MenuBar,
    00614         CT_Menu,
    00615         CT_TabBarTab,
    00616         CT_Slider,
    00617         CT_ScrollBar,
    00618         CT_Q3Header,
    00619         CT_LineEdit,
    00620         CT_SpinBox,
    00621         CT_SizeGrip,
    00622         CT_TabWidget,
    00623         CT_DialogButtons,
    00624         CT_HeaderSection,
    00625         CT_GroupBox,
    00626         CT_MdiControls,
    00627         CT_ItemViewItem,
    00628         // do not add any values below/greater than this
    00629         CT_CustomBase = 0xf0000000
    00630     };
    00631
    00632     virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
    00633                                    const QSize &contentsSize, const QWidget *w = 0) const = 0;
    00634
    00635     enum RequestSoftwareInputPanel {
    00636         RSIP_OnMouseClickAndAlreadyFocused,
    00637         RSIP_OnMouseClick
    00638     };
    00639
    00640     enum StyleHint {
    00641         SH_EtchDisabledText,
    00642         SH_DitherDisabledText,
    00643         SH_ScrollBar_MiddleClickAbsolutePosition,
    00644         SH_ScrollBar_ScrollWhenPointerLeavesControl,
    00645         SH_TabBar_SelectMouseType,
    00646         SH_TabBar_Alignment,
    00647         SH_Header_ArrowAlignment,
    00648         SH_Slider_SnapToValue,
    00649         SH_Slider_SloppyKeyEvents,
    00650         SH_ProgressDialog_CenterCancelButton,
    00651         SH_ProgressDialog_TextLabelAlignment,
    00652         SH_PrintDialog_RightAlignButtons,
    00653         SH_MainWindow_SpaceBelowMenuBar,
    00654         SH_FontDialog_SelectAssociatedText,
    00655         SH_Menu_AllowActiveAndDisabled,
    00656         SH_Menu_SpaceActivatesItem,
    00657         SH_Menu_SubMenuPopupDelay,
    00658         SH_ScrollView_FrameOnlyAroundContents,
    00659         SH_MenuBar_AltKeyNavigation,
    00660         SH_ComboBox_ListMouseTracking,
    00661         SH_Menu_MouseTracking,
    00662         SH_MenuBar_MouseTracking,
    00663         SH_ItemView_ChangeHighlightOnFocus,
    00664         SH_Widget_ShareActivation,
    00665         SH_Workspace_FillSpaceOnMaximize,
    00666         SH_ComboBox_Popup,
    00667         SH_TitleBar_NoBorder,
    00668         SH_Slider_StopMouseOverSlider,
    00669         SH_ScrollBar_StopMouseOverSlider = SH_Slider_StopMouseOverSlider, // obsolete
    00670         SH_BlinkCursorWhenTextSelected,
    00671         SH_RichText_FullWidthSelection,
    00672         SH_Menu_Scrollable,
    00673         SH_GroupBox_TextLabelVerticalAlignment,
    00674         SH_GroupBox_TextLabelColor,
    00675         SH_Menu_SloppySubMenus,
    00676         SH_Table_GridLineColor,
    00677         SH_LineEdit_PasswordCharacter,
    00678         SH_DialogButtons_DefaultButton,
    00679         SH_ToolBox_SelectedPageTitleBold,
    00680         SH_TabBar_PreferNoArrows,
    00681         SH_ScrollBar_LeftClickAbsolutePosition,
    00682         SH_Q3ListViewExpand_SelectMouseType,
    00683         SH_UnderlineShortcut,
    00684         SH_SpinBox_AnimateButton,
    00685         SH_SpinBox_KeyPressAutoRepeatRate,
    00686         SH_SpinBox_ClickAutoRepeatRate,
    00687         SH_Menu_FillScreenWithScroll,
    00688         SH_ToolTipLabel_Opacity,
    00689         SH_DrawMenuBarSeparator,
    00690         SH_TitleBar_ModifyNotification,
    00691         SH_Button_FocusPolicy,
    00692         SH_MenuBar_DismissOnSecondClick,
    00693         SH_MessageBox_UseBorderForButtonSpacing,
    00694         SH_TitleBar_AutoRaise,
    00695         SH_ToolButton_PopupDelay,
    00696         SH_FocusFrame_Mask,
    00697         SH_RubberBand_Mask,
    00698         SH_WindowFrame_Mask,
    00699         SH_SpinControls_DisableOnBounds,
    00700         SH_Dial_BackgroundRole,
    00701         SH_ComboBox_LayoutDirection,
    00702         SH_ItemView_EllipsisLocation,
    00703         SH_ItemView_ShowDecorationSelected,
    00704         SH_ItemView_ActivateItemOnSingleClick,
    00705         SH_ScrollBar_ContextMenu,
    00706         SH_ScrollBar_RollBetweenButtons,
    00707         SH_Slider_AbsoluteSetButtons,
    00708         SH_Slider_PageSetButtons,
    00709         SH_Menu_KeyboardSearch,
    00710         SH_TabBar_ElideMode,
    00711         SH_DialogButtonLayout,
    00712         SH_ComboBox_PopupFrameStyle,
    00713         SH_MessageBox_TextInteractionFlags,
    00714         SH_DialogButtonBox_ButtonsHaveIcons,
    00715         SH_SpellCheckUnderlineStyle,
    00716         SH_MessageBox_CenterButtons,
    00717         SH_Menu_SelectionWrap,
    00718         SH_ItemView_MovementWithoutUpdatingSelection,
    00719         SH_ToolTip_Mask,
    00720         SH_FocusFrame_AboveWidget,
    00721         SH_TextControl_FocusIndicatorTextCharFormat,
    00722         SH_WizardStyle,
    00723         SH_ItemView_ArrowKeysNavigateIntoChildren,
    00724         SH_Menu_Mask,
    00725         SH_Menu_FlashTriggeredItem,
    00726         SH_Menu_FadeOutOnHide,
    00727         SH_SpinBox_ClickAutoRepeatThreshold,
    00728         SH_ItemView_PaintAlternatingRowColorsForEmptyArea,
    00729         SH_FormLayoutWrapPolicy,
    00730         SH_TabWidget_DefaultTabPosition,
    00731         SH_ToolBar_Movable,
    00732         SH_FormLayoutFieldGrowthPolicy,
    00733         SH_FormLayoutFormAlignment,
    00734         SH_FormLayoutLabelAlignment,
    00735         SH_ItemView_DrawDelegateFrame,
    00736         SH_TabBar_CloseButtonPosition,
    00737         SH_DockWidget_ButtonsHaveFrame,
    00738         SH_ToolButtonStyle,
    00739         SH_RequestSoftwareInputPanel,
    00740         // Add new style hint values here
    00741
    00742 #ifdef QT3_SUPPORT
    00743         SH_GUIStyle = 0x00000100,
    00744         SH_ScrollBar_BackgroundMode,
    00745         // Add other compat values here
    00746
    00747         SH_UnderlineAccelerator = SH_UnderlineShortcut,
    00748 #endif
    00749         SH_CustomBase = 0xf0000000
    00750     };
    00751
    00752     virtual int styleHint(StyleHint stylehint, const QStyleOption *opt = 0,
    00753                           const QWidget *widget = 0, QStyleHintReturn* returnData = 0) const = 0;
    00754
    00755     enum StandardPixmap {
    00756         SP_TitleBarMenuButton,
    00757         SP_TitleBarMinButton,
    00758         SP_TitleBarMaxButton,
    00759         SP_TitleBarCloseButton,
    00760         SP_TitleBarNormalButton,
    00761         SP_TitleBarShadeButton,
    00762         SP_TitleBarUnshadeButton,
    00763         SP_TitleBarContextHelpButton,
    00764         SP_DockWidgetCloseButton,
    00765         SP_MessageBoxInformation,
    00766         SP_MessageBoxWarning,
    00767         SP_MessageBoxCritical,
    00768         SP_MessageBoxQuestion,
    00769         SP_DesktopIcon,
    00770         SP_TrashIcon,
    00771         SP_ComputerIcon,
    00772         SP_DriveFDIcon,
    00773         SP_DriveHDIcon,
    00774         SP_DriveCDIcon,
    00775         SP_DriveDVDIcon,
    00776         SP_DriveNetIcon,
    00777         SP_DirOpenIcon,
    00778         SP_DirClosedIcon,
    00779         SP_DirLinkIcon,
    00780         SP_FileIcon,
    00781         SP_FileLinkIcon,
    00782         SP_ToolBarHorizontalExtensionButton,
    00783         SP_ToolBarVerticalExtensionButton,
    00784         SP_FileDialogStart,
    00785         SP_FileDialogEnd,
    00786         SP_FileDialogToParent,
    00787         SP_FileDialogNewFolder,
    00788         SP_FileDialogDetailedView,
    00789         SP_FileDialogInfoView,
    00790         SP_FileDialogContentsView,
    00791         SP_FileDialogListView,
    00792         SP_FileDialogBack,
    00793         SP_DirIcon,
    00794         SP_DialogOkButton,
    00795         SP_DialogCancelButton,
    00796         SP_DialogHelpButton,
    00797         SP_DialogOpenButton,
    00798         SP_DialogSaveButton,
    00799         SP_DialogCloseButton,
    00800         SP_DialogApplyButton,
    00801         SP_DialogResetButton,
    00802         SP_DialogDiscardButton,
    00803         SP_DialogYesButton,
    00804         SP_DialogNoButton,
    00805         SP_ArrowUp,
    00806         SP_ArrowDown,
    00807         SP_ArrowLeft,
    00808         SP_ArrowRight,
    00809         SP_ArrowBack,
    00810         SP_ArrowForward,
    00811         SP_DirHomeIcon,
    00812         SP_CommandLink,
    00813         SP_VistaShield,
    00814         SP_BrowserReload,
    00815         SP_BrowserStop,
    00816         SP_MediaPlay,
    00817         SP_MediaStop,
    00818         SP_MediaPause,
    00819         SP_MediaSkipForward,
    00820         SP_MediaSkipBackward,
    00821         SP_MediaSeekForward,
    00822         SP_MediaSeekBackward,
    00823         SP_MediaVolume,
    00824         SP_MediaVolumeMuted,
    00825         // do not add any values below/greater than this
    00826         SP_CustomBase = 0xf0000000
    00827     };
    00828
    00829     virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt = 0,
    00830                                    const QWidget *widget = 0) const = 0;
    00831
    00832     QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0,
    00833                        const QWidget *widget = 0) const;
    00834
    00835     virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
    00836                                         const QStyleOption *opt) const = 0;
    00837
    00838     static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect,
    00839                             const QRect &logicalRect);
    00840     static QPoint visualPos(Qt::LayoutDirection direction, const QRect &boundingRect,
    00841                             const QPoint &logicalPos);
    00842     static int sliderPositionFromValue(int min, int max, int val, int space,
    00843                                        bool upsideDown = false);
    00844     static int sliderValueFromPosition(int min, int max, int pos, int space,
    00845                                        bool upsideDown = false);
    00846     static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment);
    00847     static QRect alignedRect(Qt::LayoutDirection direction, Qt::Alignment alignment,
    00848                              const QSize &size, const QRect &rectangle);
    00849
    00850     int layoutSpacing(QSizePolicy::ControlType control1,
    00851                       QSizePolicy::ControlType control2, Qt::Orientation orientation,
    00852                       const QStyleOption *option = 0, const QWidget *widget = 0) const;
    00853     int combinedLayoutSpacing(QSizePolicy::ControlTypes controls1,
    00854                               QSizePolicy::ControlTypes controls2, Qt::Orientation orientation,
    00855                               QStyleOption *option = 0, QWidget *widget = 0) const;
    00856
    00857     const QStyle * proxy() const;
    00858
    00859 protected Q_SLOTS:
    00860     QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt = 0,
    00861                                      const QWidget *widget = 0) const;
    00862     int layoutSpacingImplementation(QSizePolicy::ControlType control1,
    00863                                     QSizePolicy::ControlType control2,
    00864                                     Qt::Orientation orientation,
    00865                                     const QStyleOption *option = 0,
    00866                                     const QWidget *widget = 0) const;
    00867
    00868 private:
    00869     Q_DISABLE_COPY(QStyle)
    00870     friend class QWidget;
    00871     friend class QWidgetPrivate;
    00872     friend class QApplication;
    00873     friend class QProxyStyle;
    00874     friend class QProxyStylePrivate;
    00875     void setProxy(QStyle *style);
    00876 };
    00877
    00878 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::State)
    00879 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::SubControls)
    00880
    00881 #if !defined(QT_NO_DEBUG_STREAM)
    00882 Q_GUI_EXPORT QDebug operator<<(QDebug debug, QStyle::State state);
    00883 #endif
    00884
    00885 QT_END_NAMESPACE
    00886
    00887 QT_END_HEADER
    00888
    00889 #endif // QSTYLE_H