File indexing completed on 2024-04-28 05:32:31

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