Debian Codegraph @

libs/image/brushengine/kis_locked_properties_proxy.h

raw symbols SCIP
1 /*
2 * SPDX-FileCopyrightText: 2014 Dmitry Kazakov <[email protected]>
3 * SPDX-FileCopyrightText: 2014 Mohit Goyal <[email protected]>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 #ifndef KIS_LOCKED_PROPERTIES_PROXY_H
8 #define KIS_LOCKED_PROPERTIES_PROXY_H
9
10 #include "kis_properties_configuration.h"
11
12 /**
13 * This class acts as a proxy for all transfers between KisLockedPropertiesServer
14 * and KisPaintOpSettings while using setConfiguration and writeConfiguration
15 * methods. It is used to override the local settings of a * paintop with the
16 * settings present in the KisLockedProperties List.
17 *
18 * Settings with the "_previous" suffix are used to save the local settings of
19 * a preset in the preset itself. Whenever the user selects the option of going
20 * back to the previous configuration of the preset or "unlocks" an option
21 * -- these settings are restored and the settings with the "_previous"
22 * suffix are destroyed.
23 */
24 class KisLockedPropertiesServer;
25
26 class KRITAIMAGE_EXPORT KisLockedPropertiesProxy: public KisPropertiesConfiguration
27 {
28 public:
29 KisLockedPropertiesProxy(KisPropertiesConfiguration *, KisLockedPropertiesSP);
30 ~KisLockedPropertiesProxy() override;
31
32 using KisPropertiesConfiguration::getProperty;
33 QVariant getProperty(const QString &name) const override;
34 using KisPropertiesConfiguration::setProperty;
35 void setProperty(const QString & name, const QVariant & value) override;
36
37 bool hasProperty(const QString& name) const override;
38
39 QList<QString> getPropertiesKeys() const override;
40
41 void dump() const override;
42
43 private:
44 Q_DISABLE_COPY(KisLockedPropertiesProxy)
45 mutable KisLockedPropertiesSP m_lockedProperties;
46 KisPropertiesConfiguration* m_parent;
47 };
48
49 typedef KisPinnedSharedPtr<KisLockedPropertiesProxy> KisLockedPropertiesProxySP;
50 typedef KisWeakSharedPtr<KisLockedPropertiesProxy> KisLockedPropertiesProxyWSP;
51
52 #endif // KIS_LOCKED_PROPERTIES_PROXY_H