Krita

Preset.h
1
2/*
3 * SPDX-FileCopyrightText: 2017 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
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
24from krita import *
25
26view = Krita.instance().activeWindow().activeView()
27preset = Preset(view.currentBrushPreset())
28
29print ( preset.toXML() )
30
31 * @endcode
32 */
33
34class KRITALIBKIS_EXPORT Preset : public QObject
35{
36public:
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
54private:
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
The Preset class Preset is a resource object that stores brush preset data.
Definition Preset.h:35
A Resource represents a gradient, pattern, brush tip, brush preset, palette or workspace definition.
Definition Resource.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:47:29 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.