Krita

PresetChooser.h
1 /*
2  * SPDX-FileCopyrightText: 2017 Boudewijn Rempt <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 #ifndef PRESETCHOOSER_H
7 #define PRESETCHOOSER_H
8 
9 #include <QObject>
10 #include <QWidget>
11 
12 #include <kis_preset_chooser.h>
13 
14 #include "kritalibkis_export.h"
15 #include "libkis.h"
16 
17 class Resource;
18 
19 /**
20  * @brief The PresetChooser widget wraps the KisPresetChooser widget.
21  * The widget provides for selecting brush presets. It has a tagging
22  * bar and a filter field. It is not automatically synchronized with
23  * the currently selected preset in the current Windows.
24  */
25 class KRITALIBKIS_EXPORT PresetChooser : public KisPresetChooser
26 {
27  Q_OBJECT
28 public:
29  PresetChooser(QWidget *parent = 0);
30  ~PresetChooser() override {}
31 
32 public Q_SLOTS:
33 
34  /**
35  * Make the given preset active.
36  */
37  void setCurrentPreset(Resource *resource);
38 
39  /**
40  * @return a Resource wrapper around the currently selected
41  * preset.
42  */
43  Resource *currentPreset() const;
44 
45 Q_SIGNALS:
46 
47  /**
48  * Emitted whenever a user selects the given preset.
49  */
50  void presetSelected(Resource resource);
51 
52  /**
53  * Emitted whenever a user clicks on the given preset.
54  */
55  void presetClicked(Resource resource);
56 
57 private Q_SLOTS:
58 
59  void slotResourceSelected(KoResourceSP resource);
60  void slotResourceClicked(KoResourceSP resource);
61 };
62 
63 #endif // PRESETCHOOSER_H
A Resource represents a gradient, pattern, brush tip, brush preset, palette or workspace definition.
Definition: Resource.h:30
The PresetChooser widget wraps the KisPresetChooser widget.
Definition: PresetChooser.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 03:58:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.