1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.widgets.style;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.flags;
19 import qt.core.namespace;
20 import qt.core.object;
21 import qt.core.point;
22 import qt.core.rect;
23 import qt.core.size;
24 import qt.core.string;
25 import qt.gui.fontmetrics;
26 import qt.gui.icon;
27 import qt.gui.painter;
28 import qt.gui.palette;
29 import qt.gui.pixmap;
30 import qt.helpers;
31 import qt.widgets.application;
32 import qt.widgets.sizepolicy;
33 import qt.widgets.styleoption;
34 import qt.widgets.widget;
35 
36 /+ class QAction;
37 class QDebug; +/
38 extern(C++, class) struct QTab;
39 /+ class QFontMetrics;
40 class QStyleHintReturn;
41 class QStyleOption;
42 class QStyleOptionComplex; +/
43 extern(C++, class) struct QStylePrivate;
44 
45 class /+ Q_WIDGETS_EXPORT +/ QStyle : QObject
46 {
47     mixin(Q_OBJECT);
48     /+ Q_DECLARE_PRIVATE(QStyle) +/
49 
50 protected:
51     this(ref QStylePrivate dd);
52 
53 public:
54     this();
55     /+ virtual +/~this();
56 
57     /+ virtual +/ void polish(QWidget widget);
58     /+ virtual +/ void unpolish(QWidget widget);
59 
60     /+ virtual +/ void polish(QApplication application);
61     /+ virtual +/ void unpolish(QApplication application);
62 
63     /+ virtual +/ void polish(ref QPalette palette);
64 
65     /+ virtual +/ QRect itemTextRect(ref const(QFontMetrics) fm, ref const(QRect) r,
66                                int flags, bool enabled,
67                                ref const(QString) text) const;
68 
69     /+ virtual +/ QRect itemPixmapRect(ref const(QRect) r, int flags, ref const(QPixmap) pixmap) const;
70 
71     /+ virtual +/ void drawItemText(QPainter* painter, ref const(QRect) rect,
72                                   int flags, ref const(QPalette) pal, bool enabled,
73                                   ref const(QString) text, QPalette.ColorRole textRole = QPalette.ColorRole.NoRole) const;
74 
75     /+ virtual +/ void drawItemPixmap(QPainter* painter, ref const(QRect) rect,
76                                     int alignment, ref const(QPixmap) pixmap) const;
77 
78     /+ virtual +/ QPalette standardPalette() const;
79 
80     mixin("enum StateFlag {"
81         ~ q{
82             State_None =                0x00000000,
83             State_Enabled =             0x00000001,
84             State_Raised =              0x00000002,
85             State_Sunken =              0x00000004,
86             State_Off =                 0x00000008,
87             State_NoChange =            0x00000010,
88             State_On =                  0x00000020,
89             State_DownArrow =           0x00000040,
90             State_Horizontal =          0x00000080,
91             State_HasFocus =            0x00000100,
92             State_Top =                 0x00000200,
93             State_Bottom =              0x00000400,
94             State_FocusAtBorder =       0x00000800,
95             State_AutoRaise =           0x00001000,
96             State_MouseOver =           0x00002000,
97             State_UpArrow =             0x00004000,
98             State_Selected =            0x00008000,
99             State_Active =              0x00010000,
100             State_Window =              0x00020000,
101             State_Open =                0x00040000,
102             State_Children =            0x00080000,
103             State_Item =                0x00100000,
104             State_Sibling =             0x00200000,
105             State_Editing =             0x00400000,
106             State_KeyboardFocusChange = 0x00800000,
107         }
108         ~ (versionIsSet!("QT_KEYPAD_NAVIGATION") ? q{
109     /+ #ifdef QT_KEYPAD_NAVIGATION +/
110             State_HasEditFocus =        0x01000000,
111         }:"")
112         ~ q{
113     /+ #endif +/
114             State_ReadOnly =            0x02000000,
115             State_Small =               0x04000000,
116             State_Mini =                0x08000000
117         }
118         ~ "}"
119     );
120     /+ Q_ENUM(StateFlag) +/
121     /+ Q_DECLARE_FLAGS(State, StateFlag) +/
122 alias State = QFlags!(StateFlag);
123 
124     enum PrimitiveElement {
125         PE_Frame,
126         PE_FrameDefaultButton,
127         PE_FrameDockWidget,
128         PE_FrameFocusRect,
129         PE_FrameGroupBox,
130         PE_FrameLineEdit,
131         PE_FrameMenu,
132         PE_FrameStatusBarItem,
133 /+ #if QT_DEPRECATED_SINCE(5, 13) +/ // ### Qt 6: remove
134         PE_FrameStatusBar /+ Q_DECL_ENUMERATOR_DEPRECATED +/ = PrimitiveElement.PE_FrameStatusBarItem,
135 /+ #endif +/
136         PE_FrameTabWidget,
137         PE_FrameWindow,
138         PE_FrameButtonBevel,
139         PE_FrameButtonTool,
140         PE_FrameTabBarBase,
141 
142         PE_PanelButtonCommand,
143         PE_PanelButtonBevel,
144         PE_PanelButtonTool,
145         PE_PanelMenuBar,
146         PE_PanelToolBar,
147         PE_PanelLineEdit,
148 
149         PE_IndicatorArrowDown,
150         PE_IndicatorArrowLeft,
151         PE_IndicatorArrowRight,
152         PE_IndicatorArrowUp,
153         PE_IndicatorBranch,
154         PE_IndicatorButtonDropDown,
155         PE_IndicatorItemViewItemCheck,
156 /+ #if QT_DEPRECATED_SINCE(5, 13) +/ // ### Qt 6: remove
157         PE_IndicatorViewItemCheck /+ Q_DECL_ENUMERATOR_DEPRECATED +/ = PrimitiveElement.PE_IndicatorItemViewItemCheck,
158 /+ #endif +/
159         PE_IndicatorCheckBox,
160         PE_IndicatorDockWidgetResizeHandle,
161         PE_IndicatorHeaderArrow,
162         PE_IndicatorMenuCheckMark,
163         PE_IndicatorProgressChunk,
164         PE_IndicatorRadioButton,
165         PE_IndicatorSpinDown,
166         PE_IndicatorSpinMinus,
167         PE_IndicatorSpinPlus,
168         PE_IndicatorSpinUp,
169         PE_IndicatorToolBarHandle,
170         PE_IndicatorToolBarSeparator,
171         PE_PanelTipLabel,
172         PE_IndicatorTabTear,
173         PE_IndicatorTabTearLeft = PrimitiveElement.PE_IndicatorTabTear,
174         PE_PanelScrollAreaCorner,
175 
176         PE_Widget,
177 
178         PE_IndicatorColumnViewArrow,
179         PE_IndicatorItemViewItemDrop,
180 
181         PE_PanelItemViewItem,
182         PE_PanelItemViewRow,
183 
184         PE_PanelStatusBar,
185 
186         PE_IndicatorTabClose,
187         PE_PanelMenu,
188 
189         PE_IndicatorTabTearRight,
190 
191         // do not add any values below/greater this
192         PE_CustomBase = 0xf000000
193     }
194     /+ Q_ENUM(PrimitiveElement) +/
195 
196     /+ virtual +/ abstract void drawPrimitive(PrimitiveElement pe, const(QStyleOption)* opt, QPainter* p,
197                                    const(QWidget) w = null) const;
198     enum ControlElement {
199         CE_PushButton,
200         CE_PushButtonBevel,
201         CE_PushButtonLabel,
202 
203         CE_CheckBox,
204         CE_CheckBoxLabel,
205 
206         CE_RadioButton,
207         CE_RadioButtonLabel,
208 
209         CE_TabBarTab,
210         CE_TabBarTabShape,
211         CE_TabBarTabLabel,
212 
213         CE_ProgressBar,
214         CE_ProgressBarGroove,
215         CE_ProgressBarContents,
216         CE_ProgressBarLabel,
217 
218         CE_MenuItem,
219         CE_MenuScroller,
220         CE_MenuVMargin,
221         CE_MenuHMargin,
222         CE_MenuTearoff,
223         CE_MenuEmptyArea,
224 
225         CE_MenuBarItem,
226         CE_MenuBarEmptyArea,
227 
228         CE_ToolButtonLabel,
229 
230         CE_Header,
231         CE_HeaderSection,
232         CE_HeaderLabel,
233 
234         CE_ToolBoxTab,
235         CE_SizeGrip,
236         CE_Splitter,
237         CE_RubberBand,
238         CE_DockWidgetTitle,
239 
240         CE_ScrollBarAddLine,
241         CE_ScrollBarSubLine,
242         CE_ScrollBarAddPage,
243         CE_ScrollBarSubPage,
244         CE_ScrollBarSlider,
245         CE_ScrollBarFirst,
246         CE_ScrollBarLast,
247 
248         CE_FocusFrame,
249         CE_ComboBoxLabel,
250 
251         CE_ToolBar,
252         CE_ToolBoxTabShape,
253         CE_ToolBoxTabLabel,
254         CE_HeaderEmptyArea,
255 
256         CE_ColumnViewGrip,
257 
258         CE_ItemViewItem,
259 
260         CE_ShapedFrame,
261 
262         // do not add any values below/greater than this
263         CE_CustomBase = 0xf0000000
264     }
265     /+ Q_ENUM(ControlElement) +/
266 
267     /+ virtual +/ abstract void drawControl(ControlElement element, const(QStyleOption)* opt, QPainter* p,
268                                  const(QWidget) w = null) const;
269 
270     enum SubElement {
271         SE_PushButtonContents,
272         SE_PushButtonFocusRect,
273 
274         SE_CheckBoxIndicator,
275         SE_CheckBoxContents,
276         SE_CheckBoxFocusRect,
277         SE_CheckBoxClickRect,
278 
279         SE_RadioButtonIndicator,
280         SE_RadioButtonContents,
281         SE_RadioButtonFocusRect,
282         SE_RadioButtonClickRect,
283 
284         SE_ComboBoxFocusRect,
285 
286         SE_SliderFocusRect,
287 
288         SE_ProgressBarGroove,
289         SE_ProgressBarContents,
290         SE_ProgressBarLabel,
291 
292         SE_ToolBoxTabContents,
293 
294         SE_HeaderLabel,
295         SE_HeaderArrow,
296 
297         SE_TabWidgetTabBar,
298         SE_TabWidgetTabPane,
299         SE_TabWidgetTabContents,
300         SE_TabWidgetLeftCorner,
301         SE_TabWidgetRightCorner,
302 
303         SE_ItemViewItemCheckIndicator,
304 /+ #if QT_DEPRECATED_SINCE(5, 13) +/ // ### Qt 6: remove
305         SE_ViewItemCheckIndicator /+ Q_DECL_ENUMERATOR_DEPRECATED +/ = SubElement.SE_ItemViewItemCheckIndicator,
306 /+ #endif +/
307         SE_TabBarTearIndicator,
308         SE_TabBarTearIndicatorLeft = SubElement.SE_TabBarTearIndicator,
309 
310         SE_TreeViewDisclosureItem,
311 
312         SE_LineEditContents,
313         SE_FrameContents,
314 
315         SE_DockWidgetCloseButton,
316         SE_DockWidgetFloatButton,
317         SE_DockWidgetTitleBarText,
318         SE_DockWidgetIcon,
319 
320         SE_CheckBoxLayoutItem,
321         SE_ComboBoxLayoutItem,
322         SE_DateTimeEditLayoutItem,
323 /+ #if QT_DEPRECATED_SINCE(5, 15) +/ // ### Qt 6: remove
324         SE_DialogButtonBoxLayoutItem /+ Q_DECL_ENUMERATOR_DEPRECATED +/,
325 /+ #endif +/
326         SE_LabelLayoutItem = SubElement.SE_DateTimeEditLayoutItem + 2,
327         SE_ProgressBarLayoutItem,
328         SE_PushButtonLayoutItem,
329         SE_RadioButtonLayoutItem,
330         SE_SliderLayoutItem,
331         SE_SpinBoxLayoutItem,
332         SE_ToolButtonLayoutItem,
333 
334         SE_FrameLayoutItem,
335         SE_GroupBoxLayoutItem,
336         SE_TabWidgetLayoutItem,
337 
338         SE_ItemViewItemDecoration,
339         SE_ItemViewItemText,
340         SE_ItemViewItemFocusRect,
341 
342         SE_TabBarTabLeftButton,
343         SE_TabBarTabRightButton,
344         SE_TabBarTabText,
345 
346         SE_ShapedFrameContents,
347 
348         SE_ToolBarHandle,
349 
350         SE_TabBarScrollLeftButton,
351         SE_TabBarScrollRightButton,
352         SE_TabBarTearIndicatorRight,
353 
354         SE_PushButtonBevel,
355 
356         // do not add any values below/greater than this
357         SE_CustomBase = 0xf0000000
358     }
359     /+ Q_ENUM(SubElement) +/
360 
361     /+ virtual +/ abstract QRect subElementRect(SubElement subElement, const(QStyleOption)* option,
362                                      const(QWidget) widget = null) const;
363 
364 
365     enum ComplexControl {
366         CC_SpinBox,
367         CC_ComboBox,
368         CC_ScrollBar,
369         CC_Slider,
370         CC_ToolButton,
371         CC_TitleBar,
372         CC_Dial,
373         CC_GroupBox,
374         CC_MdiControls,
375 
376         // do not add any values below/greater than this
377         CC_CustomBase = 0xf0000000
378     }
379     /+ Q_ENUM(ComplexControl) +/
380 
381     enum SubControl {
382         SC_None =                  0x00000000,
383 
384         SC_ScrollBarAddLine =      0x00000001,
385         SC_ScrollBarSubLine =      0x00000002,
386         SC_ScrollBarAddPage =      0x00000004,
387         SC_ScrollBarSubPage =      0x00000008,
388         SC_ScrollBarFirst =        0x00000010,
389         SC_ScrollBarLast =         0x00000020,
390         SC_ScrollBarSlider =       0x00000040,
391         SC_ScrollBarGroove =       0x00000080,
392 
393         SC_SpinBoxUp =             0x00000001,
394         SC_SpinBoxDown =           0x00000002,
395         SC_SpinBoxFrame =          0x00000004,
396         SC_SpinBoxEditField =      0x00000008,
397 
398         SC_ComboBoxFrame =         0x00000001,
399         SC_ComboBoxEditField =     0x00000002,
400         SC_ComboBoxArrow =         0x00000004,
401         SC_ComboBoxListBoxPopup =  0x00000008,
402 
403         SC_SliderGroove =          0x00000001,
404         SC_SliderHandle =          0x00000002,
405         SC_SliderTickmarks =       0x00000004,
406 
407         SC_ToolButton =            0x00000001,
408         SC_ToolButtonMenu =        0x00000002,
409 
410         SC_TitleBarSysMenu =       0x00000001,
411         SC_TitleBarMinButton =     0x00000002,
412         SC_TitleBarMaxButton =     0x00000004,
413         SC_TitleBarCloseButton =   0x00000008,
414         SC_TitleBarNormalButton =  0x00000010,
415         SC_TitleBarShadeButton =   0x00000020,
416         SC_TitleBarUnshadeButton = 0x00000040,
417         SC_TitleBarContextHelpButton = 0x00000080,
418         SC_TitleBarLabel =         0x00000100,
419 
420         SC_DialGroove =            0x00000001,
421         SC_DialHandle =            0x00000002,
422         SC_DialTickmarks =         0x00000004,
423 
424         SC_GroupBoxCheckBox =      0x00000001,
425         SC_GroupBoxLabel =         0x00000002,
426         SC_GroupBoxContents =      0x00000004,
427         SC_GroupBoxFrame =         0x00000008,
428 
429         SC_MdiMinButton     =      0x00000001,
430         SC_MdiNormalButton  =      0x00000002,
431         SC_MdiCloseButton   =      0x00000004,
432 
433         SC_CustomBase =            0xf0000000,
434         SC_All =                   0xffffffff
435     }
436     /+ Q_ENUM(SubControl) +/
437     /+ Q_DECLARE_FLAGS(SubControls, SubControl) +/
438 alias SubControls = QFlags!(SubControl);
439 
440     /+ virtual +/ abstract void drawComplexControl(ComplexControl cc, const(QStyleOptionComplex)* opt, QPainter* p,
441                                         const(QWidget) widget = null) const;
442     /+ virtual +/ abstract SubControl hitTestComplexControl(ComplexControl cc, const(QStyleOptionComplex)* opt,
443                                                  ref const(QPoint) pt, const(QWidget) widget = null) const;
444     /+ virtual +/ abstract QRect subControlRect(ComplexControl cc, const(QStyleOptionComplex)* opt,
445                                      SubControl sc, const(QWidget) widget = null) const;
446 
447     enum PixelMetric {
448         PM_ButtonMargin,
449         PM_ButtonDefaultIndicator,
450         PM_MenuButtonIndicator,
451         PM_ButtonShiftHorizontal,
452         PM_ButtonShiftVertical,
453 
454         PM_DefaultFrameWidth,
455         PM_SpinBoxFrameWidth,
456         PM_ComboBoxFrameWidth,
457 
458         PM_MaximumDragDistance,
459 
460         PM_ScrollBarExtent,
461         PM_ScrollBarSliderMin,
462 
463         PM_SliderThickness,             // total slider thickness
464         PM_SliderControlThickness,      // thickness of the business part
465         PM_SliderLength,                // total length of slider
466         PM_SliderTickmarkOffset,        //
467         PM_SliderSpaceAvailable,        // available space for slider to move
468 
469         PM_DockWidgetSeparatorExtent,
470         PM_DockWidgetHandleExtent,
471         PM_DockWidgetFrameWidth,
472 
473         PM_TabBarTabOverlap,
474         PM_TabBarTabHSpace,
475         PM_TabBarTabVSpace,
476         PM_TabBarBaseHeight,
477         PM_TabBarBaseOverlap,
478 
479         PM_ProgressBarChunkWidth,
480 
481         PM_SplitterWidth,
482         PM_TitleBarHeight,
483 
484         PM_MenuScrollerHeight,
485         PM_MenuHMargin,
486         PM_MenuVMargin,
487         PM_MenuPanelWidth,
488         PM_MenuTearoffHeight,
489         PM_MenuDesktopFrameWidth,
490 
491         PM_MenuBarPanelWidth,
492         PM_MenuBarItemSpacing,
493         PM_MenuBarVMargin,
494         PM_MenuBarHMargin,
495 
496         PM_IndicatorWidth,
497         PM_IndicatorHeight,
498         PM_ExclusiveIndicatorWidth,
499         PM_ExclusiveIndicatorHeight,
500 
501         PM_DialogButtonsSeparator,
502         PM_DialogButtonsButtonWidth,
503         PM_DialogButtonsButtonHeight,
504 
505         PM_MdiSubWindowFrameWidth,
506         PM_MdiSubWindowMinimizedWidth,
507 /+ #if QT_DEPRECATED_SINCE(5, 13) +/ // ### Qt 6: remove
508         PM_MDIFrameWidth /+ Q_DECL_ENUMERATOR_DEPRECATED +/ = PixelMetric.PM_MdiSubWindowFrameWidth,
509         PM_MDIMinimizedWidth /+ Q_DECL_ENUMERATOR_DEPRECATED +/ = PixelMetric.PM_MdiSubWindowMinimizedWidth,
510 /+ #endif +/
511 
512         PM_HeaderMargin,
513         PM_HeaderMarkSize,
514         PM_HeaderGripMargin,
515         PM_TabBarTabShiftHorizontal,
516         PM_TabBarTabShiftVertical,
517         PM_TabBarScrollButtonWidth,
518 
519         PM_ToolBarFrameWidth,
520         PM_ToolBarHandleExtent,
521         PM_ToolBarItemSpacing,
522         PM_ToolBarItemMargin,
523         PM_ToolBarSeparatorExtent,
524         PM_ToolBarExtensionExtent,
525 
526         PM_SpinBoxSliderHeight,
527 
528 /+ #if QT_DEPRECATED_SINCE(5, 15) +/ // ### Qt 6: remove
529         PM_DefaultTopLevelMargin /+ Q_DECL_ENUMERATOR_DEPRECATED +/,
530         PM_DefaultChildMargin /+ Q_DECL_ENUMERATOR_DEPRECATED +/,
531         PM_DefaultLayoutSpacing /+ Q_DECL_ENUMERATOR_DEPRECATED +/,
532 /+ #endif +/
533 
534         PM_ToolBarIconSize = PixelMetric.PM_SpinBoxSliderHeight + 4,
535         PM_ListViewIconSize,
536         PM_IconViewIconSize,
537         PM_SmallIconSize,
538         PM_LargeIconSize,
539 
540         PM_FocusFrameVMargin,
541         PM_FocusFrameHMargin,
542 
543         PM_ToolTipLabelFrameWidth,
544         PM_CheckBoxLabelSpacing,
545         PM_TabBarIconSize,
546         PM_SizeGripSize,
547         PM_DockWidgetTitleMargin,
548         PM_MessageBoxIconSize,
549         PM_ButtonIconSize,
550 
551         PM_DockWidgetTitleBarButtonMargin,
552 
553         PM_RadioButtonLabelSpacing,
554         PM_LayoutLeftMargin,
555         PM_LayoutTopMargin,
556         PM_LayoutRightMargin,
557         PM_LayoutBottomMargin,
558         PM_LayoutHorizontalSpacing,
559         PM_LayoutVerticalSpacing,
560         PM_TabBar_ScrollButtonOverlap,
561 
562         PM_TextCursorWidth,
563 
564         PM_TabCloseIndicatorWidth,
565         PM_TabCloseIndicatorHeight,
566 
567         PM_ScrollView_ScrollBarSpacing,
568         PM_ScrollView_ScrollBarOverlap,
569         PM_SubMenuOverlap,
570         PM_TreeViewIndentation,
571 
572         PM_HeaderDefaultSectionSizeHorizontal,
573         PM_HeaderDefaultSectionSizeVertical,
574 
575         PM_TitleBarButtonIconSize,
576         PM_TitleBarButtonSize,
577 
578         // do not add any values below/greater than this
579         PM_CustomBase = 0xf0000000
580     }
581     /+ Q_ENUM(PixelMetric) +/
582 
583     /+ virtual +/ abstract int pixelMetric(PixelMetric metric, const(QStyleOption)* option = null,
584                                 const(QWidget) widget = null) const;
585 
586     enum ContentsType {
587         CT_PushButton,
588         CT_CheckBox,
589         CT_RadioButton,
590         CT_ToolButton,
591         CT_ComboBox,
592         CT_Splitter,
593         CT_ProgressBar,
594         CT_MenuItem,
595         CT_MenuBarItem,
596         CT_MenuBar,
597         CT_Menu,
598         CT_TabBarTab,
599         CT_Slider,
600         CT_ScrollBar,
601         CT_LineEdit,
602         CT_SpinBox,
603         CT_SizeGrip,
604         CT_TabWidget,
605         CT_DialogButtons,
606         CT_HeaderSection,
607         CT_GroupBox,
608         CT_MdiControls,
609         CT_ItemViewItem,
610         // do not add any values below/greater than this
611         CT_CustomBase = 0xf0000000
612     }
613     /+ Q_ENUM(ContentsType) +/
614 
615     /+ virtual +/ abstract QSize sizeFromContents(ContentsType ct, const(QStyleOption)* opt,
616                                        ref const(QSize) contentsSize, const(QWidget) w = null) const;
617 
618     enum RequestSoftwareInputPanel {
619         RSIP_OnMouseClickAndAlreadyFocused,
620         RSIP_OnMouseClick
621     }
622     /+ Q_ENUM(RequestSoftwareInputPanel) +/
623 
624     enum StyleHint {
625         SH_EtchDisabledText,
626         SH_DitherDisabledText,
627         SH_ScrollBar_MiddleClickAbsolutePosition,
628         SH_ScrollBar_ScrollWhenPointerLeavesControl,
629         SH_TabBar_SelectMouseType,
630         SH_TabBar_Alignment,
631         SH_Header_ArrowAlignment,
632         SH_Slider_SnapToValue,
633         SH_Slider_SloppyKeyEvents,
634         SH_ProgressDialog_CenterCancelButton,
635         SH_ProgressDialog_TextLabelAlignment,
636         SH_PrintDialog_RightAlignButtons,
637         SH_MainWindow_SpaceBelowMenuBar,
638         SH_FontDialog_SelectAssociatedText,
639         SH_Menu_AllowActiveAndDisabled,
640         SH_Menu_SpaceActivatesItem,
641         SH_Menu_SubMenuPopupDelay,
642         SH_ScrollView_FrameOnlyAroundContents,
643         SH_MenuBar_AltKeyNavigation,
644         SH_ComboBox_ListMouseTracking,
645         SH_Menu_MouseTracking,
646         SH_MenuBar_MouseTracking,
647         SH_ItemView_ChangeHighlightOnFocus,
648         SH_Widget_ShareActivation,
649         SH_Workspace_FillSpaceOnMaximize,
650         SH_ComboBox_Popup,
651         SH_TitleBar_NoBorder,
652         SH_Slider_StopMouseOverSlider,
653 /+ #if QT_DEPRECATED_SINCE(5, 13) +/ // ### Qt 6: remove
654         SH_ScrollBar_StopMouseOverSlider /+ Q_DECL_ENUMERATOR_DEPRECATED +/ = StyleHint.SH_Slider_StopMouseOverSlider,
655 /+ #endif +/
656         SH_BlinkCursorWhenTextSelected,
657         SH_RichText_FullWidthSelection,
658         SH_Menu_Scrollable,
659         SH_GroupBox_TextLabelVerticalAlignment,
660         SH_GroupBox_TextLabelColor,
661         SH_Menu_SloppySubMenus,
662         SH_Table_GridLineColor,
663         SH_LineEdit_PasswordCharacter,
664         SH_DialogButtons_DefaultButton,
665         SH_ToolBox_SelectedPageTitleBold,
666         SH_TabBar_PreferNoArrows,
667         SH_ScrollBar_LeftClickAbsolutePosition,
668         SH_ListViewExpand_SelectMouseType,
669         SH_UnderlineShortcut,
670         SH_SpinBox_AnimateButton,
671         SH_SpinBox_KeyPressAutoRepeatRate,
672         SH_SpinBox_ClickAutoRepeatRate,
673         SH_Menu_FillScreenWithScroll,
674         SH_ToolTipLabel_Opacity,
675         SH_DrawMenuBarSeparator,
676         SH_TitleBar_ModifyNotification,
677         SH_Button_FocusPolicy,
678         SH_MessageBox_UseBorderForButtonSpacing,
679         SH_TitleBar_AutoRaise,
680         SH_ToolButton_PopupDelay,
681         SH_FocusFrame_Mask,
682         SH_RubberBand_Mask,
683         SH_WindowFrame_Mask,
684         SH_SpinControls_DisableOnBounds,
685         SH_Dial_BackgroundRole,
686         SH_ComboBox_LayoutDirection,
687         SH_ItemView_EllipsisLocation,
688         SH_ItemView_ShowDecorationSelected,
689         SH_ItemView_ActivateItemOnSingleClick,
690         SH_ScrollBar_ContextMenu,
691         SH_ScrollBar_RollBetweenButtons,
692         SH_Slider_AbsoluteSetButtons,
693         SH_Slider_PageSetButtons,
694         SH_Menu_KeyboardSearch,
695         SH_TabBar_ElideMode,
696         SH_DialogButtonLayout,
697         SH_ComboBox_PopupFrameStyle,
698         SH_MessageBox_TextInteractionFlags,
699         SH_DialogButtonBox_ButtonsHaveIcons,
700         SH_SpellCheckUnderlineStyle,
701         SH_MessageBox_CenterButtons,
702         SH_Menu_SelectionWrap,
703         SH_ItemView_MovementWithoutUpdatingSelection,
704         SH_ToolTip_Mask,
705         SH_FocusFrame_AboveWidget,
706         SH_TextControl_FocusIndicatorTextCharFormat,
707         SH_WizardStyle,
708         SH_ItemView_ArrowKeysNavigateIntoChildren,
709         SH_Menu_Mask,
710         SH_Menu_FlashTriggeredItem,
711         SH_Menu_FadeOutOnHide,
712         SH_SpinBox_ClickAutoRepeatThreshold,
713         SH_ItemView_PaintAlternatingRowColorsForEmptyArea,
714         SH_FormLayoutWrapPolicy,
715         SH_TabWidget_DefaultTabPosition,
716         SH_ToolBar_Movable,
717         SH_FormLayoutFieldGrowthPolicy,
718         SH_FormLayoutFormAlignment,
719         SH_FormLayoutLabelAlignment,
720         SH_ItemView_DrawDelegateFrame,
721         SH_TabBar_CloseButtonPosition,
722         SH_DockWidget_ButtonsHaveFrame,
723         SH_ToolButtonStyle,
724         SH_RequestSoftwareInputPanel,
725         SH_ScrollBar_Transient,
726         SH_Menu_SupportsSections,
727         SH_ToolTip_WakeUpDelay,
728         SH_ToolTip_FallAsleepDelay,
729         SH_Widget_Animate,
730         SH_Splitter_OpaqueResize,
731         // Whether we should use a native popup.
732         // Only supported for non-editable combo boxes on Mac OS X so far.
733         SH_ComboBox_UseNativePopup,
734         SH_LineEdit_PasswordMaskDelay,
735         SH_TabBar_ChangeCurrentDelay,
736         SH_Menu_SubMenuUniDirection,
737         SH_Menu_SubMenuUniDirectionFailCount,
738         SH_Menu_SubMenuSloppySelectOtherActions,
739         SH_Menu_SubMenuSloppyCloseTimeout,
740         SH_Menu_SubMenuResetWhenReenteringParent,
741         SH_Menu_SubMenuDontStartSloppyOnLeave,
742         SH_ItemView_ScrollMode,
743         SH_TitleBar_ShowToolTipsOnButtons,
744         SH_Widget_Animation_Duration,
745         SH_ComboBox_AllowWheelScrolling,
746         SH_SpinBox_ButtonsInsideFrame,
747         SH_SpinBox_StepModifier,
748         // Add new style hint values here
749 
750         SH_CustomBase = 0xf0000000
751     }
752     /+ Q_ENUM(StyleHint) +/
753 
754     /+ virtual +/ abstract int styleHint(StyleHint stylehint, const(QStyleOption)* opt = null,
755                               const(QWidget) widget = null, QStyleHintReturn* returnData = null) const;
756 
757     enum StandardPixmap {
758         SP_TitleBarMenuButton,
759         SP_TitleBarMinButton,
760         SP_TitleBarMaxButton,
761         SP_TitleBarCloseButton,
762         SP_TitleBarNormalButton,
763         SP_TitleBarShadeButton,
764         SP_TitleBarUnshadeButton,
765         SP_TitleBarContextHelpButton,
766         SP_DockWidgetCloseButton,
767         SP_MessageBoxInformation,
768         SP_MessageBoxWarning,
769         SP_MessageBoxCritical,
770         SP_MessageBoxQuestion,
771         SP_DesktopIcon,
772         SP_TrashIcon,
773         SP_ComputerIcon,
774         SP_DriveFDIcon,
775         SP_DriveHDIcon,
776         SP_DriveCDIcon,
777         SP_DriveDVDIcon,
778         SP_DriveNetIcon,
779         SP_DirOpenIcon,
780         SP_DirClosedIcon,
781         SP_DirLinkIcon,
782         SP_DirLinkOpenIcon,
783         SP_FileIcon,
784         SP_FileLinkIcon,
785         SP_ToolBarHorizontalExtensionButton,
786         SP_ToolBarVerticalExtensionButton,
787         SP_FileDialogStart,
788         SP_FileDialogEnd,
789         SP_FileDialogToParent,
790         SP_FileDialogNewFolder,
791         SP_FileDialogDetailedView,
792         SP_FileDialogInfoView,
793         SP_FileDialogContentsView,
794         SP_FileDialogListView,
795         SP_FileDialogBack,
796         SP_DirIcon,
797         SP_DialogOkButton,
798         SP_DialogCancelButton,
799         SP_DialogHelpButton,
800         SP_DialogOpenButton,
801         SP_DialogSaveButton,
802         SP_DialogCloseButton,
803         SP_DialogApplyButton,
804         SP_DialogResetButton,
805         SP_DialogDiscardButton,
806         SP_DialogYesButton,
807         SP_DialogNoButton,
808         SP_ArrowUp,
809         SP_ArrowDown,
810         SP_ArrowLeft,
811         SP_ArrowRight,
812         SP_ArrowBack,
813         SP_ArrowForward,
814         SP_DirHomeIcon,
815         SP_CommandLink,
816         SP_VistaShield,
817         SP_BrowserReload,
818         SP_BrowserStop,
819         SP_MediaPlay,
820         SP_MediaStop,
821         SP_MediaPause,
822         SP_MediaSkipForward,
823         SP_MediaSkipBackward,
824         SP_MediaSeekForward,
825         SP_MediaSeekBackward,
826         SP_MediaVolume,
827         SP_MediaVolumeMuted,
828         SP_LineEditClearButton,
829         SP_DialogYesToAllButton,
830         SP_DialogNoToAllButton,
831         SP_DialogSaveAllButton,
832         SP_DialogAbortButton,
833         SP_DialogRetryButton,
834         SP_DialogIgnoreButton,
835         SP_RestoreDefaultsButton,
836         // do not add any values below/greater than this
837         SP_CustomBase = 0xf0000000
838     }
839     /+ Q_ENUM(StandardPixmap) +/
840 
841     /+ virtual +/ abstract QPixmap standardPixmap(StandardPixmap standardPixmap, const(QStyleOption)* opt = null,
842                                        const(QWidget) widget = null) const;
843 
844     /+ virtual +/ abstract QIcon standardIcon(StandardPixmap standardIcon, const(QStyleOption)* option = null,
845                                    const(QWidget) widget = null) const;
846 
847     /+ virtual +/ abstract QPixmap generatedIconPixmap(QIcon.Mode iconMode, ref const(QPixmap) pixmap,
848                                             const(QStyleOption)* opt) const;
849 
850     static QRect visualRect(/+ Qt:: +/qt.core.namespace.LayoutDirection direction, ref const(QRect) boundingRect,
851                                 ref const(QRect) logicalRect);
852     static QPoint visualPos(/+ Qt:: +/qt.core.namespace.LayoutDirection direction, ref const(QRect) boundingRect,
853                                 ref const(QPoint) logicalPos);
854     static int sliderPositionFromValue(int min, int max, int val, int space,
855                                            bool upsideDown = false);
856     static int sliderValueFromPosition(int min, int max, int pos, int space,
857                                            bool upsideDown = false);
858     static /+ Qt:: +/qt.core.namespace.Alignment visualAlignment(/+ Qt:: +/qt.core.namespace.LayoutDirection direction, /+ Qt:: +/qt.core.namespace.Alignment alignment);
859     static QRect alignedRect(/+ Qt:: +/qt.core.namespace.LayoutDirection direction, /+ Qt:: +/qt.core.namespace.Alignment alignment,
860                                  ref const(QSize) size, ref const(QRect) rectangle);
861 
862     /+ virtual +/ abstract int layoutSpacing(QSizePolicy.ControlType control1,
863                                   QSizePolicy.ControlType control2, /+ Qt:: +/qt.core.namespace.Orientation orientation,
864                                   const(QStyleOption)* option = null, const(QWidget) widget = null) const;
865     final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1,
866                                   QSizePolicy.ControlTypes controls2, /+ Qt:: +/qt.core.namespace.Orientation orientation,
867                                   QStyleOption* option = null, QWidget widget = null) const;
868 
869     final const(QStyle)  proxy() const;
870 
871 private:
872     /+ Q_DISABLE_COPY(QStyle) +/
873     /+ friend class QWidget; +/
874     /+ friend class QWidgetPrivate; +/
875     /+ friend class QApplication; +/
876     /+ friend class QProxyStyle; +/
877     /+ friend class QProxyStylePrivate; +/
878     final void setProxy(QStyle style);
879 }
880 /+pragma(inline, true) QFlags!(QStyle.State.enum_type) operator |(QStyle.State.enum_type f1, QStyle.State.enum_type f2)/+noexcept+/{return QFlags!(QStyle.State.enum_type)(f1)|f2;}+/
881 /+pragma(inline, true) QFlags!(QStyle.State.enum_type) operator |(QStyle.State.enum_type f1, QFlags!(QStyle.State.enum_type) f2)/+noexcept+/{return f2|f1;}+/
882 /+pragma(inline, true) QIncompatibleFlag operator |(QStyle.State.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
883 
884 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::State) +/
885 /+pragma(inline, true) QFlags!(QStyle.SubControls.enum_type) operator |(QStyle.SubControls.enum_type f1, QStyle.SubControls.enum_type f2)/+noexcept+/{return QFlags!(QStyle.SubControls.enum_type)(f1)|f2;}+/
886 /+pragma(inline, true) QFlags!(QStyle.SubControls.enum_type) operator |(QStyle.SubControls.enum_type f1, QFlags!(QStyle.SubControls.enum_type) f2)/+noexcept+/{return f2|f1;}+/
887 /+pragma(inline, true) QIncompatibleFlag operator |(QStyle.SubControls.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
888 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::SubControls)
889 #if !defined(QT_NO_DEBUG_STREAM)
890 // ### Qt 6: Remove in favor of template<class T> QDebug operator<<(QDebug, const QFlags<T> &).
891 #  if QT_VERSION < QT_VERSION_CHECK(6,0,0)
892 Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, QStyle::State state);
893 #  endif
894 #endif +/
895