Eneboo - Documentación para desarrolladores
src/qt/src/kernel/qstyle.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qstyle.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QStyle class
00005 **
00006 ** Created : 980616
00007 **
00008 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the kernel module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 #ifndef QSTYLE_H
00038 #define QSTYLE_H
00039 
00040 #ifndef QT_H
00041 #include "qobject.h"
00042 #endif // QT_H
00043 
00044 
00045 #ifndef QT_NO_STYLE
00046 
00047 class QPopupMenu;
00048 class QStylePrivate;
00049 class QMenuItem;
00050 class QTab;
00051 class QListViewItem;
00052 class QCheckListItem;
00053 
00054 class QStyleOption {
00055 public:
00056     enum StyleOptionDefault { Default };
00057 
00058     QStyleOption(StyleOptionDefault=Default) : def(TRUE) {}
00059 
00060     // Note: we don't use default arguments since that is unnecessary
00061     // initialization.
00062     QStyleOption(int in1) :
00063         def(FALSE), i1(in1) {}
00064     QStyleOption(int in1, int in2) :
00065         def(FALSE), i1(in1), i2(in2) {}
00066     QStyleOption(int in1, int in2, int in3, int in4) :
00067         def(FALSE), i1(in1), i2(in2), i3(in3), i4(in4) {}
00068     QStyleOption(QMenuItem* m) : def(FALSE), mi(m) {}
00069     QStyleOption(QMenuItem* m, int in1) : def(FALSE), mi(m), i1(in1) {}
00070     QStyleOption(QMenuItem* m, int in1, int in2) : def(FALSE), mi(m), i1(in1), i2(in2) {}
00071     QStyleOption(const QColor& c) : def(FALSE), cl(&c) {}
00072     QStyleOption(QTab* t) : def(FALSE), tb(t) {}
00073     QStyleOption(QListViewItem* i) : def(FALSE), li(i) {}
00074     QStyleOption(QCheckListItem* i) : def(FALSE), cli(i) {}
00075     QStyleOption(Qt::ArrowType a) : def(FALSE), i1((int)a) {}
00076     QStyleOption(const QRect& r) : def(FALSE), i1(r.x()), i2(r.y()), i3(r.width()),i4(r.height()){}
00077     QStyleOption(QWidget *w) : def(FALSE), p1((void*)w) {}
00078 
00079     bool isDefault() const { return def; }
00080 
00081     int day() const { return i1; }
00082 
00083     int lineWidth() const { return i1; }
00084     int midLineWidth() const { return i2; }
00085     int frameShape() const { return i3; }
00086     int frameShadow() const { return i4; }
00087 
00088     int headerSection() const { return i1; }
00089     QMenuItem* menuItem() const { return mi; }
00090     int maxIconWidth() const { return i1; }
00091     int tabWidth() const { return i2; }
00092 
00093     const QColor& color() const { return *cl; }
00094 
00095     QTab* tab() const { return tb; }
00096 
00097     QCheckListItem* checkListItem() const { return cli; }
00098     QListViewItem* listViewItem() const { return li; }
00099 
00100     Qt::ArrowType arrowType() const { return (Qt::ArrowType)i1; }
00101     QRect rect() const { return QRect( i1, i2, i3, i4 ); }
00102     QWidget* widget() const { return (QWidget*)p1; }
00103 
00104 private:
00105     // NOTE: none of these components have constructors.
00106     bool def;
00107     bool b1,b2,b3; // reserved
00108     QMenuItem* mi;
00109     QTab* tb;
00110     QListViewItem* li;
00111     const QColor* cl;
00112     int i1, i2, i3, i4;
00113     int i5, i6; // reserved
00114     QCheckListItem* cli;
00115     void *p1, *p2, *p3, *p4; // reserved
00116     // (padded to 64 bytes on some architectures)
00117 };
00118 
00119 class QStyleHintReturn; // not defined yet
00120 
00121 class Q_EXPORT QStyle: public QObject
00122 {
00123     Q_OBJECT
00124 
00125 public:
00126     QStyle();
00127     virtual ~QStyle();
00128 
00129     // New QStyle API - most of these should probably be pure virtual
00130 
00131     virtual void polish( QWidget * );
00132     virtual void unPolish( QWidget * );
00133 
00134     virtual void polish( QApplication * );
00135     virtual void unPolish( QApplication * );
00136 
00137     virtual void polish( QPalette & );
00138 
00139     virtual void polishPopupMenu( QPopupMenu* ) = 0;
00140 
00141     virtual QRect itemRect( QPainter *p, const QRect &r,
00142                             int flags, bool enabled,
00143                             const QPixmap *pixmap,
00144                             const QString &text, int len = -1 ) const;
00145 
00146     virtual void drawItem( QPainter *p, const QRect &r,
00147                            int flags, const QColorGroup &g, bool enabled,
00148                            const QPixmap *pixmap, const QString &text,
00149                            int len = -1, const QColor *penColor = 0 ) const;
00150 
00151 
00152     enum PrimitiveElement {
00153         PE_ButtonCommand,
00154         PE_ButtonDefault,
00155         PE_ButtonBevel,
00156         PE_ButtonTool,
00157         PE_ButtonDropDown,
00158 
00159         PE_FocusRect,
00160 
00161         PE_ArrowUp,
00162         PE_ArrowDown,
00163         PE_ArrowRight,
00164         PE_ArrowLeft,
00165 
00166         PE_SpinWidgetUp,
00167         PE_SpinWidgetDown,
00168         PE_SpinWidgetPlus,
00169         PE_SpinWidgetMinus,
00170 
00171         PE_Indicator,
00172         PE_IndicatorMask,
00173         PE_ExclusiveIndicator,
00174         PE_ExclusiveIndicatorMask,
00175 
00176         PE_DockWindowHandle,
00177         PE_DockWindowSeparator,
00178         PE_DockWindowResizeHandle,
00179 
00180         PE_Splitter,
00181 
00182         PE_Panel,
00183         PE_PanelPopup,
00184         PE_PanelMenuBar,
00185         PE_PanelDockWindow,
00186 
00187         PE_TabBarBase,
00188 
00189         PE_HeaderSection,
00190         PE_HeaderArrow,
00191         PE_StatusBarSection,
00192 
00193         PE_GroupBoxFrame,
00194 
00195         PE_Separator,
00196 
00197         PE_SizeGrip,
00198 
00199         PE_CheckMark,
00200 
00201         PE_ScrollBarAddLine,
00202         PE_ScrollBarSubLine,
00203         PE_ScrollBarAddPage,
00204         PE_ScrollBarSubPage,
00205         PE_ScrollBarSlider,
00206         PE_ScrollBarFirst,
00207         PE_ScrollBarLast,
00208 
00209         PE_ProgressBarChunk,
00210 
00211         PE_PanelLineEdit,
00212         PE_PanelTabWidget,
00213 
00214         PE_WindowFrame,
00215 
00216         PE_CheckListController,
00217         PE_CheckListIndicator,
00218         PE_CheckListExclusiveIndicator,
00219 
00220         PE_PanelGroupBox,
00221         PE_RubberBand,
00222 
00223         // do not add any values below/greater this
00224         PE_CustomBase =                 0xf000000
00225     };
00226 
00227     enum StyleFlags {
00228         Style_Default =                 0x00000000,
00229         Style_Enabled =                 0x00000001,
00230         Style_Raised =                  0x00000002,
00231         Style_Sunken =                  0x00000004,
00232         Style_Off =                     0x00000008,
00233         Style_NoChange =                0x00000010,
00234         Style_On =                      0x00000020,
00235         Style_Down =                    0x00000040,
00236         Style_Horizontal =              0x00000080,
00237         Style_HasFocus =                0x00000100,
00238         Style_Top =                     0x00000200,
00239         Style_Bottom =                  0x00000400,
00240         Style_FocusAtBorder =           0x00000800,
00241         Style_AutoRaise =               0x00001000,
00242         Style_MouseOver =               0x00002000,
00243         Style_Up =                      0x00004000,
00244         Style_Selected =                0x00008000,
00245         Style_Active =                  0x00010000,
00246         Style_ButtonDefault =           0x00020000
00247     };
00248     typedef uint SFlags;
00249 
00250     virtual void drawPrimitive( PrimitiveElement pe,
00251                                 QPainter *p,
00252                                 const QRect &r,
00253                                 const QColorGroup &cg,
00254                                 SFlags flags = Style_Default,
00255                                 const QStyleOption& = QStyleOption::Default ) const = 0;
00256 
00257 
00258     enum ControlElement {
00259         CE_PushButton,
00260         CE_PushButtonLabel,
00261 
00262         CE_CheckBox,
00263         CE_CheckBoxLabel,
00264 
00265         CE_RadioButton,
00266         CE_RadioButtonLabel,
00267 
00268         CE_TabBarTab,
00269         CE_TabBarLabel,
00270 
00271         CE_ProgressBarGroove,
00272         CE_ProgressBarContents,
00273         CE_ProgressBarLabel,
00274 
00275         CE_PopupMenuItem,
00276         CE_MenuBarItem,
00277 
00278         CE_ToolButtonLabel,
00279         CE_MenuBarEmptyArea,
00280         CE_PopupMenuScroller,
00281         CE_DockWindowEmptyArea,
00282         CE_PopupMenuVerticalExtra,
00283         CE_PopupMenuHorizontalExtra,
00284 
00285         CE_ToolBoxTab,
00286         CE_HeaderLabel,
00287 
00288         // do not add any values below/greater than this
00289         CE_CustomBase =         0xf0000000
00290     };
00291 
00292     virtual void drawControl( ControlElement element,
00293                               QPainter *p,
00294                               const QWidget *widget,
00295                               const QRect &r,
00296                               const QColorGroup &cg,
00297                               SFlags how = Style_Default,
00298                               const QStyleOption& = QStyleOption::Default ) const = 0;
00299     virtual void drawControlMask( ControlElement element,
00300                                   QPainter *p,
00301                                   const QWidget *widget,
00302                                   const QRect &r,
00303                                   const QStyleOption& = QStyleOption::Default ) const = 0;
00304 
00305     enum SubRect {
00306         SR_PushButtonContents,
00307         SR_PushButtonFocusRect,
00308 
00309         SR_CheckBoxIndicator,
00310         SR_CheckBoxContents,
00311         SR_CheckBoxFocusRect,
00312 
00313         SR_RadioButtonIndicator,
00314         SR_RadioButtonContents,
00315         SR_RadioButtonFocusRect,
00316 
00317         SR_ComboBoxFocusRect,
00318 
00319         SR_SliderFocusRect,
00320 
00321         SR_DockWindowHandleRect,
00322 
00323         SR_ProgressBarGroove,
00324         SR_ProgressBarContents,
00325         SR_ProgressBarLabel,
00326 
00327         SR_ToolButtonContents,
00328 
00329         SR_DialogButtonAccept,
00330         SR_DialogButtonReject,
00331         SR_DialogButtonApply,
00332         SR_DialogButtonHelp,
00333         SR_DialogButtonAll,
00334         SR_DialogButtonAbort,
00335         SR_DialogButtonIgnore,
00336         SR_DialogButtonRetry,
00337         SR_DialogButtonCustom,
00338 
00339         SR_ToolBoxTabContents,
00340 
00341         // do not add any values below/greater than this
00342         SR_CustomBase =         0xf0000000
00343     };
00344 
00345     virtual QRect subRect( SubRect r, const QWidget *widget ) const = 0;
00346 
00347 
00348     enum ComplexControl{
00349         CC_SpinWidget,
00350         CC_ComboBox,
00351         CC_ScrollBar,
00352         CC_Slider,
00353         CC_ToolButton,
00354         CC_TitleBar,
00355         CC_ListView,
00356 
00357         // do not add any values below/greater than this
00358         CC_CustomBase =         0xf0000000
00359     };
00360 
00361     enum SubControl {
00362         SC_None =                       0x00000000,
00363 
00364         SC_ScrollBarAddLine =           0x00000001,
00365         SC_ScrollBarSubLine =           0x00000002,
00366         SC_ScrollBarAddPage =           0x00000004,
00367         SC_ScrollBarSubPage =           0x00000008,
00368         SC_ScrollBarFirst =             0x00000010,
00369         SC_ScrollBarLast =              0x00000020,
00370         SC_ScrollBarSlider =            0x00000040,
00371         SC_ScrollBarGroove =            0x00000080,
00372 
00373         SC_SpinWidgetUp =               0x00000001,
00374         SC_SpinWidgetDown =             0x00000002,
00375         SC_SpinWidgetFrame =            0x00000004,
00376         SC_SpinWidgetEditField =        0x00000008,
00377         SC_SpinWidgetButtonField =      0x00000010,
00378 
00379         SC_ComboBoxFrame =              0x00000001,
00380         SC_ComboBoxEditField =          0x00000002,
00381         SC_ComboBoxArrow =              0x00000004,
00382         SC_ComboBoxListBoxPopup =       0x00000008,
00383 
00384         SC_SliderGroove =               0x00000001,
00385         SC_SliderHandle =               0x00000002,
00386         SC_SliderTickmarks =            0x00000004,
00387 
00388         SC_ToolButton =                 0x00000001,
00389         SC_ToolButtonMenu =             0x00000002,
00390 
00391         SC_TitleBarLabel =              0x00000001,
00392         SC_TitleBarSysMenu =            0x00000002,
00393         SC_TitleBarMinButton =          0x00000004,
00394         SC_TitleBarMaxButton =          0x00000008,
00395         SC_TitleBarCloseButton =        0x00000010,
00396         SC_TitleBarNormalButton =       0x00000020,
00397         SC_TitleBarShadeButton =        0x00000040,
00398         SC_TitleBarUnshadeButton =      0x00000080,
00399 
00400         SC_ListView =                   0x00000001,
00401         SC_ListViewBranch =             0x00000002,
00402         SC_ListViewExpand =             0x00000004,
00403 
00404         SC_All =                        0xffffffff
00405     };
00406     typedef uint SCFlags;
00407 
00408 
00409     virtual void drawComplexControl( ComplexControl control,
00410                                      QPainter *p,
00411                                      const QWidget *widget,
00412                                      const QRect &r,
00413                                      const QColorGroup &cg,
00414                                      SFlags how = Style_Default,
00415 #ifdef Q_QDOC
00416                                      SCFlags sub = SC_All,
00417 #else
00418                                      SCFlags sub = (uint)SC_All,
00419 #endif
00420                                      SCFlags subActive = SC_None,
00421                                      const QStyleOption& = QStyleOption::Default ) const = 0;
00422     virtual void drawComplexControlMask( ComplexControl control,
00423                                          QPainter *p,
00424                                          const QWidget *widget,
00425                                          const QRect &r,
00426                                          const QStyleOption& = QStyleOption::Default ) const = 0;
00427 
00428     virtual QRect querySubControlMetrics( ComplexControl control,
00429                                           const QWidget *widget,
00430                                           SubControl sc,
00431                                           const QStyleOption& = QStyleOption::Default ) const = 0;
00432     virtual SubControl querySubControl( ComplexControl control,
00433                                         const QWidget *widget,
00434                                         const QPoint &pos,
00435                                         const QStyleOption& = QStyleOption::Default ) const = 0;
00436 
00437 
00438     enum PixelMetric {
00439         PM_ButtonMargin,
00440         PM_ButtonDefaultIndicator,
00441         PM_MenuButtonIndicator,
00442         PM_ButtonShiftHorizontal,
00443         PM_ButtonShiftVertical,
00444 
00445         PM_DefaultFrameWidth,
00446         PM_SpinBoxFrameWidth,
00447 
00448         PM_MaximumDragDistance,
00449 
00450         PM_ScrollBarExtent,
00451         PM_ScrollBarSliderMin,
00452 
00453         PM_SliderThickness,             // total slider thickness
00454         PM_SliderControlThickness,      // thickness of the business part
00455         PM_SliderLength,                // total length of slider
00456         PM_SliderTickmarkOffset,        //
00457         PM_SliderSpaceAvailable,        // available space for slider to move
00458 
00459         PM_DockWindowSeparatorExtent,
00460         PM_DockWindowHandleExtent,
00461         PM_DockWindowFrameWidth,
00462 
00463         PM_MenuBarFrameWidth,
00464 
00465         PM_TabBarTabOverlap,
00466         PM_TabBarTabHSpace,
00467         PM_TabBarTabVSpace,
00468         PM_TabBarBaseHeight,
00469         PM_TabBarBaseOverlap,
00470 
00471         PM_ProgressBarChunkWidth,
00472 
00473         PM_SplitterWidth,
00474         PM_TitleBarHeight,
00475 
00476         PM_IndicatorWidth,
00477         PM_IndicatorHeight,
00478         PM_ExclusiveIndicatorWidth,
00479         PM_ExclusiveIndicatorHeight,
00480         PM_PopupMenuScrollerHeight,
00481         PM_CheckListButtonSize,
00482         PM_CheckListControllerSize,
00483         PM_PopupMenuFrameHorizontalExtra,
00484         PM_PopupMenuFrameVerticalExtra,
00485 
00486         PM_DialogButtonsSeparator,
00487         PM_DialogButtonsButtonWidth,
00488         PM_DialogButtonsButtonHeight,
00489 
00490         PM_MDIFrameWidth,
00491         PM_MDIMinimizedWidth,
00492         PM_HeaderMargin,
00493         PM_HeaderMarkSize,
00494         PM_HeaderGripMargin,
00495         PM_TabBarTabShiftHorizontal,
00496         PM_TabBarTabShiftVertical,
00497         PM_TabBarScrollButtonWidth,
00498 
00499         PM_MenuBarItemSpacing,
00500         PM_ToolBarItemSpacing,
00501 
00502         // do not add any values below/greater than this
00503         PM_CustomBase =         0xf0000000
00504     };
00505 
00506     virtual int pixelMetric( PixelMetric metric,
00507                              const QWidget *widget = 0 ) const = 0;
00508 
00509 
00510     enum ContentsType {
00511         CT_PushButton,
00512         CT_CheckBox,
00513         CT_RadioButton,
00514         CT_ToolButton,
00515         CT_ComboBox,
00516         CT_Splitter,
00517         CT_DockWindow,
00518         CT_ProgressBar,
00519         CT_PopupMenuItem,
00520         CT_TabBarTab,
00521         CT_Slider,
00522         CT_Header,
00523         CT_LineEdit,
00524         CT_MenuBar,
00525         CT_SpinBox,
00526         CT_SizeGrip,
00527         CT_TabWidget,
00528         CT_DialogButtons,
00529 
00530         // do not add any values below/greater than this
00531         CT_CustomBase =         0xf0000000
00532     };
00533 
00534     virtual QSize sizeFromContents( ContentsType contents,
00535                                     const QWidget *widget,
00536                                     const QSize &contentsSize,
00537                                     const QStyleOption& = QStyleOption::Default ) const = 0;
00538 
00539     enum StyleHint  {
00540         // ...
00541         // the general hints
00542         // ...
00543         // disabled text should be etched, ala Windows
00544         SH_EtchDisabledText,
00545 
00546         // the GUI style enum, argh!
00547         SH_GUIStyle,
00548 
00549         // ...
00550         // widget specific hints
00551         // ...
00552         SH_ScrollBar_BackgroundMode,
00553         SH_ScrollBar_MiddleClickAbsolutePosition,
00554         SH_ScrollBar_ScrollWhenPointerLeavesControl,
00555 
00556         // QEvent::Type - which mouse event to select a tab
00557         SH_TabBar_SelectMouseType,
00558 
00559         SH_TabBar_Alignment,
00560 
00561         SH_Header_ArrowAlignment,
00562 
00563         // bool - sliders snap to values while moving, ala Windows
00564         SH_Slider_SnapToValue,
00565 
00566         // bool - key presses handled in a sloppy manner - ie. left on a vertical
00567         // slider subtracts a line
00568         SH_Slider_SloppyKeyEvents,
00569 
00570         // bool - center button on progress dialogs, ala Motif, else right aligned
00571         // perhaps this should be a Qt::Alignment value
00572         SH_ProgressDialog_CenterCancelButton,
00573 
00574         // Qt::AlignmentFlags - text label alignment in progress dialogs
00575         // Center on windows, Auto|VCenter otherwize
00576         SH_ProgressDialog_TextLabelAlignment,
00577 
00578         // bool - right align buttons on print dialog, ala Windows
00579         SH_PrintDialog_RightAlignButtons,
00580 
00581         // bool - 1 or 2 pixel space between the menubar and the dockarea, ala Windows
00582         // this *REALLY* needs a better name
00583         SH_MainWindow_SpaceBelowMenuBar,
00584 
00585         // bool - select the text in the line edit about the listbox when selecting
00586         // an item from the listbox, or when the line edit receives focus, ala Windows
00587         SH_FontDialog_SelectAssociatedText,
00588 
00589         // bool - allows disabled menu items to be active
00590         SH_PopupMenu_AllowActiveAndDisabled,
00591 
00592         // bool - pressing space activates item, ala Motif
00593         SH_PopupMenu_SpaceActivatesItem,
00594 
00595         // int - number of milliseconds to wait before opening a submenu
00596         // 256 on windows, 96 on motif
00597         SH_PopupMenu_SubMenuPopupDelay,
00598 
00599         // bool - should scrollviews draw their frame only around contents (ala Motif),
00600         // or around contents, scrollbars and corner widgets (ala Windows) ?
00601         SH_ScrollView_FrameOnlyAroundContents,
00602 
00603         // bool - menubars items are navigatable by pressing alt, followed by using
00604         // the arrow keys to select the desired item
00605         SH_MenuBar_AltKeyNavigation,
00606 
00607         // bool - mouse tracking in combobox dropdown lists
00608         SH_ComboBox_ListMouseTracking,
00609 
00610         // bool - mouse tracking in popupmenus
00611         SH_PopupMenu_MouseTracking,
00612 
00613         // bool - mouse tracking in menubars
00614         SH_MenuBar_MouseTracking,
00615 
00616         // bool - gray out selected items when loosing focus
00617         SH_ItemView_ChangeHighlightOnFocus,
00618 
00619         // bool - supports shared activation among modeless widgets
00620         SH_Widget_ShareActivation,
00621 
00622         // bool - workspace should just maximize the client area
00623         SH_Workspace_FillSpaceOnMaximize,
00624 
00625         // bool - supports popup menu comboboxes
00626         SH_ComboBox_Popup,
00627 
00628         // bool - titlebar has no border
00629         SH_TitleBar_NoBorder,
00630 
00631         // bool - stop scrollbar at mouse
00632         SH_ScrollBar_StopMouseOverSlider,
00633 
00634         //bool - blink cursort with selected text
00635         SH_BlinkCursorWhenTextSelected,
00636 
00637         //bool - richtext selections extend the full width of the docuemnt
00638         SH_RichText_FullWidthSelection,
00639 
00640         //bool - popupmenu supports scrolling instead of multicolumn mode
00641         SH_PopupMenu_Scrollable,
00642 
00643         // Qt::AlignmentFlags - text label vertical alignment in groupboxes
00644         // Center on windows, Auto|VCenter otherwize
00645         SH_GroupBox_TextLabelVerticalAlignment,
00646 
00647         // Qt::QRgb - text label color in groupboxes
00648         SH_GroupBox_TextLabelColor,
00649 
00650         // bool - popupmenu supports sloppy submenus
00651         SH_PopupMenu_SloppySubMenus,
00652 
00653         // Qt::QRgb - table grid color
00654         SH_Table_GridLineColor,
00655 
00656         // QChar - Unicode character for password char
00657         SH_LineEdit_PasswordCharacter,
00658 
00659         // QDialogButtons::Button - default button
00660         SH_DialogButtons_DefaultButton,
00661 
00662         // QToolBox - Boldness of the selected page title
00663         SH_ToolBox_SelectedPageTitleBold,
00664 
00665         //bool - if a tabbar prefers not to have scroller arrows
00666         SH_TabBar_PreferNoArrows,
00667 
00668         //bool - if left button should cause an absolute position
00669         SH_ScrollBar_LeftClickAbsolutePosition,
00670 
00671         // QEvent::Type - which mouse event to select a list view expansion
00672         SH_ListViewExpand_SelectMouseType,
00673 
00674         //bool - if underline for accelerators
00675         SH_UnderlineAccelerator,
00676 
00677         // bool - QToolButton - if tool buttons should use a 3D frame
00678         // when the mouse is over the button
00679         SH_ToolButton_Uses3D,
00680 
00681         // do not add any values below/greater than this
00682         SH_CustomBase =         0xf0000000
00683     };
00684 
00685     virtual int styleHint( StyleHint stylehint,
00686                            const QWidget *widget = 0,
00687                            const QStyleOption& = QStyleOption::Default,
00688                            QStyleHintReturn* returnData = 0
00689                            ) const = 0;
00690 
00691 
00692     enum StylePixmap {
00693         SP_TitleBarMinButton,
00694         SP_TitleBarMaxButton,
00695         SP_TitleBarCloseButton,
00696         SP_TitleBarNormalButton,
00697         SP_TitleBarShadeButton,
00698         SP_TitleBarUnshadeButton,
00699         SP_DockWindowCloseButton,
00700         SP_MessageBoxInformation,
00701         SP_MessageBoxWarning,
00702         SP_MessageBoxCritical,
00703         SP_MessageBoxQuestion,
00704 
00705         // do not add any values below/greater than this
00706         SP_CustomBase =         0xf0000000
00707     };
00708 
00709     virtual QPixmap stylePixmap( StylePixmap stylepixmap,
00710                                  const QWidget *widget = 0,
00711                                  const QStyleOption& = QStyleOption::Default ) const = 0;
00712 
00713 
00714     static QRect visualRect( const QRect &logical, const QWidget *w );
00715 
00716     static QRect visualRect( const QRect &logical, const QRect &bounding );
00717 
00718 
00719 
00720 
00721     // Old 2.x QStyle API
00722 
00723 #ifndef QT_NO_COMPAT
00724     int defaultFrameWidth() const
00725     {
00726         return pixelMetric( PM_DefaultFrameWidth );
00727     }
00728     void tabbarMetrics( const QWidget* t,
00729                         int& hf, int& vf, int& ov ) const
00730     {
00731         hf = pixelMetric( PM_TabBarTabHSpace, t );
00732         vf = pixelMetric( PM_TabBarTabVSpace, t );
00733         ov = pixelMetric( PM_TabBarBaseOverlap, t );
00734     }
00735     QSize scrollBarExtent() const
00736     {
00737         return QSize(pixelMetric(PM_ScrollBarExtent),
00738                      pixelMetric(PM_ScrollBarExtent));
00739     }
00740 #endif
00741 
00742 
00743 private:
00744     QStylePrivate * d;
00745 
00746 #if defined(Q_DISABLE_COPY)
00747     QStyle( const QStyle & );
00748     QStyle& operator=( const QStyle & );
00749 #endif
00750 };
00751 
00752 #endif // QT_NO_STYLE
00753 #endif // QSTYLE_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'