KDecoration3

decoratedwindow.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 "decoratedwindow.h"
7#include "private/decoratedwindowprivate.h"
8#include "private/decorationbridge.h"
9#include "scalehelpers.h"
10
11#include <QColor>
12
13namespace KDecoration3
14{
15DecoratedWindow::DecoratedWindow(Decoration *parent, DecorationBridge *bridge)
16 : QObject()
17 , d(bridge->createClient(this, parent))
18{
19}
20
21DecoratedWindow::~DecoratedWindow() = default;
22
23bool DecoratedWindow::isActive() const
24{
25 return d->isActive();
26}
27
29{
30 return d->caption();
31}
32
33bool DecoratedWindow::isOnAllDesktops() const
34{
35 return d->isOnAllDesktops();
36}
37
38bool DecoratedWindow::isShaded() const
39{
40 return d->isShaded();
41}
42
44{
45 return d->icon();
46}
47
48bool DecoratedWindow::isMaximized() const
49{
50 return d->isMaximized();
51}
52
53bool DecoratedWindow::isMaximizedHorizontally() const
54{
55 return d->isMaximizedHorizontally();
56}
57
58bool DecoratedWindow::isMaximizedVertically() const
59{
60 return d->isMaximizedVertically();
61}
62
63bool DecoratedWindow::isKeepAbove() const
64{
65 return d->isKeepAbove();
66}
67
68bool DecoratedWindow::isKeepBelow() const
69{
70 return d->isKeepBelow();
71}
72
73bool DecoratedWindow::isCloseable() const
74{
75 return d->isCloseable();
76}
77
78bool DecoratedWindow::isMaximizeable() const
79{
80 return d->isMaximizeable();
81}
82
83bool DecoratedWindow::isMinimizeable() const
84{
85 return d->isMinimizeable();
86}
87
89{
90 return d->providesContextHelp();
91}
92
93bool DecoratedWindow::isModal() const
94{
95 return d->isModal();
96}
97
98bool DecoratedWindow::isShadeable() const
99{
100 return d->isShadeable();
101}
102
103bool DecoratedWindow::isMoveable() const
104{
105 return d->isMoveable();
106}
107
108bool DecoratedWindow::isResizeable() const
109{
110 return d->isResizeable();
111}
112
113qreal DecoratedWindow::width() const
114{
115 return d->width();
116}
117
118qreal DecoratedWindow::height() const
119{
120 return d->height();
121}
122
124{
125 return d->size();
126}
127
129{
130 return d->palette();
131}
132
134{
135 return d->adjacentScreenEdges();
136}
137
138QString DecoratedWindow::windowClass() const
139{
140 return d->windowClass();
141}
142
144{
145 return d->hasApplicationMenu();
146}
147
149{
150 return d->isApplicationMenuActive();
151}
152
154{
155 return d->decoration();
156}
157
159{
160 return d->palette().color(group, role);
161}
162
164{
165 return d->color(group, role);
166}
167
169{
170 d->showApplicationMenu(actionId);
171}
172
174{
175 return d->scale();
176}
177
179{
180 return d->nextScale();
181}
182
184{
185 return ::KDecoration3::pixelSize(scale());
186}
187
188qreal DecoratedWindow::snapToPixelGrid(qreal value) const
189{
190 return ::KDecoration3::snapToPixelGrid(value, d->scale());
191}
192
194{
195 return ::KDecoration3::snapToPixelGrid(value, d->scale());
196}
197
199{
200 return ::KDecoration3::snapToPixelGrid(value, d->scale());
201}
202
204{
205 return ::KDecoration3::snapToPixelGrid(value, d->scale());
206}
207
208} // namespace
209
210#include "moc_decoratedwindow.cpp"
qreal snapToPixelGrid(qreal value) const
snaps the logical geometry value to a fractional logical geometry value that aligns to the pixel grid...
bool isApplicationMenuActive() const
Whether the application menu for this DecoratedWindow is currently shown to the user The Decoration c...
QIcon icon
The icon of the DecoratedWindow.
bool hasApplicationMenu
Whether the DecoratedWindow has an application menu.
void showApplicationMenu(int actionId)
Request the application menu to be shown to the user.
QColor color(QPalette::ColorGroup group, QPalette::ColorRole role) const
Used to get colors in QPalette.
Qt::Edges adjacentScreenEdges
The Edges which are adjacent to a screen edge.
QString caption
The caption of the DecoratedWindow.
qreal nextScale
The next scale this decorated window is going to target.
KDecoration3::Decoration * decoration
The Decoration of this DecoratedWindow.
qreal height
The height of the DecoratedWindow.
QPalette palette
The palette this DecoratedWindow uses.
qreal width
The width of the DecoratedWindow.
bool providesContextHelp
Whether the DecoratedWindow provides context help.
qreal scale
The current scale this decorated window is targeting.
QSizeF size
The size of the DecoratedWindow.
Base class for the Decoration.
Definition decoration.h:83
Framework for creating window decorations.
ColorGroup
Color groups are used for DecoratedWindow::color().
ColorRole
Color roles are used for DecoratedWindow::color().
typedef Edges
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:55:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.