1 /*
2  *  Copyright (c) 2007 Adrian Page <adrian@pagenet.plus.com>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 #ifndef KIS_CONFIG_NOTIFIER_H_
19 #define KIS_CONFIG_NOTIFIER_H_
20 
21 #include <QObject>
22 #include <QScopedPointer>
23 
24 #include "kritaglobal_export.h"
25 
26 /**
27  * An object that emits a signal to inform interested parties that the
28  * configuration settings have changed.
29  */
30 class KRITAGLOBAL_EXPORT KisConfigNotifier : public QObject
31 {
32     Q_OBJECT
33 public:
34     KisConfigNotifier();
35     ~KisConfigNotifier() override;
36 
37     /**
38      * @return the KisConfigNotifier singleton
39      */
40     static KisConfigNotifier *instance();
41 
42     /**
43      * Notify that the configuration has changed. This will cause the
44      * configChanged() signal to be emitted.
45      */
46     void notifyConfigChanged(void);
47 
48     void notifyDropFramesModeChanged();
49     void notifyPixelGridModeChanged();
50 
51 Q_SIGNALS:
52     /**
53      * This signal is emitted whenever notifyConfigChanged() is called.
54      */
55     void configChanged(void);
56     void dropFramesModeChanged();
57     void pixelGridModeChanged();
58 private:
59     KisConfigNotifier(const KisConfigNotifier&);
60     KisConfigNotifier operator=(const KisConfigNotifier&);
61 
62 private:
63     struct Private;
64     const QScopedPointer<Private> m_d;
65 };
66 
67 #endif // KIS_CONFIG_NOTIFIER_H_
68