Debian Codegraph @

kysdk-qtwidgets/src/kaboutdialog.h

raw
1 /*
2 * libkysdk-qtwidgets's Library
3 *
4 * Copyright (C) 2023, KylinSoft Co., Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this library. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * Authors: Zhen Sun <[email protected]>
20 *
21 */
22
23 #ifndef KABOUTDIALOG_H
24 #define KABOUTDIALOG_H
25
26 #include "gui_g.h"
27 #include "kdialog.h"
28 #include "themeController.h"
29 #include <QDialog>
30 #include <QIcon>
31 #include <QString>
32
33 namespace kdk
34 {
35 /** @defgroup DialogBoxModule
36 * @{
37 */
38 class KAboutDialogPrivate;
39
40 /**
41 * @brief 关于对话框,支持两种样式,一种是无特定说明的,另一种是有特定说明的。
42 * @since 1.0.0
43 */
44 class GUI_EXPORT KAboutDialog : public KDialog
45 {
46 Q_OBJECT
47
48 public:
49 KAboutDialog(QWidget *parent = nullptr, const QIcon &appIcon = QIcon(), const QString &appName = "", const QString &appVersion = "", const QString &appInfo = "");
50 ~KAboutDialog();
51
52 /**
53 * @brief 设置应用程序图标
54 * @param icon
55 */
56 void setAppIcon(const QIcon &icon);
57
58 /**
59 * @brief 设置应用程序名称
60 * @param appName
61 */
62 void setAppName(const QString &appName);
63
64 /**
65 * @brief 获取应用程序名称
66 * @return
67 */
68 QString appName();
69
70 /**
71 * @brief 设置应用程序版本号
72 * @param appVersion
73 */
74 void setAppVersion(const QString &appVersion);
75
76 /**
77 * @brief 获取应用程序版本号
78 * @return
79 */
80 QString appVersion();
81
82 /**
83 * @brief 设置具体的说明内容
84 * @param bodyText
85 */
86 void setBodyText(const QString &bodyText);
87
88 /**
89 * @brief 获取具体的说明内容
90 * @return
91 */
92 QString bodyText();
93
94 /**
95 * @brief 设置服务与支持邮箱,有默认缺省
96 * @param appSupport
97 */
98 void setAppSupport(const QString &appSupport);
99
100 /**
101 * @brief 获取服务与支持邮箱
102 * @return
103 */
104 QString appSupport();
105
106 /**
107 * @brief 设置是否显示说明内容,应设计要求,1.2.0.9中不再显示说明内容
108 * @param flag
109 */
110 void setBodyTextVisiable(bool flag);
111
112 /**
113 * @brief 设置隐私按钮是否可见
114 * @param flag
115 * @since 1.2.0
116 */
117 void setAppPrivacyLabelVisible(bool flag);
118
119 /**
120 * @brief 返回隐私按钮是否可见
121 * @return
122 * @since 1.2.0
123 */
124 bool AppPrivacyLabelIsVisible();
125
126 protected:
127 void changeTheme() override;
128 void paintEvent(QPaintEvent *paintEvent) override;
129
130 private:
131 Q_DECLARE_PRIVATE(KAboutDialog)
132 KAboutDialogPrivate *const d_ptr;
133 };
134 }
135 /**
136 * @example testDialog/widget.h
137 * @example testDialog/widget.cpp
138 * @}
139 */
140 #endif