File indexing completed on 2024-05-19 16:34:03

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include <KDecoration2/Private/DecorationSettingsPrivate>
0012 
0013 #include <QObject>
0014 
0015 class KConfigGroup;
0016 
0017 namespace KWin
0018 {
0019 namespace Decoration
0020 {
0021 
0022 class SettingsImpl : public QObject, public KDecoration2::DecorationSettingsPrivate
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit SettingsImpl(KDecoration2::DecorationSettings *parent);
0027     ~SettingsImpl() override;
0028     bool isAlphaChannelSupported() const override;
0029     bool isOnAllDesktopsAvailable() const override;
0030     bool isCloseOnDoubleClickOnMenu() const override;
0031     KDecoration2::BorderSize borderSize() const override
0032     {
0033         return m_borderSize;
0034     }
0035     QVector<KDecoration2::DecorationButtonType> decorationButtonsLeft() const override
0036     {
0037         return m_leftButtons;
0038     }
0039     QVector<KDecoration2::DecorationButtonType> decorationButtonsRight() const override
0040     {
0041         return m_rightButtons;
0042     }
0043     QFont font() const override
0044     {
0045         return m_font;
0046     }
0047 
0048 private:
0049     void readSettings();
0050     QVector<KDecoration2::DecorationButtonType> readDecorationButtons(const KConfigGroup &config,
0051                                                                       const char *key,
0052                                                                       const QVector<KDecoration2::DecorationButtonType> &defaultValue) const;
0053     QVector<KDecoration2::DecorationButtonType> m_leftButtons;
0054     QVector<KDecoration2::DecorationButtonType> m_rightButtons;
0055     KDecoration2::BorderSize m_borderSize;
0056     bool m_autoBorderSize = true;
0057     bool m_closeDoubleClickMenu = false;
0058     QFont m_font;
0059 };
0060 } // Decoration
0061 } // KWin