Krita

Preset.h
1 
2 /*
3  * SPDX-FileCopyrightText: 2017 Wolthera van Hövell tot Westerflier <[email protected]>
4  *
5  * SPDX-License-Identifier: LGPL-2.0-or-later
6  */
7 
8 #ifndef LIBKIS_PRESET_H
9 #define LIBKIS_PRESET_H
10 
11 #include "kritalibkis_export.h"
12 #include "libkis.h"
13 #include "Resource.h"
14 #include <kis_types.h>
15 #include <kis_paintop_preset.h>
16 
17 /**
18  * @brief The Preset class
19  * Preset is a resource object that stores brush preset data.
20  *
21  * An example for printing the current brush preset and all its settings:
22  *
23  * @code
24 from krita import *
25 
26 view = Krita.instance().activeWindow().activeView()
27 preset = Preset(view.currentBrushPreset())
28 
29 print ( preset.toXML() )
30 
31  * @endcode
32  */
33 
34 class KRITALIBKIS_EXPORT Preset : public QObject
35 {
36 public:
37  Preset(Resource *resource);
38  ~Preset() override;
39 
40  /**
41  * @brief toXML
42  * convert the preset settings into a preset formatted xml.
43  * @return the xml in a string.
44  */
45  QString toXML() const;
46 
47  /**
48  * @brief fromXML
49  * convert the preset settings into a preset formatted xml.
50  * @param xml valid xml preset string.
51  */
52  void fromXML(const QString &xml);
53 
54 private:
55  struct Private;
56  Private *const d;
57 
58  /**
59  * @brief paintOpPreset
60  * @return gives a KisPaintOpPreset object back
61  */
62  KisPaintOpPresetSP paintOpPreset();
63 
64 };
65 
66 #endif // LIBKIS_PRESET_H
A Resource represents a gradient, pattern, brush tip, brush preset, palette or workspace definition.
Definition: Resource.h:30
The Preset class Preset is a resource object that stores brush preset data.
Definition: Preset.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Dec 4 2022 04:12:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.