Yuhang Zhao
2023-12-21 0e9c2e428fb61953fd8f152125897646fe6fd337
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef WINDOWAGENTBASE_H
#define WINDOWAGENTBASE_H
 
#include <memory>
 
#include <QtCore/QObject>
 
#include <QWKCore/qwkglobal.h>
 
namespace QWK {
 
    class WindowAgentBasePrivate;
 
    class QWK_CORE_EXPORT WindowAgentBase : public QObject {
        Q_OBJECT
        Q_DECLARE_PRIVATE(WindowAgentBase)
    public:
        ~WindowAgentBase() override;
 
        enum SystemButton {
            Unknown,
            WindowIcon,
            Help,
            Minimize,
            Maximize,
            Close,
            NumSystemButton,
        };
        Q_ENUM(SystemButton)
 
        QVariant windowAttribute(const QString &key) const;
        void setWindowAttribute(const QString &key, const QVariant &var);
 
    public Q_SLOTS:
        void showSystemMenu(const QPoint &pos); // Only available on Windows now
        void centralize();
        void raise();
 
    protected:
        explicit WindowAgentBase(WindowAgentBasePrivate &d, QObject *parent = nullptr);
 
        const std::unique_ptr<WindowAgentBasePrivate> d_ptr;
    };
 
}
 
#endif // WINDOWAGENTBASE_H