qskinny/src/controls/QskSetup.h

66 lines
1.4 KiB
C
Raw Normal View History

2017-07-21 16:21:34 +00:00
/******************************************************************************
2024-01-17 13:31:45 +00:00
* QSkinny - Copyright (C) The authors
2023-04-06 07:23:37 +00:00
* SPDX-License-Identifier: BSD-3-Clause
2017-07-21 16:21:34 +00:00
*****************************************************************************/
#ifndef QSK_SETUP_H
2021-02-09 07:13:20 +00:00
#define QSK_SETUP_H
2017-07-21 16:21:34 +00:00
#include "QskGlobal.h"
2024-02-02 13:13:33 +00:00
#include "QskItem.h"
2018-08-03 06:15:28 +00:00
#include <qobject.h>
2017-07-21 16:21:34 +00:00
#include <memory>
2018-04-04 18:19:47 +00:00
class QQuickItem;
2017-07-21 16:21:34 +00:00
class QskGraphicProvider;
#if defined( qskSetup )
#undef qskSetup
#endif
#define qskSetup QskSetup::instance()
class QSK_EXPORT QskSetup : public QObject
{
Q_OBJECT
2018-08-03 06:15:28 +00:00
public:
2017-07-21 16:21:34 +00:00
2018-08-03 06:15:28 +00:00
static QskSetup* instance();
2017-07-21 16:21:34 +00:00
2024-02-02 13:13:33 +00:00
void setItemUpdateFlags( QskItem::UpdateFlags );
2021-02-09 07:13:20 +00:00
void resetItemUpdateFlags();
2024-02-02 13:13:33 +00:00
QskItem::UpdateFlags itemUpdateFlags() const;
2017-07-21 16:21:34 +00:00
2024-02-02 13:13:33 +00:00
void setItemUpdateFlag( QskItem::UpdateFlag, bool on = true );
void resetItemUpdateFlag( QskItem::UpdateFlag );
bool testItemUpdateFlag( QskItem::UpdateFlag );
2017-07-21 16:21:34 +00:00
void addGraphicProvider( const QString& providerId, QskGraphicProvider* );
QskGraphicProvider* graphicProvider( const QString& providerId ) const;
static void setup();
static void cleanup();
2018-08-03 06:15:28 +00:00
Q_SIGNALS:
2021-02-09 07:13:20 +00:00
void itemUpdateFlagsChanged();
2017-07-21 16:21:34 +00:00
2018-08-03 06:15:28 +00:00
private:
2017-07-21 16:21:34 +00:00
QskSetup();
2018-07-31 15:32:25 +00:00
~QskSetup() override;
2017-07-21 16:21:34 +00:00
static QskSetup* s_instance;
class PrivateData;
std::unique_ptr< PrivateData > m_data;
};
2018-08-03 06:15:28 +00:00
inline QskSetup* QskSetup::instance()
2017-07-21 16:21:34 +00:00
{
Q_ASSERT( s_instance );
return s_instance;
}
#endif