DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dtitlebarsettings.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#pragma once
6
7#include <dtkwidget_global.h>
8#include <DObject>
9
10DWIDGET_BEGIN_NAMESPACE
11
12class LIBDTKWIDGETSHARED_EXPORT DTitlebarToolBaseInterface : public QObject
13{
14 Q_OBJECT
15public:
16 explicit DTitlebarToolBaseInterface(QObject *parent = nullptr) : QObject(parent) {}
18
19 virtual QString id() const = 0;
20 virtual QString description() = 0;
21 virtual QString iconName() = 0;
22};
23
24class LIBDTKWIDGETSHARED_EXPORT DTitleBarToolInterface : public DTitlebarToolBaseInterface {
25 Q_OBJECT
26public:
27 explicit DTitleBarToolInterface(QObject *parent = nullptr) : DTitlebarToolBaseInterface(parent) {}
28 virtual ~DTitleBarToolInterface(){}
29
30 virtual QWidget *createView() = 0;
31Q_SIGNALS:
32 void triggered();
33};
34
35class LIBDTKWIDGETSHARED_EXPORT DTitleBarSpacerInterface : public DTitlebarToolBaseInterface {
36 Q_OBJECT
37public:
38 explicit DTitleBarSpacerInterface(QObject *parent = nullptr) : DTitlebarToolBaseInterface(parent) {}
40
41 virtual QWidget *createPlaceholderView() = 0;
42 virtual int size() const = 0;
43};
44
47class DTitlebar;
48class LIBDTKWIDGETSHARED_EXPORT DTitlebarSettings : public DCORE_NAMESPACE::DObject
49{
50public:
51 explicit DTitlebarSettings(DTitlebar *titlebar);
52 bool initilize(QList<DTitlebarToolBaseInterface *> &tools, const QString &path);
53
54 QWidget *toolsEditPanel() const;
55
56private:
57 D_DECLARE_PRIVATE(DTitlebarSettings)
59 friend class DTitlebar;
60};
61
62DWIDGET_END_NAMESPACE
Definition dtitlebarsettings.h:35
Definition dtitlebarsettings.h:24
Definition dtitlebarsettingsimpl.h:135
Definition dtitlebarsettings.cpp:13
Definition dtitlebarsettings.h:49
Definition dtitlebarsettings.h:13
Dtitlebar是Dtk程序通用的标题栏组件,用于实现标题栏的高度定制化
Definition dtitlebar.h:24