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

« back to all changes in this revision

Viewing changes to kstyles/oxygen/config/oxygenconfigdialog.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 oxygenconfigdialog_h
 
2
#define oxygenconfigdialog_h
 
3
 
 
4
//////////////////////////////////////////////////////////////////////////////
 
5
// oxygenconfigdialog.h
 
6
// oxygen configuration dialog
 
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 <KDialog>
 
31
#include <KPageWidget>
 
32
 
 
33
namespace Oxygen
 
34
{
 
35
 
 
36
    class ConfigDialog: public KDialog
 
37
    {
 
38
        Q_OBJECT
 
39
 
 
40
        public:
 
41
 
 
42
        //! constructor
 
43
        explicit ConfigDialog( QWidget* parent = 0 );
 
44
 
 
45
        //! destructor
 
46
        virtual ~ConfigDialog( void )
 
47
        {}
 
48
 
 
49
        signals:
 
50
 
 
51
        //! restore default configuration
 
52
        void pluginDefault( void );
 
53
 
 
54
        //! reset local changes
 
55
        void pluginReset( const KConfigGroup& );
 
56
 
 
57
        //! save local changes
 
58
        void pluginSave( KConfigGroup& );
 
59
 
 
60
        //! expert mode
 
61
        void pluginToggleExpertMode( bool );
 
62
 
 
63
        public slots:
 
64
 
 
65
        //! restore default configuration
 
66
        virtual void defaults( void );
 
67
 
 
68
        //! reset local changes
 
69
        virtual void reset( void );
 
70
 
 
71
        //! save local changes
 
72
        virtual void save( void );
 
73
 
 
74
        protected slots:
 
75
 
 
76
        // update decoration changed state
 
77
        void updateStyleChanged( bool state = true )
 
78
        { _styleChanged = state; }
 
79
 
 
80
        // update decoration changed state
 
81
        void updateDecorationChanged( bool state = true )
 
82
        { _decorationChanged = state; }
 
83
 
 
84
        // handle configuration modifications
 
85
        virtual void updateChanged( void );
 
86
 
 
87
        // update window title based on selected page
 
88
        virtual void updateWindowTitle( KPageWidgetItem* = 0 );
 
89
 
 
90
        private:
 
91
 
 
92
        //! true if configuration changed
 
93
        bool changed( void ) const
 
94
        { return _styleChanged || _decorationChanged; }
 
95
 
 
96
        //! load style config widget from plugin
 
97
        KPageWidgetItem* loadStyleConfig( void );
 
98
 
 
99
        //! load decoration config widget from plugin
 
100
        KPageWidgetItem* loadDecorationConfig( void );
 
101
 
 
102
        //! central widget
 
103
        KPageWidget* pageWidget_;
 
104
 
 
105
        //! style plugin widget
 
106
        QObject *_stylePluginObject;
 
107
 
 
108
        //! decoration plugin widget
 
109
        QObject *_decorationPluginObject;
 
110
 
 
111
        bool _styleChanged;
 
112
        bool _decorationChanged;
 
113
 
 
114
    };
 
115
 
 
116
}
 
117
 
 
118
#endif