Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_favorite_resource_manager.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 SPDX-FileCopyrightText: 2009 Vera Lukman <shicmap@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-only
5*/
6
7#ifndef KIS_FAVORITE_RESOURCE_MANAGER_H
8#define KIS_FAVORITE_RESOURCE_MANAGER_H
9
10#include <QObject>
11#include <kis_types.h>
12#include <QQueue>
13#include <QList>
14#include "KoResourceServer.h"
15#include <KisTag.h>
17
18#include <KoColor.h>
19#include <KoResource.h>
20
21class QString;
22class KisPaintopBox;
24template <typename T>
26
27class KisFavoriteResourceManager : public QObject, public KoResourceServerObserver<KisPaintOpPreset>
28{
29 Q_OBJECT
30
31public:
32
35
36 void unsetResourceServer() override;
37
40
41 void setCurrentTag(const KisTagSP tag);
42
44
46
48 KoColor recentColorAt(int pos);
49
50 // Reimplemented from KoResourceServerObserver
52 void resourceAdded(QSharedPointer<KisPaintOpPreset> resource) override;
54
55 //BgColor;
56 KoColor bgColor() const;
57
58
59Q_SIGNALS:
60
61 void sigSetFGColor(const KoColor& c);
62 void sigSetBGColor(const KoColor& c);
63
65
67
69
71
72public Q_SLOTS:
73
75
76 /*update the priority of a color in m_colorList, used only by m_popupPalette*/
77 void slotUpdateRecentColor(int);
78
79 /*add a color to m_colorList, used by KisCanvasResourceProvider*/
80 void slotAddRecentColor(const KoColor&);
81
83
84 void slotSetBGColor(const KoColor c);
85
87 void slotClearHistory();
88
89private Q_SLOTS:
90
91 void configChanged();
92 void presetsChanged();
93
94private:
95 static const int MAX_RECENT_COLOR;
96
97 void init();
98
100
102
105
106 bool m_initialized {false};
107
109
113 QScopedPointer<KisSortedHistoryList<KoColor>> m_colorHistoryList;
114
115};
116
117#endif
void resourceChanged(QSharedPointer< KisPaintOpPreset > resource) override
void sigSetBGColor(const KoColor &c)
void resourceAdded(QSharedPointer< KisPaintOpPreset > resource) override
void sigChangeFGColorSelector(const KoColor &)
KisFavoriteResourceManager(KisPaintopBox *paintopBox)
void removingResource(QSharedPointer< KisPaintOpPreset > resource) override
KisTagFilterResourceProxyModel * m_resourcesProxyModel
QScopedPointer< KisSortedHistoryList< KoColor > > m_colorHistoryList
void sigSetFGColor(const KoColor &c)
The KisResourceModel class provides the main access to resources. It is possible to filter the resour...
The KisTagFilterResourceProxyModel class filters the resources by tag or resource name.