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

« back to all changes in this revision

Viewing changes to kstyles/oxygen/demo/oxygensliderdemowidget.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 oxygensliderdemowidget_h
 
2
#define oxygensliderdemowidget_h
 
3
 
 
4
//////////////////////////////////////////////////////////////////////////////
 
5
// oxygensliderdemowidget.h
 
6
// oxygen sliders demo widget
 
7
// -------------------
 
8
//
 
9
// Copyright (c) 2010 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 <QtGui/QWidget>
 
31
#include <QtGui/QProgressBar>
 
32
#include <QtGui/QCheckBox>
 
33
 
 
34
#include "oxygendemowidget.h"
 
35
#include "ui_oxygensliderdemowidget.h"
 
36
 
 
37
namespace Oxygen
 
38
{
 
39
 
 
40
    class ProgressBar: public QObject
 
41
    {
 
42
        Q_OBJECT
 
43
 
 
44
        public:
 
45
 
 
46
        //! constructor
 
47
        ProgressBar( QObject*, QProgressBar*, QCheckBox* );
 
48
 
 
49
        //! set value
 
50
        void setValue( int );
 
51
 
 
52
        protected slots:
 
53
 
 
54
        //! toggle bussy state
 
55
        void toggleBusy( bool );
 
56
 
 
57
        private:
 
58
 
 
59
        //! progressBar
 
60
        QProgressBar* _progressBar;
 
61
 
 
62
        //! checkbox
 
63
        QCheckBox* _checkBox;
 
64
 
 
65
        //! saved value
 
66
        int _value;
 
67
 
 
68
    };
 
69
 
 
70
    class SliderDemoWidget: public DemoWidget
 
71
    {
 
72
 
 
73
        Q_OBJECT
 
74
 
 
75
        public:
 
76
 
 
77
        //! constructor
 
78
        SliderDemoWidget( QWidget* parent = 0 );
 
79
 
 
80
        //! destructor
 
81
        virtual ~SliderDemoWidget( void )
 
82
        {}
 
83
 
 
84
        public slots:
 
85
 
 
86
        //! benchmark
 
87
        void benchmark( void );
 
88
 
 
89
        protected slots:
 
90
 
 
91
        void updateSliders( int );
 
92
 
 
93
        private:
 
94
 
 
95
        bool _locked;
 
96
 
 
97
        Ui_SliderDemoWidget ui;
 
98
 
 
99
        //! progressbars
 
100
        ProgressBar* _progressBar1;
 
101
        ProgressBar* _progressBar2;
 
102
 
 
103
    };
 
104
 
 
105
}
 
106
 
 
107
#endif