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

« back to all changes in this revision

Viewing changes to kstyles/oxygen/animations/oxygenprogressbardata.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 oxygenprogressbar_datah
 
2
#define oxygenprogressbar_datah
 
3
 
 
4
//////////////////////////////////////////////////////////////////////////////
 
5
// oxygenprogressbardata.h
 
6
// data container for progressbar animations
 
7
// -------------------
 
8
//
 
9
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo@oxygen-icons.org>
 
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 "oxygengenericdata.h"
 
31
#include <QtCore/QObject>
 
32
#include <QtCore/QTextStream>
 
33
 
 
34
namespace Oxygen
 
35
{
 
36
 
 
37
 
 
38
    //! generic data
 
39
    class ProgressBarData: public GenericData
 
40
    {
 
41
 
 
42
        Q_OBJECT
 
43
 
 
44
        public:
 
45
 
 
46
        //! constructor
 
47
        ProgressBarData( QObject* parent, QWidget* widget, int duration );
 
48
 
 
49
        //! destructor
 
50
        virtual ~ProgressBarData( void )
 
51
        {}
 
52
 
 
53
        //! event filter
 
54
        virtual bool eventFilter( QObject*, QEvent* );
 
55
 
 
56
        //! progressbar value (during animation)
 
57
        virtual int value( void ) const
 
58
        { return startValue() + opacity()*( endValue() - startValue() ); }
 
59
 
 
60
        protected slots:
 
61
 
 
62
        //! triggered by progressBar::valueChanged
 
63
        void valueChanged( int );
 
64
 
 
65
        protected:
 
66
 
 
67
        const int& startValue( void ) const
 
68
        { return _startValue; }
 
69
 
 
70
        void setStartValue( int value )
 
71
        { _startValue = value; }
 
72
 
 
73
        const int& endValue( void ) const
 
74
        { return _endValue; }
 
75
 
 
76
        void setEndValue( int value )
 
77
        { _endValue = value; }
 
78
 
 
79
        private:
 
80
 
 
81
        //! animation starting value
 
82
        int _startValue;
 
83
 
 
84
        //! animation ending value
 
85
        int _endValue;
 
86
 
 
87
    };
 
88
 
 
89
}
 
90
 
 
91
#endif