Libplasma

plasma.h
1/*
2 SPDX-FileCopyrightText: 2005 Aaron Seigo <aseigo@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef PLASMA_DEFS_H
8#define PLASMA_DEFS_H
9
10/** @header plasma/plasma.h <Plasma/Plasma> */
11
12#include <QObject>
13
14#include <plasma/plasma_export.h>
15
16class QAction;
17
18/**
19 * Namespace for everything in libplasma
20 */
21namespace Plasma
22{
23/**
24 * @class Types plasma/plasma.h <Plasma/Plasma>
25 * @short Enums and constants used in Plasma
26 *
27 */
28class PLASMA_EXPORT Types : public QObject
29{
30 Q_OBJECT
31
32public:
33 ~Types() override;
34
35 /**
36 * The FormFactor enumeration describes how a Plasma::Applet should arrange
37 * itself. The value is derived from the container managing the Applet
38 * (e.g. in Plasma, a Corona on the desktop or on a panel).
39 **/
41 Planar = 0, /**< The applet lives in a plane and has two
42 degrees of freedom to grow. Optimize for
43 desktop, laptop or tablet usage: a high
44 resolution screen 1-3 feet distant from the
45 viewer. */
46 MediaCenter, /**< As with Planar, the applet lives in a plane
47 but the interface should be optimized for
48 medium-to-high resolution screens that are
49 5-15 feet distant from the viewer. Sometimes
50 referred to as a "ten foot interface".*/
51 Horizontal, /**< The applet is constrained vertically, but
52 can expand horizontally. */
53 Vertical, /**< The applet is constrained horizontally, but
54 can expand vertically. */
55 Application, /**< The Applet lives in a plane and should be optimized to look as a full application,
56 for the desktop or the particular device. */
57 };
58 Q_ENUM(FormFactor)
59
60 /**
61 * Display hints that come from the containment that suggest the applet how to look and behave.
62 * @since 5.77
63 */
65 NoContainmentDisplayHint = 0,
66 ContainmentDrawsPlasmoidHeading =
67 1, /**< The containment will draw an titlebar-looking header for the applets, so the applets shouldn't attempt to paint a similar thing **/
68 ContainmentForcesSquarePlasmoids =
69 2, /**< The containment will force every plasmoid to be constrained in a square icon (An example is the System Tray)**/
70 ContainmentPrefersOpaqueBackground = 4, /**< The containment prefers the style of the applets to be opaque, where applicable */
71 ContainmentPrefersFloatingApplets = 8 /**< The containment prefers applet's dialogs to be floating, where applicable */
72 };
73 Q_ENUM(ContainmentDisplayHint)
74 Q_DECLARE_FLAGS(ContainmentDisplayHints, ContainmentDisplayHint)
75 Q_FLAG(ContainmentDisplayHints)
76
77 /**
78 * The Location enumeration describes where on screen an element, such as an
79 * Applet or its managing container, is positioned on the screen.
80 **/
81 enum Location {
82 Floating = 0, /**< Free floating. Neither geometry or z-ordering
83 is described precisely by this value. */
84 Desktop, /**< On the planar desktop layer, extending across
85 the full screen from edge to edge */
86 FullScreen, /**< Full screen */
87 TopEdge, /**< Along the top of the screen*/
88 BottomEdge, /**< Along the bottom of the screen*/
89 LeftEdge, /**< Along the left side of the screen */
90 RightEdge, /**< Along the right side of the screen */
91 };
92 Q_ENUM(Location)
93
94 /**
95 * Defines the immutability of items like applets, corona and containments
96 * they can be free to modify, locked down by the user or locked down by the
97 * system (e.g. kiosk setups).
98 */
100 Mutable = 1, /**< The item can be modified in any way **/
101 UserImmutable = 2, /**< The user has requested a lock down, and can undo
102 the lock down at any time **/
103 SystemImmutable = 4, /**< the item is locked down by the system, the user
104 can't unlock it **/
105 };
106 Q_ENUM(ImmutabilityType)
107
108 /**
109 * Status of an applet
110 * @since 4.3
111 */
113 UnknownStatus = 0, /**< The status is unknown **/
114 PassiveStatus = 1, /**< The Item is passive **/
115 ActiveStatus = 2, /**< The Item is active **/
116 NeedsAttentionStatus = 3, /**< The Item needs attention **/
117 RequiresAttentionStatus = 4, /**< The Item needs persistent attention **/
118 AcceptingInputStatus = 5, /**< The Item is accepting input **/
119 // FIXME KF6: this should be the smallest status
120 HiddenStatus = 6, /**< The Item will be hidden totally **/
121 };
122 Q_ENUM(ItemStatus)
123
124 /**
125 * Description on how draw a background for the applet
126 */
128 NoBackground = 0, /**< Not drawing a background under the applet, the applet has its own implementation */
129 StandardBackground = 1, /**< The standard background from the theme is drawn */
130 TranslucentBackground = 2, /**< An alternate version of the background is drawn, usually more translucent */
131 ShadowBackground = 4, /**< The applet won't have a svg background but a drop shadow of its content done via a shader */
132 ConfigurableBackground = 8, /** If the hint has this flag, the user is able to configure this background */
133 DefaultBackground = StandardBackground, /**< Default settings: both standard background */
134 };
135 Q_ENUM(BackgroundHints)
136 // TODO KF6: BackgroundHint and BackgroundHints
137 Q_DECLARE_FLAGS(BackgroundFlags, BackgroundHints)
138
139private:
140 Types(QObject *parent = nullptr);
141};
142
143Q_DECLARE_OPERATORS_FOR_FLAGS(Types::ContainmentDisplayHints)
144Q_DECLARE_OPERATORS_FOR_FLAGS(Types::BackgroundFlags)
145
146} // Plasma namespace
147
148#endif // multiple inclusion guard
Enums and constants used in Plasma.
Definition plasma.h:29
ContainmentDisplayHint
Display hints that come from the containment that suggest the applet how to look and behave.
Definition plasma.h:64
ImmutabilityType
Defines the immutability of items like applets, corona and containments they can be free to modify,...
Definition plasma.h:99
ItemStatus
Status of an applet.
Definition plasma.h:112
BackgroundHints
Description on how draw a background for the applet.
Definition plasma.h:127
Location
The Location enumeration describes where on screen an element, such as an Applet or its managing cont...
Definition plasma.h:81
@ RightEdge
Along the right side of the screen.
Definition plasma.h:90
@ FullScreen
Full screen.
Definition plasma.h:86
@ TopEdge
Along the top of the screen.
Definition plasma.h:87
@ LeftEdge
Along the left side of the screen.
Definition plasma.h:89
@ BottomEdge
Along the bottom of the screen.
Definition plasma.h:88
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition plasma.h:40
Namespace for everything in libplasma.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:34:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.