Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_callback_based_paintop_property_impl.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_CALLBACK_BASED_PAINTOP_PROPERTY_IMPL_H
8#define __KIS_CALLBACK_BASED_PAINTOP_PROPERTY_IMPL_H
9
10#include <functional>
11
12template<class ParentClass>
14 typename ParentClass::SubType subType,
15 const KoID &id,
17 QObject *parent)
18 : ParentClass(type, subType, id, settings, parent)
19{
20}
21
22template<class ParentClass>
24 const KoID &id,
26 QObject *parent)
27 : ParentClass(type, id, settings, parent)
28{
29}
30
31template<class ParentClass>
33 : ParentClass(id, settings, parent)
34{
35}
36
37template <class ParentClass>
39{
40 m_readFunc = func;
41}
42
43template <class ParentClass>
45{
46 m_writeFunc = func;
47}
48
49template <class ParentClass>
51{
52 m_visibleFunc = func;
53}
54
55template <class ParentClass>
57{
58 if (m_readFunc) m_readFunc(this);
59}
60
61template <class ParentClass>
63{
64 if (m_writeFunc) m_writeFunc(this);
65}
66
67template <class ParentClass>
69{
70 return m_visibleFunc ? m_visibleFunc(this) : true;
71}
72
73#endif /* __KIS_CALLBACK_BASED_PAINTOP_PROPERTY_IMPL_H */
KisCallbackBasedPaintopProperty(typename ParentClass::Type type, typename ParentClass::SubType subType, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent)
Definition KoID.h:30