Krita

PresetChooser.h
1/*
2 * SPDX-FileCopyrightText: 2017 Boudewijn Rempt <boud@valdyas.org>
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
17class 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 */
25class KRITALIBKIS_EXPORT PresetChooser : public KisPresetChooser
26{
27 Q_OBJECT
28public:
29 PresetChooser(QWidget *parent = 0);
30 ~PresetChooser() override {}
31
32public 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
45Q_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
57private Q_SLOTS:
58
59 void slotResourceSelected(KoResourceSP resource);
60 void slotResourceClicked(KoResourceSP resource);
61};
62
63#endif // PRESETCHOOSER_H
The PresetChooser widget wraps the KisPresetChooser widget.
void presetSelected(Resource resource)
Emitted whenever a user selects the given preset.
void presetClicked(Resource resource)
Emitted whenever a user clicks on the given preset.
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 Fri Nov 22 2024 12:06:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.