2009-09-15 07:12:54 +00:00
|
|
|
#ifndef oxygen_config_h
|
|
|
|
#define oxygen_config_h
|
2009-08-24 16:15:14 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// config.h
|
|
|
|
// -------------------
|
2009-09-09 00:55:55 +00:00
|
|
|
//
|
2009-08-25 04:15:13 +00:00
|
|
|
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
2009-08-24 16:15:14 +00:00
|
|
|
// Copyright (C) 2008 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
//
|
|
|
|
// Based on the Quartz configuration module,
|
|
|
|
// Copyright (c) 2001 Karol Szwed <gallium@kde.org>
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
// of this software and associated documentation files (the "Software"), to
|
|
|
|
// deal in the Software without restriction, including without limitation the
|
|
|
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
// sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2009-09-09 00:55:55 +00:00
|
|
|
// IN THE SOFTWARE.
|
2009-08-24 16:15:14 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#include <KConfig>
|
2009-09-20 07:42:03 +00:00
|
|
|
#include <QtGui/QPalette>
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
#include "oxygenconfigurationui.h"
|
|
|
|
#include "../oxygenexceptionlist.h"
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
namespace Oxygen {
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
class Configuration;
|
|
|
|
class ShadowConfiguration;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
// oxygen configuration object
|
2009-08-22 08:24:06 +00:00
|
|
|
class Config: public QObject
|
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
Q_OBJECT
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
public:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! constructor
|
|
|
|
Config( KConfig* conf, QWidget* parent );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! destructor
|
|
|
|
~Config();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
signals:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! emmited whenever configuration is changed
|
|
|
|
void changed();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-01 22:25:45 +00:00
|
|
|
//! emmited whenever configuration is changed
|
|
|
|
void changed( bool );
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
public slots:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! load configuration
|
2010-05-01 22:25:45 +00:00
|
|
|
void load( const KConfigGroup& );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! save configuration
|
2010-05-01 22:25:45 +00:00
|
|
|
void save( KConfigGroup& );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! restore defaults
|
2010-05-01 22:25:45 +00:00
|
|
|
void defaults( void );
|
|
|
|
|
|
|
|
//! toggle expert mode
|
|
|
|
void toggleExpertMode( bool );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
private slots:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-01 22:25:45 +00:00
|
|
|
//! update change state
|
|
|
|
void updateChanged( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
private:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! load configuration
|
2010-05-02 18:34:08 +00:00
|
|
|
void loadConfiguration( const Configuration& );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-14 19:21:39 +00:00
|
|
|
//! load configuration
|
2010-05-02 18:34:08 +00:00
|
|
|
void loadShadowConfiguration( QPalette::ColorGroup, const ShadowConfiguration& );
|
2009-09-14 19:21:39 +00:00
|
|
|
|
|
|
|
//! load configuration
|
2010-05-02 18:34:08 +00:00
|
|
|
void saveShadowConfiguration( QPalette::ColorGroup, const ShadowConfigurationUi& ) const;
|
2009-09-14 19:21:39 +00:00
|
|
|
|
2010-05-01 22:25:45 +00:00
|
|
|
//! returns true if shadow configuration changed
|
2010-05-02 18:34:08 +00:00
|
|
|
bool shadowConfigurationChanged( const ShadowConfiguration&, const ShadowConfigurationUi& ) const;
|
2010-05-01 22:25:45 +00:00
|
|
|
|
|
|
|
//! returns true if exception list is changed
|
|
|
|
bool exceptionListChanged( void ) const;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! user interface
|
2010-05-02 18:34:08 +00:00
|
|
|
ConfigurationUi *userInterface_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! kconfiguration object
|
|
|
|
KConfig *configuration_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
} //namespace Oxygen
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#endif
|