QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskSkinManager.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SKIN_MANAGER_H
7#define QSK_SKIN_MANAGER_H
8
9#include "QskGlobal.h"
10#include "QskSkin.h"
11
12#include <qobject.h>
13#include <memory>
14
15class QskSkinFactory;
17
18#if defined( qskSkinManager )
19#undef qskSkinManager
20#endif
21
22#define qskSkinManager QskSkinManager::instance()
23
24class QSK_EXPORT QskSkinManager : public QObject
25{
26 Q_OBJECT
27
28 public:
29 static QskSkinManager* instance();
30
31 void addPluginPath( const QString& );
32 void removePluginPath( const QString& );
33
34 void setPluginPaths( const QStringList& );
35 QStringList pluginPaths() const;
36
37 void registerFactory( const QString& factoryId, QskSkinFactory* );
38 void unregisterFactory( const QString& factoryId );
39 void unregisterFactories();
40
41 QStringList skinNames() const;
42
43 QskSkin* createSkin( const QString& skinName,
44 QskSkin::ColorScheme = QskSkin::UnknownScheme ) const;
45
46 void setSkin( QskSkin* );
47 QskSkin* skin();
48
49 QskSkin* setSkin( const QString& );
50 QString skinName() const;
51
52 void setTransitionHint( const QskAnimationHint& );
53 QskAnimationHint transitionHint() const;
54
55 Q_SIGNALS:
56 void skinChanged( QskSkin* );
57 void colorSchemeChanged( QskSkin::ColorScheme );
58
59 protected:
61 ~QskSkinManager() override;
62
63 class PrivateData;
64 std::unique_ptr< PrivateData > m_data;
65};
66
67#endif