File indexing completed on 2024-05-19 05:35:19

0001 #ifndef oxygenanimations_h
0002 #define oxygenanimations_h
0003 
0004 //////////////////////////////////////////////////////////////////////////////
0005 // oxygenanimations.h
0006 // container for all animation engines
0007 // -------------------
0008 //
0009 // SPDX-FileCopyrightText: 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0010 //
0011 // SPDX-License-Identifier: MIT
0012 //////////////////////////////////////////////////////////////////////////////
0013 
0014 #include "oxygenbusyindicatorengine.h"
0015 #include "oxygendockseparatorengine.h"
0016 #include "oxygenheaderviewengine.h"
0017 #include "oxygenmdiwindowengine.h"
0018 #include "oxygenmenubarengine.h"
0019 #include "oxygenmenuengine.h"
0020 #include "oxygenprogressbarengine.h"
0021 #include "oxygenscrollbarengine.h"
0022 #include "oxygenspinboxengine.h"
0023 #include "oxygensplitterengine.h"
0024 #include "oxygentabbarengine.h"
0025 #include "oxygentoolbarengine.h"
0026 #include "oxygentoolboxengine.h"
0027 #include "oxygenwidgetstateengine.h"
0028 
0029 #include <QList>
0030 #include <QObject>
0031 
0032 namespace Oxygen
0033 {
0034 //* stores engines
0035 class Animations : public QObject
0036 {
0037     Q_OBJECT
0038 
0039 public:
0040     //* constructor
0041     explicit Animations(QObject *);
0042 
0043     //* register animations corresponding to given widget, depending on its type.
0044     void registerWidget(QWidget *widget) const;
0045 
0046     /** unregister all animations associated to a widget */
0047     void unregisterWidget(QWidget *widget) const;
0048 
0049     //* enable state engine
0050     WidgetStateEngine &widgetEnableStateEngine(void) const
0051     {
0052         return *_widgetEnableStateEngine;
0053     }
0054 
0055     //* abstractButton engine
0056     WidgetStateEngine &widgetStateEngine(void) const
0057     {
0058         return *_widgetStateEngine;
0059     }
0060 
0061     //* editable combobox arrow hover engine
0062     WidgetStateEngine &comboBoxEngine(void) const
0063     {
0064         return *_comboBoxEngine;
0065     }
0066 
0067     //* Tool buttons arrow hover engine
0068     WidgetStateEngine &toolButtonEngine(void) const
0069     {
0070         return *_toolButtonEngine;
0071     }
0072 
0073     //* item view engine
0074     WidgetStateEngine &inputWidgetEngine(void) const
0075     {
0076         return *_inputWidgetEngine;
0077     }
0078 
0079     //* splitter engine
0080     SplitterEngine &splitterEngine(void) const
0081     {
0082         return *_splitterEngine;
0083     }
0084 
0085     //* busy indicator
0086     BusyIndicatorEngine &busyIndicatorEngine(void) const
0087     {
0088         return *_busyIndicatorEngine;
0089     }
0090 
0091     //* dock separators engine
0092     DockSeparatorEngine &dockSeparatorEngine(void) const
0093     {
0094         return *_dockSeparatorEngine;
0095     }
0096 
0097     //* header view engine
0098     HeaderViewEngine &headerViewEngine(void) const
0099     {
0100         return *_headerViewEngine;
0101     }
0102 
0103     //* progressbar engine
0104     ProgressBarEngine &progressBarEngine(void) const
0105     {
0106         return *_progressBarEngine;
0107     }
0108 
0109     //* menubar engine
0110     MenuBarBaseEngine &menuBarEngine(void) const
0111     {
0112         return *_menuBarEngine;
0113     }
0114 
0115     //* menu engine
0116     MenuBaseEngine &menuEngine(void) const
0117     {
0118         return *_menuEngine;
0119     }
0120 
0121     //* scrollbar engine
0122     ScrollBarEngine &scrollBarEngine(void) const
0123     {
0124         return *_scrollBarEngine;
0125     }
0126 
0127     //* spinbox engine
0128     SpinBoxEngine &spinBoxEngine(void) const
0129     {
0130         return *_spinBoxEngine;
0131     }
0132 
0133     //* tabbar
0134     TabBarEngine &tabBarEngine(void) const
0135     {
0136         return *_tabBarEngine;
0137     }
0138 
0139     //* toolbar
0140     ToolBarEngine &toolBarEngine(void) const
0141     {
0142         return *_toolBarEngine;
0143     }
0144 
0145     //* toolbox
0146     ToolBoxEngine &toolBoxEngine(void) const
0147     {
0148         return *_toolBoxEngine;
0149     }
0150 
0151     //* mdi windows
0152     MdiWindowEngine &mdiWindowEngine(void) const
0153     {
0154         return *_mdiWindowEngine;
0155     }
0156 
0157     //* setup engines
0158     void setupEngines(void);
0159 
0160 private Q_SLOTS:
0161 
0162     //* enregister engine
0163     void unregisterEngine(QObject *);
0164 
0165 private:
0166     //* register new engine
0167     void registerEngine(BaseEngine *engine);
0168 
0169     //* busy indicator
0170     BusyIndicatorEngine *_busyIndicatorEngine = nullptr;
0171 
0172     //* dock separator handle hover effect
0173     DockSeparatorEngine *_dockSeparatorEngine = nullptr;
0174 
0175     //* headerview hover effect
0176     HeaderViewEngine *_headerViewEngine = nullptr;
0177 
0178     //* widget enable state engine
0179     WidgetStateEngine *_widgetEnableStateEngine = nullptr;
0180 
0181     //* abstract button engine
0182     WidgetStateEngine *_widgetStateEngine = nullptr;
0183 
0184     //* editable combobox arrow hover effect
0185     WidgetStateEngine *_comboBoxEngine = nullptr;
0186 
0187     //* mennu toolbutton arrow hover effect
0188     WidgetStateEngine *_toolButtonEngine = nullptr;
0189 
0190     //* item view engine
0191     WidgetStateEngine *_inputWidgetEngine = nullptr;
0192 
0193     //* QSplitter engine
0194     SplitterEngine *_splitterEngine = nullptr;
0195 
0196     //* progressbar engine
0197     ProgressBarEngine *_progressBarEngine = nullptr;
0198 
0199     //* menubar engine
0200     MenuBarBaseEngine *_menuBarEngine = nullptr;
0201 
0202     //* menu engine
0203     MenuBaseEngine *_menuEngine = nullptr;
0204 
0205     //* scrollbar engine
0206     ScrollBarEngine *_scrollBarEngine = nullptr;
0207 
0208     //* spinbox engine
0209     SpinBoxEngine *_spinBoxEngine = nullptr;
0210 
0211     //* tabbar engine
0212     TabBarEngine *_tabBarEngine = nullptr;
0213 
0214     //* toolbar engine
0215     ToolBarEngine *_toolBarEngine = nullptr;
0216 
0217     //* toolbar engine
0218     ToolBoxEngine *_toolBoxEngine = nullptr;
0219 
0220     //* mdi window
0221     MdiWindowEngine *_mdiWindowEngine = nullptr;
0222 
0223     //* keep list of existing engines
0224     QList<BaseEngine::Pointer> _engines;
0225 };
0226 }
0227 
0228 #endif