File indexing completed on 2024-05-12 17:06:19

0001 #ifndef oxygen_h
0002 #define oxygen_h
0003 /*
0004     SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #include <QFlags>
0009 #include <QPointer>
0010 #include <QScopedPointer>
0011 #include <QWeakPointer>
0012 
0013 namespace Oxygen
0014 {
0015 
0016 //*@name convenience typedef
0017 //@{
0018 
0019 //* scoped pointer convenience typedef
0020 template<typename T>
0021 using WeakPointer = QPointer<T>;
0022 
0023 //* scoped pointer convenience typedef
0024 template<typename T>
0025 using ScopedPointer = QScopedPointer<T, QScopedPointerPodDeleter>;
0026 
0027 //@}
0028 
0029 //* metrics
0030 /*! these are copied from the old KStyle WidgetProperties */
0031 enum Metrics {
0032     // frames
0033     Frame_FrameWidth = 2,
0034     Frame_FrameRadius = 3,
0035 
0036     // layout
0037     Layout_TopLevelMarginWidth = 10,
0038     Layout_ChildMarginWidth = 6,
0039     Layout_DefaultSpacing = 6,
0040 
0041     // line editors
0042     LineEdit_FrameWidth = 6,
0043 
0044     // menu items
0045     MenuItem_MarginWidth = 3,
0046     MenuItem_ItemSpacing = 4,
0047     MenuItem_AcceleratorSpace = 16,
0048     MenuButton_IndicatorWidth = 20,
0049 
0050     // combobox
0051     ComboBox_FrameWidth = 6,
0052 
0053     // spinbox
0054     SpinBox_FrameWidth = LineEdit_FrameWidth,
0055     SpinBox_ArrowButtonWidth = 20,
0056 
0057     // groupbox title margin
0058     GroupBox_TitleMarginWidth = 4,
0059 
0060     // buttons
0061     Button_MinWidth = 80,
0062     Button_MarginWidth = 6,
0063     Button_ItemSpacing = 4,
0064 
0065     // tool buttons
0066     ToolButton_MarginWidth = 6,
0067     ToolButton_ItemSpacing = 4,
0068     ToolButton_InlineIndicatorWidth = 12,
0069 
0070     // checkboxes and radio buttons
0071     CheckBox_Size = 23,
0072     CheckBox_FocusMarginWidth = 2,
0073     CheckBox_ItemSpacing = 6,
0074 
0075     // menubar items
0076     MenuBarItem_MarginWidth = 10,
0077     MenuBarItem_MarginHeight = 6,
0078 
0079     // scrollbars
0080     ScrollBar_MinSliderHeight = 21,
0081 
0082     // toolbars
0083     ToolBar_FrameWidth = 0,
0084     ToolBar_HandleExtent = 10,
0085     ToolBar_HandleWidth = 6,
0086     ToolBar_SeparatorWidth = 8,
0087     ToolBar_ExtensionWidth = 20,
0088     ToolBar_MarginSpacing = 2,
0089     ToolBar_ItemSpacing = 0,
0090 
0091     // progressbars
0092     ProgressBar_BusyIndicatorSize = 14,
0093     ProgressBar_Thickness = 6,
0094     ProgressBar_ItemSpacing = 4,
0095 
0096     // mdi title bar
0097     TitleBar_MarginWidth = 4,
0098 
0099     // sliders
0100     Slider_TickLength = 8,
0101     Slider_TickMarginWidth = 2,
0102     Slider_GrooveThickness = 7,
0103     Slider_ControlThickness = 21,
0104 
0105     // tabbar
0106     TabBar_TabMarginHeight = 6,
0107     TabBar_TabMarginWidth = 12,
0108     TabBar_TabMinWidth = 80,
0109     TabBar_TabMinHeight = 28,
0110     TabBar_TabItemSpacing = 8,
0111     TabBar_TabOverlap = 1,
0112     TabBar_TabOffset = 4,
0113     TabBar_BaseOverlap = 7,
0114 
0115     // tab widget
0116     TabWidget_MarginWidth = 4,
0117 
0118     // toolbox
0119     ToolBox_TabMinWidth = 80,
0120     ToolBox_TabItemSpacing = 4,
0121 
0122     // tooltips
0123     ToolTip_FrameWidth = 3,
0124 
0125     // list headers
0126     Header_MarginWidth = 6,
0127     Header_ItemSpacing = 4,
0128     Header_ArrowSize = 10,
0129 
0130     // tree view
0131     ItemView_ArrowSize = 10,
0132     ItemView_ItemMarginWidth = 3,
0133 
0134     // splitter
0135     Splitter_SplitterWidth = 3,
0136 
0137 };
0138 
0139 //* animation mode
0140 enum AnimationMode { AnimationNone = 0, AnimationHover = 0x1, AnimationFocus = 0x2, AnimationEnable = 0x4, AnimationPressed = 0x8 };
0141 
0142 Q_DECLARE_FLAGS(AnimationModes, AnimationMode)
0143 
0144 //* arrow orientation
0145 enum ArrowOrientation { ArrowNone, ArrowUp, ArrowDown, ArrowLeft, ArrowRight };
0146 
0147 //* get polygon corresponding to generic arrow
0148 enum ArrowSize { ArrowNormal, ArrowSmall, ArrowTiny };
0149 
0150 //* internal option flags to pass arguments around
0151 enum StyleOption { Sunken = 0x1, Focus = 0x2, Hover = 0x4, Disabled = 0x8, NoFill = 0x10, HoleOutline = 0x20, HoleContrast = 0x80 };
0152 
0153 Q_DECLARE_FLAGS(StyleOptions, StyleOption)
0154 
0155 //* shadow area
0156 enum ShadowArea { ShadowAreaTop, ShadowAreaBottom, ShadowAreaLeft, ShadowAreaRight };
0157 }
0158 
0159 Q_DECLARE_OPERATORS_FOR_FLAGS(Oxygen::AnimationModes);
0160 Q_DECLARE_OPERATORS_FOR_FLAGS(Oxygen::StyleOptions);
0161 
0162 #endif