DtkGui 5.5.23
DTK Gui module
dicontheme.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DICONTHEME_H
6#define DICONTHEME_H
7
8#include <dtkgui_global.h>
9
10#include <QScopedPointer>
11#include <QIcon>
12
13DGUI_BEGIN_NAMESPACE
14
15namespace DIconTheme
16{
17 enum Option {
18 DontFallbackToQIconFromTheme = 1 << 0,
19 IgnoreBuiltinIcons = 1 << 1
20 };
21 Q_DECLARE_FLAGS(Options, Option)
22
23 class CachedData;
24 class Cached {
25 CachedData *data = nullptr;
26 public:
27 Cached();
28 ~Cached();
29
30 int maxCost() const;
31 void setMaxCost(int cost);
32 void clear();
33
34 QIcon findQIcon(const QString &iconName, Options options = Options(), const QIcon &fallback = QIcon());
35 QString findDciIconFile(const QString &iconName, const QString &themeName, const QString &fallback = {});
36 };
37
38 Cached *cached();
39 QIcon findQIcon(const QString &iconName, Options options = Options());
40
41 QString findDciIconFile(const QString &iconName, const QString &themeName);
42
43 QStringList dciThemeSearchPaths();
44 void setDciThemeSearchPaths(const QStringList &path);
45
46 bool isBuiltinIcon(const QIcon &icon);
47 bool isXdgIcon(const QIcon &icon);
48}
49
50DGUI_END_NAMESPACE
51
52#endif // DICONTHEME_H
Definition: dicontheme.cpp:148
Definition: dicontheme.h:24