/usr/include/KDecoration2/kdecoration2/decorationsettings.h is in libkdecorations2-dev 4:5.8.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | /*
* Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KDECORATION2_DECORATION_SETTINGS_H
#define KDECORATION2_DECORATION_SETTINGS_H
#include <kdecoration2/kdecoration2_export.h>
#include "decorationbutton.h"
#include <QObject>
#include <QFontMetricsF>
#include <memory>
namespace KDecoration2
{
class DecorationBridge;
class DecorationSettingsPrivate;
/**
* @brief Common settings for the Decoration.
*
* This class gets injected into the Decoration and provides recommendations for the
* Decoration. The Decoration is suggested to honor the settings, but may decide that some
* settings don't fit the design and ignore them.
*
* @see Decoration
**/
class KDECORATIONS2_EXPORT DecorationSettings : public QObject
{
Q_OBJECT
/**
* Whether the feature to put a DecoratedClient on all desktops is available.
*
* If this feature is not available a Decoration might decide to not show the
* DecorationButtonType::OnAllDesktops.
**/
Q_PROPERTY(bool onAllDesktopsAvailable READ isOnAllDesktopsAvailable NOTIFY onAllDesktopsAvailableChanged)
/**
* Whether the Decoration will be rendered with an alpha channel.
*
* If no alpha channel is available a Decoration should not use round borders.
**/
Q_PROPERTY(bool alphaChannelSupported READ isAlphaChannelSupported NOTIFY alphaChannelSupportedChanged)
/**
* Whether the Decoration should close the DecoratedClient when double clicking on the
* DecorationButtonType::Menu.
**/
Q_PROPERTY(bool closeOnDoubleClickOnMenu READ isCloseOnDoubleClickOnMenu NOTIFY closeOnDoubleClickOnMenuChanged)
/**
* The suggested ordering of the decoration buttons on the left.
**/
Q_PROPERTY(QVector<KDecoration2::DecorationButtonType> decorationButtonsLeft READ decorationButtonsLeft NOTIFY decorationButtonsLeftChanged)
/**
* The suggested ordering of the decoration buttons on the right.
**/
Q_PROPERTY(QVector<KDecoration2::DecorationButtonType> decorationButtonsRight READ decorationButtonsRight NOTIFY decorationButtonsRightChanged)
/**
* The suggested border size.
**/
Q_PROPERTY(KDecoration2::BorderSize borderSize READ borderSize NOTIFY borderSizeChanged)
/**
* The fundamental unit of space that should be used for sizes, expressed in pixels.
* Given the screen has an accurate DPI settings, it corresponds to a millimeter
*/
Q_PROPERTY(int gridUnit READ gridUnit NOTIFY gridUnitChanged)
/**
* The recommended font for the Decoration's caption.
**/
Q_PROPERTY(QFont font READ font NOTIFY fontChanged)
/**
* smallSpacing is the amount of spacing that should be used around smaller UI elements,
* for example as spacing in Columns. Internally, this size depends on the size of
* the default font as rendered on the screen, so it takes user-configured font size and DPI
* into account.
*/
Q_PROPERTY(int smallSpacing READ smallSpacing NOTIFY spacingChanged)
/**
* largeSpacing is the amount of spacing that should be used inside bigger UI elements,
* for example between an icon and the corresponding text. Internally, this size depends on
* the size of the default font as rendered on the screen, so it takes user-configured font
* size and DPI into account.
*/
Q_PROPERTY(int largeSpacing READ largeSpacing NOTIFY spacingChanged)
public:
explicit DecorationSettings(DecorationBridge *bridge, QObject *parent = nullptr);
virtual ~DecorationSettings();
bool isOnAllDesktopsAvailable() const;
bool isAlphaChannelSupported() const;
bool isCloseOnDoubleClickOnMenu() const;
QVector<DecorationButtonType> decorationButtonsLeft() const;
QVector<DecorationButtonType> decorationButtonsRight() const;
BorderSize borderSize() const;
QFont font() const;
/**
* The fontMetrics for the recommended font.
* @see font
**/
QFontMetricsF fontMetrics() const;
int gridUnit() const;
int smallSpacing() const;
int largeSpacing() const;
Q_SIGNALS:
void onAllDesktopsAvailableChanged(bool);
void alphaChannelSupportedChanged(bool);
void closeOnDoubleClickOnMenuChanged(bool);
void decorationButtonsLeftChanged(const QVector<KDecoration2::DecorationButtonType>&);
void decorationButtonsRightChanged(const QVector<KDecoration2::DecorationButtonType>&);
void borderSizeChanged(KDecoration2::BorderSize size);
void fontChanged(const QFont &font);
void gridUnitChanged(int);
void spacingChanged();
/**
* This signal is emitted when the backend got reconfigured.
* If the plugin uses custom settings, it is recommended to re-read
* them after this signal got emitted.
**/
void reconfigured();
private:
const std::unique_ptr<DecorationSettingsPrivate> d;
};
}
Q_DECLARE_METATYPE(KDecoration2::BorderSize)
#endif
|