KDecoration2

decoratedclient.cpp
1/*
2 * SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6#include "decoratedclient.h"
7#include "private/decoratedclientprivate.h"
8#include "private/decorationbridge.h"
9
10#include <QColor>
11
12namespace KDecoration2
13{
14DecoratedClient::DecoratedClient(Decoration *parent, DecorationBridge *bridge)
15 : QObject()
16 , d(bridge->createClient(this, parent))
17{
18}
19
20DecoratedClient::~DecoratedClient() = default;
21
22bool DecoratedClient::isActive() const
23{
24 return d->isActive();
25}
26
28{
29 return d->caption();
30}
31
32bool DecoratedClient::isOnAllDesktops() const
33{
34 return d->isOnAllDesktops();
35}
36
37bool DecoratedClient::isShaded() const
38{
39 return d->isShaded();
40}
41
43{
44 return d->icon();
45}
46
47bool DecoratedClient::isMaximized() const
48{
49 return d->isMaximized();
50}
51
52bool DecoratedClient::isMaximizedHorizontally() const
53{
54 return d->isMaximizedHorizontally();
55}
56
57bool DecoratedClient::isMaximizedVertically() const
58{
59 return d->isMaximizedVertically();
60}
61
62bool DecoratedClient::isKeepAbove() const
63{
64 return d->isKeepAbove();
65}
66
67bool DecoratedClient::isKeepBelow() const
68{
69 return d->isKeepBelow();
70}
71
72bool DecoratedClient::isCloseable() const
73{
74 return d->isCloseable();
75}
76
77bool DecoratedClient::isMaximizeable() const
78{
79 return d->isMaximizeable();
80}
81
82bool DecoratedClient::isMinimizeable() const
83{
84 return d->isMinimizeable();
85}
86
88{
89 return d->providesContextHelp();
90}
91
92bool DecoratedClient::isModal() const
93{
94 return d->isModal();
95}
96
97bool DecoratedClient::isShadeable() const
98{
99 return d->isShadeable();
100}
101
102bool DecoratedClient::isMoveable() const
103{
104 return d->isMoveable();
105}
106
107bool DecoratedClient::isResizeable() const
108{
109 return d->isResizeable();
110}
111
112WId DecoratedClient::windowId() const
113{
114 return d->windowId();
115}
116
117WId DecoratedClient::decorationId() const
118{
119 return d->decorationId();
120}
121
122int DecoratedClient::width() const
123{
124 return d->width();
125}
126
127int DecoratedClient::height() const
128{
129 return d->height();
130}
131
133{
134 return d->size();
135}
136
138{
139 return d->palette();
140}
141
143{
144 return d->adjacentScreenEdges();
145}
146
147QString DecoratedClient::windowClass() const
148{
149 return d->windowClass();
150}
151
153{
154 if (const auto *appMenuEnabledPrivate = dynamic_cast<ApplicationMenuEnabledDecoratedClientPrivate *>(d.get())) {
155 return appMenuEnabledPrivate->hasApplicationMenu();
156 }
157 return false;
158}
159
161{
162 if (const auto *appMenuEnabledPrivate = dynamic_cast<ApplicationMenuEnabledDecoratedClientPrivate *>(d.get())) {
163 return appMenuEnabledPrivate->isApplicationMenuActive();
164 }
165 return false;
166}
167
169{
170 return d->decoration();
171}
172
174{
175 return d->palette().color(group, role);
176}
177
179{
180 return d->color(group, role);
181}
182
184{
185 if (auto *appMenuEnabledPrivate = dynamic_cast<ApplicationMenuEnabledDecoratedClientPrivate *>(d.get())) {
186 appMenuEnabledPrivate->showApplicationMenu(actionId);
187 }
188}
189
190} // namespace
191
192#include "moc_decoratedclient.cpp"
QColor color(QPalette::ColorGroup group, QPalette::ColorRole role) const
Used to get colors in QPalette.
bool hasApplicationMenu
Whether the DecoratedClient has an application menu.
QIcon icon
The icon of the DecoratedClient.
int width
The width of the DecoratedClient.
QPalette palette
The palette this DecoratedClient uses.
Qt::Edges adjacentScreenEdges
The Edges which are adjacent to a screen edge.
QString caption
The caption of the DecoratedClient.
void showApplicationMenu(int actionId)
Request the application menu to be shown to the user.
bool providesContextHelp
Whether the DecoratedClient provides context help.
KDecoration2::Decoration * decoration
The Decoration of this DecoratedClient.
bool isApplicationMenuActive() const
Whether the application menu for this DecoratedClient is currently shown to the user The Decoration c...
QSize size
The size of the DecoratedClient.
int height
The height of the DecoratedClient.
Base class for the Decoration.
Definition decoration.h:58
Framework for creating window decorations.
ColorRole
Color roles are used for DecoratedClient::color().
ColorGroup
Color groups are used for DecoratedClient::color().
typedef Edges
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:55:15 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.