File indexing completed on 2024-05-12 15:56:57

0001 /*
0002  *  SPDX-FileCopyrightText: 2007 Adrian Page <adrian@pagenet.plus.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 #ifndef KIS_CONFIG_NOTIFIER_H_
0007 #define KIS_CONFIG_NOTIFIER_H_
0008 
0009 #include <QObject>
0010 #include <QScopedPointer>
0011 
0012 #include "kritaglobal_export.h"
0013 
0014 /**
0015  * An object that emits a signal to inform interested parties that the
0016  * configuration settings have changed.
0017  */
0018 class KRITAGLOBAL_EXPORT KisConfigNotifier : public QObject
0019 {
0020     Q_OBJECT
0021 public:
0022     KisConfigNotifier();
0023     ~KisConfigNotifier() override;
0024 
0025     /**
0026      * @return the KisConfigNotifier singleton
0027      */
0028     static KisConfigNotifier *instance();
0029 
0030     /**
0031      * Notify that the configuration has changed. This will cause the
0032      * configChanged() signal to be emitted.
0033      */
0034     void notifyConfigChanged(void);
0035 
0036     void notifyDropFramesModeChanged();
0037     void notifyPixelGridModeChanged();
0038 
0039 Q_SIGNALS:
0040     /**
0041      * This signal is emitted whenever notifyConfigChanged() is called.
0042      */
0043     void configChanged(void);
0044     void dropFramesModeChanged();
0045     void pixelGridModeChanged();
0046 private:
0047     KisConfigNotifier(const KisConfigNotifier&);
0048     KisConfigNotifier operator=(const KisConfigNotifier&);
0049 
0050 private:
0051     struct Private;
0052     const QScopedPointer<Private> m_d;
0053 };
0054 
0055 #endif // KIS_CONFIG_NOTIFIER_H_