Plasma-framework

containmentview.h
1/*
2 SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef PLASMAQUICKCONTAINMENTVIEW_H
8#define PLASMAQUICKCONTAINMENTVIEW_H
9
10#include "plasma/containment.h"
11#include "plasma/corona.h"
12#include <plasmaquick/plasmaquick_export.h>
13#include <plasmaquick/quickviewsharedengine.h>
14
15//
16// W A R N I N G
17// -------------
18//
19// This file is not part of the public Plasma API. It exists purely as an
20// implementation detail. This header file may change from version to
21// version without notice, or even be removed.
22//
23// We mean it.
24//
25
26namespace PlasmaQuick
27{
28class ContainmentViewPrivate;
29
30class PLASMAQUICK_EXPORT ContainmentView : public PlasmaQuick::QuickViewSharedEngine
31{
32 Q_OBJECT
33 Q_PROPERTY(Plasma::Types::Location location READ location WRITE setLocation NOTIFY locationChanged)
34 Q_PROPERTY(Plasma::Types::FormFactor formFactor READ formFactor NOTIFY formFactorChanged)
35 Q_PROPERTY(QRectF screenGeometry READ screenGeometry NOTIFY screenGeometryChanged)
36
37public:
38 /**
39 * @param corona the corona of this view
40 * @param parent the QWindow this ContainmentView is parented to
41 **/
42 explicit ContainmentView(Plasma::Corona *corona, QWindow *parent = nullptr);
43 ~ContainmentView() override;
44
45 /**
46 * Unassign any containment UI from this view, then delete it
47 */
48 void destroy();
49
50 /**
51 * @return the corona of this view
52 **/
53 Plasma::Corona *corona() const;
54
55 /**
56 * @return the KConfigGroup of this view
57 **/
58 virtual KConfigGroup config() const;
59
60 /**
61 * sets the containment for this view
62 * @param cont the containment of this view
63 **/
64 void setContainment(Plasma::Containment *cont);
65
66 /**
67 * @return the containment of this ContainmentView
68 **/
69 Plasma::Containment *containment() const;
70
71 /**
72 * @return the location of this ContainmentView
73 **/
75
76 /**
77 * Sets the location of the ContainmentView
78 * @param location the location of the ContainmentView
79 **/
80 void setLocation(Plasma::Types::Location location);
81
82 /**
83 * @return the formfactor of the ContainmentView
84 **/
85 Plasma::Types::FormFactor formFactor() const;
86
87 /**
88 * @return the screenGeometry of the ContainmentView
89 **/
90 QRectF screenGeometry();
91
92protected Q_SLOTS:
93 /**
94 * It will be called when the configuration is requested
95 */
96 virtual void showConfigurationInterface(Plasma::Applet *applet);
97
98Q_SIGNALS:
99 /**
100 * emitted when the location is changed
101 **/
102 void locationChanged(Plasma::Types::Location location);
103
104 /**
105 * emitted when the formfactor is changed
106 **/
107 void formFactorChanged(Plasma::Types::FormFactor formFactor);
108
109 /**
110 * emitted when the containment is changed
111 **/
112 void containmentChanged();
113
114 /**
115 * emitted when the screenGeometry is changed
116 **/
117 void screenGeometryChanged();
118
119private:
120 ContainmentViewPrivate *const d;
121 Q_PRIVATE_SLOT(d, void updateDestroyed(bool))
122 friend class ContainmentViewPrivate;
123};
124
125}
126
127#endif // CONTAINMENTVIEW_H
The base Applet class.
Definition applet.h:64
The base class for plugins that provide backgrounds and applet grouping containers.
Definition containment.h:47
A bookkeeping Scene for Plasma::Applets.
Definition corona.h:28
Location
The Location enumeration describes where on screen an element, such as an Applet or its managing cont...
Definition plasma.h:81
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition plasma.h:40
QVariant location(const QVariant &res)
The EdgeEventForwarder class This class forwards edge events to be replayed within the given margin T...
Definition action.h:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:54:11 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.