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 <QDebug>
11#include <KoResourceSignature.h>
12#include <KoEmbeddedResource.h>
13
14class KoResource;
16
17class KRITARESOURCES_EXPORT KoResourceLoadResult
18{
19public:
25public:
29
30 template <typename T, typename = typename std::is_convertible<T*, KoResource*>::type>
35
37 KoResourceLoadResult& operator=(const KoResourceLoadResult &rhs);
38
40
48 KoResourceSP resource() const noexcept;
49
54 template <typename T>
55 QSharedPointer<T> resource() const {
56 return this->resource().dynamicCast<T>();
57 }
58
67 KoEmbeddedResource embeddedResource() const noexcept;
68
74 KoResourceSignature signature() const;
75
83 Type type() const;
84
85private:
86 struct Private;
87 const QScopedPointer<Private> m_d;
88};
89
90KRITARESOURCES_EXPORT QDebug operator<<(QDebug debug, const KoResourceLoadResult &result);
91
92#endif // KORESOURCELOADRESULT_H
QSharedPointer< KoResource > KoResourceSP
KoResourceLoadResult(QSharedPointer< T > resource)
A simple wrapper object for the main information about the resource.