1 #ifndef oxygenlabelengine_h 2 #define oxygenlabelengine_h 3 4 ////////////////////////////////////////////////////////////////////////////// 5 // oxygenlabelengine.h 6 // stores event filters and maps widgets to animations 7 // ------------------- 8 // 9 // SPDX-FileCopyrightText: 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr> 10 // 11 // SPDX-License-Identifier: MIT 12 ////////////////////////////////////////////////////////////////////////////// 13 14 #include "oxygenbaseengine.h" 15 #include "oxygendatamap.h" 16 #include "oxygenlabeldata.h" 17 18 namespace Oxygen 19 { 20 21 //* used for simple widgets 22 class LabelEngine: public BaseEngine 23 { 24 25 Q_OBJECT 26 27 public: 28 29 //* constructor LabelEngine(QObject * parent)30 explicit LabelEngine( QObject* parent ): 31 BaseEngine( parent ) 32 {} 33 34 //* register widget 35 bool registerWidget( QLabel* ); 36 37 //* duration setEnabled(bool value)38 void setEnabled( bool value ) override 39 { 40 BaseEngine::setEnabled( value ); 41 _data.setEnabled( value ); 42 } 43 44 //* duration setDuration(int value)45 void setDuration( int value ) override 46 { 47 BaseEngine::setDuration( value ); 48 _data.setDuration( value ); 49 } 50 51 public Q_SLOTS: 52 53 //* remove widget from map unregisterWidget(QObject * object)54 bool unregisterWidget( QObject* object ) override 55 { return _data.unregisterWidget( object ); } 56 57 private: 58 59 //* maps 60 DataMap<LabelData> _data; 61 62 }; 63 64 } 65 66 #endif 67