File indexing completed on 2024-05-12 17:05:46
0001 #ifndef oxygenanimationengine_h 0002 #define oxygenanimationengine_h 0003 /* 0004 * this file is part of the oxygen gtk engine 0005 * SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr> 0006 * 0007 * SPDX-License-Identifier: LGPL-2.0-or-later 0008 */ 0009 0010 #include "../oxygenapplicationname.h" 0011 0012 namespace Oxygen 0013 { 0014 0015 class AnimationEngine 0016 { 0017 0018 public: 0019 0020 //! constructor 0021 explicit AnimationEngine( void ): 0022 _duration( 150 ) 0023 {} 0024 0025 //! destructor 0026 virtual ~AnimationEngine( void ) 0027 {} 0028 0029 //! application name 0030 virtual void setApplicationName( const ApplicationName& applicationName ) 0031 { _applicationName = applicationName; } 0032 0033 //! duration 0034 const int& duration( void ) const 0035 { return _duration; } 0036 0037 //! duration 0038 /*! returns true if changed */ 0039 bool setDuration( int value ) 0040 { 0041 if( _duration == value ) return false; 0042 _duration = value; 0043 return true; 0044 } 0045 0046 protected: 0047 0048 //! returs true if widget is black listed (based notably on application name) 0049 bool widgetIsBlackListed( GtkWidget* widget ) const 0050 { 0051 0052 // for now, only Mozilla applications need blacklisting 0053 return _applicationName.isXul( widget ); 0054 0055 } 0056 0057 private: 0058 0059 //! application name 0060 ApplicationName _applicationName; 0061 0062 //! animation duration 0063 int _duration; 0064 0065 }; 0066 } 0067 0068 #endif