2006-12-17 00:04:44 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2006 Aaron Seigo <aseigo@kde.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLASMA_THEME_H
|
|
|
|
#define PLASMA_THEME_H
|
|
|
|
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
|
2007-05-20 22:13:46 +02:00
|
|
|
#include <plasma_export.h>
|
2007-01-01 05:31:43 +01:00
|
|
|
|
2006-12-17 00:04:44 +01:00
|
|
|
namespace Plasma
|
|
|
|
{
|
2007-05-22 03:30:03 +02:00
|
|
|
/**
|
|
|
|
* @short Interface to the Plasma theme
|
|
|
|
*
|
|
|
|
* Accessed via Plasma::Theme::self() e.g:
|
|
|
|
* \code
|
|
|
|
* QString image = Plasma::Theme::self()->image("widgets/clock")
|
|
|
|
* \endcode
|
|
|
|
*
|
2007-05-24 20:14:54 +02:00
|
|
|
* Plasma::Theme provides access to a common and standardized set of graphic
|
|
|
|
* elements stored in SVG format. This allows artists to create single packages
|
|
|
|
* of SVGs that will affect the look and feel of all workspace components.
|
|
|
|
*
|
|
|
|
* Plasma::Svg uses Plasma::Theme internally to locate and load the appropriate
|
|
|
|
* SVG data. Alternatively, Plasma::Theme can be used directly to retrieve
|
|
|
|
* file system paths to SVGs by name.
|
2007-05-22 03:30:03 +02:00
|
|
|
*/
|
2007-05-20 22:13:46 +02:00
|
|
|
class PLASMA_EXPORT Theme : public QObject
|
2006-12-17 00:04:44 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2007-03-08 00:27:37 +01:00
|
|
|
/**
|
|
|
|
* Singleton pattern accessor
|
|
|
|
**/
|
|
|
|
static Theme* self();
|
|
|
|
|
2007-03-03 02:41:27 +01:00
|
|
|
explicit Theme( QObject* parent = 0 );
|
2006-12-17 00:04:44 +01:00
|
|
|
~Theme();
|
|
|
|
|
2007-05-22 03:30:03 +02:00
|
|
|
/**
|
2007-05-24 20:14:54 +02:00
|
|
|
* @return the name of the theme. "default" is none set.
|
2007-05-22 03:30:03 +02:00
|
|
|
*/
|
2006-12-17 00:04:44 +01:00
|
|
|
QString themeName() const;
|
2007-05-24 20:14:54 +02:00
|
|
|
|
2007-05-22 03:30:03 +02:00
|
|
|
/**
|
|
|
|
* @arg name the name of the file in the theme directory (without the
|
|
|
|
* ".svg" part)
|
|
|
|
* @return the full path to the requested file for the current theme
|
|
|
|
*/
|
2007-03-05 01:07:21 +01:00
|
|
|
QString image( const QString& name ) const;
|
2006-12-17 00:04:44 +01:00
|
|
|
|
2007-04-22 11:35:04 +02:00
|
|
|
Q_SIGNALS:
|
2006-12-17 00:04:44 +01:00
|
|
|
void changed();
|
|
|
|
|
|
|
|
private:
|
|
|
|
class Private;
|
2007-05-21 16:28:03 +02:00
|
|
|
Private* const d;
|
2006-12-17 00:04:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // Plasma namespace
|
|
|
|
|
|
|
|
#endif // multiple inclusion guard
|
|
|
|
|