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 const QskSkin* currentSkin() const ;
50
51 QskSkin* setSkin( const QString& );
52 QString skinName() const;
53
54 void setTransitionHint( const QskAnimationHint& );
55 QskAnimationHint transitionHint() const;
56
57 Q_SIGNALS:
58 void skinChanged( QskSkin* );
59 void colorSchemeChanged( QskSkin::ColorScheme );
60
61 protected:
63 ~QskSkinManager() override;
64
65 class PrivateData;
66 std::unique_ptr< PrivateData > m_data;
67};
68
69#endif