File indexing completed on 2024-05-12 15:58:24

0001 /*
0002  *  SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_LAYER_PROPERTIES_ICONS_H
0008 #define __KIS_LAYER_PROPERTIES_ICONS_H
0009 
0010 #include <QScopedPointer>
0011 #include <KoID.h>
0012 
0013 #include <kis_base_node.h>
0014 #include "kritaimage_export.h"
0015 
0016 class KRITAIMAGE_EXPORT KisLayerPropertiesIcons
0017 {
0018 public:
0019     KisLayerPropertiesIcons();
0020     ~KisLayerPropertiesIcons();
0021 
0022     static const KoID locked;
0023     static const KoID visible;
0024     static const KoID layerStyle;
0025     static const KoID inheritAlpha;
0026     static const KoID alphaLocked;
0027     static const KoID onionSkins;
0028     static const KoID passThrough;
0029     static const KoID selectionActive;
0030     static const KoID colorLabelIndex;
0031     static const KoID colorizeNeedsUpdate;
0032     static const KoID colorizeEditKeyStrokes;
0033     static const KoID colorizeShowColoring;
0034     static const KoID openFileLayerFile;
0035     static const KoID layerError;
0036 
0037     static KisLayerPropertiesIcons* instance();
0038 
0039     static KisBaseNode::Property getProperty(const KoID &id, bool state);
0040     static KisBaseNode::Property getProperty(const KoID &id, bool state,
0041                                               bool isInStasis, bool stateInStasis);
0042 
0043     static KisBaseNode::Property getErrorProperty(const QString &message);
0044 
0045     /**
0046      * Sets the specified property of the node and updates it
0047      */
0048     static void setNodePropertyAutoUndo(KisNodeSP node, const KoID &id, const QVariant &value, KisImageSP image);
0049     static void setNodeProperty(KisBaseNode::PropertyList *props, const KoID &id, const QVariant &value);
0050 
0051     /**
0052      * Gets the specified property of the node
0053      */
0054     static QVariant nodeProperty(KisNodeSP node, const KoID &id, const QVariant &defaultValue);
0055 
0056     void updateIcons();
0057 
0058 private:
0059     struct Private;
0060     const QScopedPointer<Private> m_d;
0061 };
0062 
0063 #endif /* __KIS_LAYER_PROPERTIES_ICONS_H */