1 /*
2     KWin - the KDE window manager
3     This file is part of the KDE project.
4 
5     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
6 
7     SPDX-License-Identifier: GPL-2.0-or-later
8 */
9 #ifndef KWIN_DECORATION_SETTINGS_H
10 #define KWIN_DECORATION_SETTINGS_H
11 
12 #include <KDecoration2/Private/DecorationSettingsPrivate>
13 
14 #include <QObject>
15 
16 class KConfigGroup;
17 
18 namespace KWin
19 {
20 namespace Decoration
21 {
22 
23 class SettingsImpl : public QObject, public KDecoration2::DecorationSettingsPrivate
24 {
25     Q_OBJECT
26 public:
27     explicit SettingsImpl(KDecoration2::DecorationSettings *parent);
28     ~SettingsImpl() override;
29     bool isAlphaChannelSupported() const override;
30     bool isOnAllDesktopsAvailable() const override;
31     bool isCloseOnDoubleClickOnMenu() const override;
borderSize()32     KDecoration2::BorderSize borderSize() const override {
33         return m_borderSize;
34     }
decorationButtonsLeft()35     QVector< KDecoration2::DecorationButtonType > decorationButtonsLeft() const override {
36         return m_leftButtons;
37     }
decorationButtonsRight()38     QVector< KDecoration2::DecorationButtonType > decorationButtonsRight() const override {
39         return m_rightButtons;
40     }
font()41     QFont font() const override {
42         return m_font;
43     }
44 
45 private:
46     void readSettings();
47     QVector< KDecoration2::DecorationButtonType > readDecorationButtons(const KConfigGroup &config,
48                                                                       const char *key,
49                                                                       const QVector< KDecoration2::DecorationButtonType > &defaultValue) const;
50     QVector< KDecoration2::DecorationButtonType > m_leftButtons;
51     QVector< KDecoration2::DecorationButtonType > m_rightButtons;
52     KDecoration2::BorderSize m_borderSize;
53     bool m_autoBorderSize = true;
54     bool m_closeDoubleClickMenu = false;
55     QFont m_font;
56 };
57 } // Decoration
58 } // KWin
59 
60 #endif
61