File indexing completed on 2024-05-12 05:28:37
0001 /* 0002 * SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "breezebusyindicatorengine.h" 0010 #include "breezedialengine.h" 0011 #include "breezeheaderviewengine.h" 0012 #include "breezescrollbarengine.h" 0013 #include "breezespinboxengine.h" 0014 #include "breezestackedwidgetengine.h" 0015 #include "breezetabbarengine.h" 0016 #include "breezetoolboxengine.h" 0017 #include "breezewidgetstateengine.h" 0018 0019 #include <QList> 0020 #include <QObject> 0021 0022 namespace Breeze 0023 { 0024 //* stores engines 0025 class Animations : public QObject 0026 { 0027 Q_OBJECT 0028 0029 public: 0030 //* constructor 0031 explicit Animations(QObject *); 0032 0033 //* register animations corresponding to given widget, depending on its type. 0034 void registerWidget(QWidget *widget) const; 0035 0036 /** unregister all animations associated to a widget */ 0037 void unregisterWidget(QWidget *widget) const; 0038 0039 //* enability engine 0040 WidgetStateEngine &widgetEnabilityEngine() const 0041 { 0042 return *_widgetEnabilityEngine; 0043 } 0044 0045 //* abstractButton engine 0046 WidgetStateEngine &widgetStateEngine() const 0047 { 0048 return *_widgetStateEngine; 0049 } 0050 0051 //* editable combobox arrow hover engine 0052 WidgetStateEngine &comboBoxEngine() const 0053 { 0054 return *_comboBoxEngine; 0055 } 0056 0057 //* Tool buttons arrow hover engine 0058 WidgetStateEngine &toolButtonEngine() const 0059 { 0060 return *_toolButtonEngine; 0061 } 0062 0063 //* item view engine 0064 WidgetStateEngine &inputWidgetEngine() const 0065 { 0066 return *_inputWidgetEngine; 0067 } 0068 0069 //* busy indicator 0070 BusyIndicatorEngine &busyIndicatorEngine() const 0071 { 0072 return *_busyIndicatorEngine; 0073 } 0074 0075 //* header view engine 0076 HeaderViewEngine &headerViewEngine() const 0077 { 0078 return *_headerViewEngine; 0079 } 0080 0081 //* scrollbar engine 0082 ScrollBarEngine &scrollBarEngine() const 0083 { 0084 return *_scrollBarEngine; 0085 } 0086 0087 //* dial engine 0088 DialEngine &dialEngine() const 0089 { 0090 return *_dialEngine; 0091 } 0092 0093 //* spinbox engine 0094 SpinBoxEngine &spinBoxEngine() const 0095 { 0096 return *_spinBoxEngine; 0097 } 0098 0099 //* tabbar 0100 TabBarEngine &tabBarEngine() const 0101 { 0102 return *_tabBarEngine; 0103 } 0104 0105 //* toolbox 0106 ToolBoxEngine &toolBoxEngine() const 0107 { 0108 return *_toolBoxEngine; 0109 } 0110 0111 //* setup engines 0112 void setupEngines(); 0113 0114 protected Q_SLOTS: 0115 0116 //* enregister engine 0117 void unregisterEngine(QObject *); 0118 0119 private: 0120 //* register new engine 0121 void registerEngine(BaseEngine *); 0122 0123 //* busy indicator 0124 BusyIndicatorEngine *_busyIndicatorEngine = nullptr; 0125 0126 //* headerview hover effect 0127 HeaderViewEngine *_headerViewEngine = nullptr; 0128 0129 //* widget enability engine 0130 WidgetStateEngine *_widgetEnabilityEngine = nullptr; 0131 0132 //* abstract button engine 0133 WidgetStateEngine *_widgetStateEngine = nullptr; 0134 0135 //* editable combobox arrow hover effect 0136 WidgetStateEngine *_comboBoxEngine = nullptr; 0137 0138 //* menu toolbutton arrow hover effect 0139 WidgetStateEngine *_toolButtonEngine = nullptr; 0140 0141 //* item view engine 0142 WidgetStateEngine *_inputWidgetEngine = nullptr; 0143 0144 //* scrollbar engine 0145 ScrollBarEngine *_scrollBarEngine = nullptr; 0146 0147 //* dial engine 0148 DialEngine *_dialEngine = nullptr; 0149 0150 //* spinbox engine 0151 SpinBoxEngine *_spinBoxEngine = nullptr; 0152 0153 //* stacked widget engine 0154 StackedWidgetEngine *_stackedWidgetEngine = nullptr; 0155 0156 //* tabbar engine 0157 TabBarEngine *_tabBarEngine = nullptr; 0158 0159 //* toolbar engine 0160 ToolBoxEngine *_toolBoxEngine = nullptr; 0161 0162 //* keep list of existing engines 0163 QList<BaseEngine::Pointer> _engines; 0164 }; 0165 0166 }