Krita Source Code Documentation
Loading...
Searching...
No Matches
KoResourceLoadResult.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KORESOURCELOADRESULT_H
7#define KORESOURCELOADRESULT_H
8
9#include <QSharedPointer>
10#include <KoResourceSignature.h>
11#include <KoEmbeddedResource.h>
12
13class KoResource;
15
16class KRITARESOURCES_EXPORT KoResourceLoadResult
17{
18public:
24public:
28
29 template <typename T, typename = typename std::is_convertible<T*, KoResource*>::type>
34
36 KoResourceLoadResult& operator=(const KoResourceLoadResult &rhs);
37
39
47 KoResourceSP resource() const noexcept;
48
53 template <typename T>
54 QSharedPointer<T> resource() const {
55 return this->resource().dynamicCast<T>();
56 }
57
66 KoEmbeddedResource embeddedResource() const noexcept;
67
73 KoResourceSignature signature() const;
74
82 Type type() const;
83
84private:
85 struct Private;
86 const QScopedPointer<Private> m_d;
87};
88
89#endif // KORESOURCELOADRESULT_H
QSharedPointer< KoResource > KoResourceSP
KoResourceLoadResult(QSharedPointer< T > resource)
A simple wrapper object for the main information about the resource.