~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kstyles/oxygen/animations/oxygenbaseengine.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef oxygenbaseengine_h
 
2
#define oxygenbaseengine_h
 
3
 
 
4
//////////////////////////////////////////////////////////////////////////////
 
5
// oxygenbaseengine.h
 
6
// base engine
 
7
// -------------------
 
8
//
 
9
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
 
10
//
 
11
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
12
// of this software and associated documentation files (the "Software"), to
 
13
// deal in the Software without restriction, including without limitation the
 
14
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 
15
// sell copies of the Software, and to permit persons to whom the Software is
 
16
// furnished to do so, subject to the following conditions:
 
17
//
 
18
// The above copyright notice and this permission notice shall be included in
 
19
// all copies or substantial portions of the Software.
 
20
//
 
21
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
22
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
23
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
24
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
25
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
26
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 
27
// IN THE SOFTWARE.
 
28
//////////////////////////////////////////////////////////////////////////////
 
29
 
 
30
#include <QtCore/QObject>
 
31
#include <QtCore/QSet>
 
32
#include <QtCore/QWeakPointer>
 
33
 
 
34
namespace Oxygen
 
35
{
 
36
 
 
37
    //! base class for all animation engines
 
38
    /*! it is used to store configuration values used by all animations stored in the engine */
 
39
    class BaseEngine: public QObject
 
40
    {
 
41
 
 
42
        Q_OBJECT
 
43
 
 
44
        public:
 
45
 
 
46
        typedef QWeakPointer<BaseEngine> Pointer;
 
47
 
 
48
        //! constructor
 
49
        BaseEngine( QObject* parent ):
 
50
        QObject( parent ),
 
51
        _enabled( true ),
 
52
        _duration( 200 )
 
53
        {}
 
54
 
 
55
        //! destructor
 
56
        virtual ~BaseEngine( void )
 
57
        {}
 
58
 
 
59
        //! enability
 
60
        virtual void setEnabled( bool value )
 
61
        { _enabled = value; }
 
62
 
 
63
        //! enability
 
64
        virtual bool enabled( void ) const
 
65
        { return _enabled; }
 
66
 
 
67
        //! duration
 
68
        virtual void setDuration( int value )
 
69
        { _duration = value; }
 
70
 
 
71
        //! duration
 
72
        virtual int duration( void ) const
 
73
        { return _duration; }
 
74
 
 
75
        //! unregister widget
 
76
        virtual bool unregisterWidget( QObject* object ) = 0;
 
77
 
 
78
        //! list of widgets
 
79
        typedef QSet<QWidget*> WidgetList;
 
80
 
 
81
        //! returns registered widgets
 
82
        virtual WidgetList registeredWidgets( void ) const
 
83
        { return WidgetList(); }
 
84
 
 
85
        private:
 
86
 
 
87
        //! engine enability
 
88
        bool _enabled;
 
89
 
 
90
        //! animation duration
 
91
        int _duration;
 
92
 
 
93
    };
 
94
 
 
95
}
 
96
 
 
97
#endif