File indexing completed on 2025-02-02 04:15:57

0001 /*
0002  *  SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_PAINTOP_PRESET_UPDATE_PROXY_H
0008 #define __KIS_PAINTOP_PRESET_UPDATE_PROXY_H
0009 
0010 #include <QScopedPointer>
0011 #include <QObject>
0012 
0013 #include "kritaimage_export.h"
0014 
0015 
0016 /**
0017  * @brief The KisPaintOpPresetUpdateProxy class
0018  */
0019 class KRITAIMAGE_EXPORT KisPaintOpPresetUpdateProxy : public QObject
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     KisPaintOpPresetUpdateProxy();
0025     ~KisPaintOpPresetUpdateProxy() override;
0026 
0027     void notifySettingsChanged();
0028     void notifyUniformPropertiesChanged();
0029 
0030     /**
0031      * Blocks all sigSettingsChanged() signals until unpostponeSettingsChanges()
0032      * is called. Used to perform "atomic" writing operations.
0033      *
0034      * @see unpostponeSettingsChanges()
0035      */
0036     void postponeSettingsChanges();
0037 
0038     /**
0039      * Unblocks sigSettingsChanged() and emits one signal if there were at least one
0040      * dropped signal while the block was held.
0041      */
0042     void unpostponeSettingsChanges();
0043 
0044 Q_SIGNALS:
0045     void sigSettingsChanged();
0046 
0047     /**
0048      * Uncompressed signals are delivered in two stages. Firstly,
0049      * the early warning version is emitted, then the normal. The
0050      * early warning version is needed to let critical code, like
0051      * KisPresetShadowUpdater, to perform necessary actions before
0052      * other receivers got the notification. Don't use it unless
0053      * you know what you are doing. Use normal
0054      * sigSettingsChangedUncompressed() instead.
0055      */
0056     void sigSettingsChangedUncompressedEarlyWarning();
0057     void sigSettingsChangedUncompressed();
0058     void sigUniformPropertiesChanged();
0059 
0060 private Q_SLOTS:
0061     void slotDeliverSettingsChanged();
0062 
0063 private:
0064     struct Private;
0065     const QScopedPointer<Private> m_d;
0066 };
0067 
0068 #endif /* __KIS_PAINTOP_PRESET_UPDATE_PROXY_H */