DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickdciicon_p.h
1// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKDCIICON_P_H
6#define DQUICKDCIICON_P_H
7
8#include <dtkdeclarative_global.h>
9
10#include <DObject>
11#include <DDciIconPalette>
12
13#include <QString>
14#include <QSharedData>
15
16#include "dquickdciiconimage_p.h"
17
18DQUICK_BEGIN_NAMESPACE
19DGUI_USE_NAMESPACE
20
21class DQuickDciIconPrivate;
23{
24 Q_GADGET
25 Q_PROPERTY(QString name READ name WRITE setName RESET resetName FINAL)
26 Q_PROPERTY(int width READ width WRITE setWidth RESET resetWidth FINAL)
27 Q_PROPERTY(int height READ height WRITE setHeight RESET resetHeight FINAL)
28 Q_PROPERTY(DTK_QUICK_NAMESPACE::DQMLGlobalObject::ControlState mode READ mode WRITE setMode RESET resetMode FINAL)
29 Q_PROPERTY(DTK_GUI_NAMESPACE::DGuiApplicationHelper::ColorType theme READ theme WRITE setTheme RESET resetTheme FINAL)
30 Q_PROPERTY(DTK_GUI_NAMESPACE::DDciIconPalette palette READ palette WRITE setPalette RESET resetTheme FINAL)
31 // for Qt icon
32 Q_PROPERTY(QUrl source READ source WRITE setSource RESET resetSource FINAL)
33 Q_PROPERTY(bool fallbackToQIcon READ fallbackToQIcon WRITE setFallbackToQIcon RESET resetFallbackToQIcon)
34#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
35 QML_ANONYMOUS
36#endif
37
38public:
40 DQuickDciIcon(const DQuickDciIcon &other);
42
43 DQuickDciIcon& operator=(const DQuickDciIcon &other);
44 bool operator==(const DQuickDciIcon &other) const;
45 bool operator!=(const DQuickDciIcon &other) const;
46
47 bool isEmpty() const;
48
49 QString name() const;
50 void setName(const QString &name);
51 void resetName();
52
53 int width() const;
54 void setWidth(int width);
55 void resetWidth();
56
57 int height() const;
58 void setHeight(int height);
59 void resetHeight();
60
61 DQMLGlobalObject::ControlState mode() const;
62 void setMode(DQMLGlobalObject::ControlState mode);
63 void resetMode();
64
65 DGuiApplicationHelper::ColorType theme() const;
66 void setTheme(DTK_GUI_NAMESPACE::DGuiApplicationHelper::ColorType theme);
67 void resetTheme();
68
69 DDciIconPalette palette() const;
70 void setPalette(const DDciIconPalette &palette);
71 void resetPalette();
72
73 const QUrl &source() const;
74 void setSource(const QUrl &newSource);
75 void resetSource();
76
77 bool fallbackToQIcon() const;
78 void setFallbackToQIcon(bool newFallbackToQIcon);
79 void resetFallbackToQIcon();
80
81private:
82 QSharedDataPointer<DQuickDciIconPrivate> d;
83};
84
85DQUICK_END_NAMESPACE
86#endif // DQUICKDCIICON_P_H
Definition dqmlglobalobject_p.h:114
A dci icon type for qml.
Definition dquickdciicon_p.h:23