1 /************************************************************************* 2 * Copyright (C) 2014 by Hugo Pereira Da Costa <hugo.pereira@free.fr> * 3 * * 4 * This program is free software; you can redistribute it and/or modify * 5 * it under the terms of the GNU General Public License as published by * 6 * the Free Software Foundation; either version 2 of the License, or * 7 * (at your option) any later version. * 8 * * 9 * This program is distributed in the hope that it will be useful, * 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 * GNU General Public License for more details. * 13 * * 14 * You should have received a copy of the GNU General Public License * 15 * along with this program; if not, write to the * 16 * Free Software Foundation, Inc., * 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 *************************************************************************/ 19 20 #ifndef ADWAITA_ANIMATIONS_H 21 #define ADWAITA_ANIMATIONS_H 22 23 #include "adwaitabusyindicatorengine.h" 24 #include "adwaitadialengine.h" 25 #include "adwaitaheaderviewengine.h" 26 #include "adwaitascrollbarengine.h" 27 #include "adwaitaspinboxengine.h" 28 #include "adwaitastackedwidgetengine.h" 29 #include "adwaitatabbarengine.h" 30 #include "adwaitatoolboxengine.h" 31 #include "adwaitawidgetstateengine.h" 32 #include "adwaitaqt_export.h" 33 34 #include <QList> 35 #include <QObject> 36 37 namespace Adwaita 38 { 39 //* stores engines 40 class ADWAITAQT_EXPORT Animations : public QObject 41 { 42 Q_OBJECT 43 44 public: 45 //* constructor 46 explicit Animations(QObject *); 47 48 //* destructor ~Animations()49 virtual ~Animations() 50 { 51 } 52 53 //* register animations corresponding to given widget, depending on its type. 54 void registerWidget(QWidget *widget) const; 55 56 /** unregister all animations associated to a widget */ 57 void unregisterWidget(QWidget *widget) const; 58 59 //* enability engine widgetEnabilityEngine()60 WidgetStateEngine &widgetEnabilityEngine() const 61 { 62 return *_widgetEnabilityEngine; 63 } 64 65 //* abstractButton engine widgetStateEngine()66 WidgetStateEngine &widgetStateEngine() const 67 { 68 return *_widgetStateEngine; 69 } 70 71 //* editable combobox arrow hover engine comboBoxEngine()72 WidgetStateEngine &comboBoxEngine() const 73 { 74 return *_comboBoxEngine; 75 } 76 77 //! Tool buttons arrow hover engine toolButtonEngine()78 WidgetStateEngine &toolButtonEngine() const 79 { 80 return *_toolButtonEngine; 81 } 82 83 //! item view engine inputWidgetEngine()84 WidgetStateEngine &inputWidgetEngine() const 85 { 86 return *_inputWidgetEngine; 87 } 88 89 //* busy indicator busyIndicatorEngine()90 BusyIndicatorEngine &busyIndicatorEngine() const 91 { 92 return *_busyIndicatorEngine; 93 } 94 95 //* header view engine headerViewEngine()96 HeaderViewEngine &headerViewEngine() const 97 { 98 return *_headerViewEngine; 99 } 100 101 //* scrollbar engine scrollBarEngine()102 ScrollBarEngine &scrollBarEngine() const 103 { 104 return *_scrollBarEngine; 105 } 106 107 //* dial engine dialEngine()108 DialEngine &dialEngine() const 109 { 110 return *_dialEngine; 111 } 112 113 //* spinbox engine spinBoxEngine()114 SpinBoxEngine &spinBoxEngine() const 115 { 116 return *_spinBoxEngine; 117 } 118 119 //* tabbar tabBarEngine()120 TabBarEngine &tabBarEngine() const 121 { 122 return *_tabBarEngine; 123 } 124 125 //* toolbox toolBoxEngine()126 ToolBoxEngine &toolBoxEngine() const 127 { 128 return *_toolBoxEngine; 129 } 130 131 //* setup engines 132 void setupEngines(); 133 134 protected Q_SLOTS: 135 136 //* enregister engine 137 void unregisterEngine(QObject *); 138 139 private: 140 //* register new engine 141 void registerEngine(BaseEngine *engine); 142 143 //* busy indicator 144 BusyIndicatorEngine *_busyIndicatorEngine; 145 146 //* headerview hover effect 147 HeaderViewEngine *_headerViewEngine; 148 149 //* widget enability engine 150 WidgetStateEngine *_widgetEnabilityEngine; 151 152 //* abstract button engine 153 WidgetStateEngine *_widgetStateEngine; 154 155 //* editable combobox arrow hover effect 156 WidgetStateEngine *_comboBoxEngine; 157 158 //! mennu toolbutton arrow hover effect 159 WidgetStateEngine *_toolButtonEngine; 160 161 //! item view engine 162 WidgetStateEngine *_inputWidgetEngine; 163 164 //* scrollbar engine 165 ScrollBarEngine *_scrollBarEngine; 166 167 //* dial engine 168 DialEngine *_dialEngine; 169 170 //* spinbox engine 171 SpinBoxEngine *_spinBoxEngine; 172 173 //* stacked widget engine 174 StackedWidgetEngine *_stackedWidgetEngine; 175 176 //* tabbar engine 177 TabBarEngine *_tabBarEngine; 178 179 //* toolbar engine 180 ToolBoxEngine *_toolBoxEngine; 181 182 //* keep list of existing engines 183 QList<BaseEngine::Pointer> _engines; 184 }; 185 186 } // namespace Adwaita 187 188 #endif // ADWAITA_ANIMATIONS_H 189