Krita Source Code Documentation
Loading...
Searching...
No Matches
Resource.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef LIBKIS_RESOURCE_H
7#define LIBKIS_RESOURCE_H
8
9#include <QObject>
10#include <QScopedPointer>
11#include <kis_types.h>
12#include "kritalibkis_export.h"
13#include "libkis.h"
14#include <KoResource.h>
15
30class KRITALIBKIS_EXPORT Resource : public QObject
31{
32 Q_OBJECT
33
34public:
35 Resource(int resourceId, const QString &type, const QString &name, const QString &filename, const QImage &image, QObject *parent = 0);
36 Resource(KoResourceSP resource, const QString &type, QObject *parent = 0);
37 ~Resource() override;
38 Resource(const Resource &rhs);
39
40 bool operator==(const Resource &other) const;
41 bool operator!=(const Resource &other) const;
42 Resource operator=(const Resource &rhs);
43
44
45public Q_SLOTS:
46
58 QString type() const;
59
63 QString name() const;
64
68 void setName(QString value);
69
74 QString filename() const;
75
82 QImage image() const;
83
87 void setImage(QImage image);
88
89private:
90
91 friend class PresetChooser;
92 friend class View;
93 friend class Palette;
94 friend class Preset;
95 KoResourceSP resource() const;
96
97 struct Private;
98 QScopedPointer<Private> d;
99
100};
101
102#endif // LIBKIS_RESOURCE_H
float value(const T *src, size_t ch)
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
bool operator!=(const KoID &v1, const KoID &v2)
Definition KoID.h:103
The Palette class Palette is a resource object that stores organised color data. It's purpose is to a...
Definition Palette.h:44
The PresetChooser widget wraps the KisPresetChooser widget. The widget provides for selecting brush p...
The Preset class Preset is a resource object that stores brush preset data.
Definition Preset.h:35
QScopedPointer< Private > d
Definition Resource.h:98
Definition View.h:25