File indexing completed on 2024-05-19 05:28:50
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 "breezegenericdata.h" 0010 0011 namespace Breeze 0012 { 0013 //* handle widget state (hover/focus/enable) changes 0014 class WidgetStateData : public GenericData 0015 { 0016 Q_OBJECT 0017 0018 public: 0019 //* constructor 0020 WidgetStateData(QObject *parent, QObject *target, int duration, bool state = false) 0021 : GenericData(parent, target, duration) 0022 , _initialized(false) 0023 , _state(state) 0024 { 0025 } 0026 0027 //* destructor 0028 virtual ~WidgetStateData() 0029 { 0030 } 0031 0032 /** 0033 returns true if hover has Changed 0034 and starts timer accordingly 0035 */ 0036 virtual bool updateState(bool value); 0037 0038 private: 0039 bool _initialized; 0040 bool _state; 0041 }; 0042 0043 }