• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • plasma
corona.h
Go to the documentation of this file.
1/*
2 * Copyright 2007 Aaron Seigo <aseigo@kde.org>
3 * Copyright 2007 Matt Broadstone <mbroadst@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Library General Public License as
7 * published by the Free Software Foundation; either version 2, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef PLASMA_CORONA_H
22#define PLASMA_CORONA_H
23
24#include <QtGui/QGraphicsScene>
25
26#include <plasma/applet.h>
27#include <plasma/containment.h>
28#include <plasma/plasma.h>
29#include <plasma/plasma_export.h>
30
31class QGraphicsGridLayout;
32class QAction;
33
34class KAction;
35
36namespace Plasma
37{
38
39class CoronaPrivate;
40class ContainmentActionsPluginsConfig;
41class AbstractDialogManager;
42
48class PLASMA_EXPORT Corona : public QGraphicsScene
49{
50 Q_OBJECT
51
52//typedef QHash<QString, QList<Plasma::Applet*> > layouts;
53
54public:
55 explicit Corona(QObject * parent = 0);
56 ~Corona();
57
62 void setAppletMimeType(const QString &mimetype);
63
67 QString appletMimeType();
68
73 QString defaultContainmentPlugin() const;
74
78 QList<Containment*> containments() const;
79
83 void clearContainments();
84
88 KSharedConfig::Ptr config() const;
89
105 Containment *addContainment(const QString &name, const QVariantList &args = QVariantList());
106
125 Containment *addContainmentDelayed(const QString &name,
126 const QVariantList &args = QVariantList());
127
135 Containment *containmentForScreen(int screen, int desktop = -1) const;
136
149 Containment *containmentForScreen(int screen, int desktop,
150 const QString &defaultPluginIfNonExistent,
151 const QVariantList &defaultArgs = QVariantList());
158 void addOffscreenWidget(QGraphicsWidget *widget);
159
164 void removeOffscreenWidget(QGraphicsWidget *widget);
165
170 QList <QGraphicsWidget *> offscreenWidgets() const;
171
177 virtual int numScreens() const;
178
185 virtual QRect screenGeometry(int id) const;
186
195 virtual QRegion availableScreenRegion(int id) const;
196
204 QPoint popupPosition(const QGraphicsItem *item, const QSize &size);
205
215 QPoint popupPosition(const QGraphicsItem *item, const QSize &size, Qt::AlignmentFlag alignment);
216
223 QList<Plasma::Location> freeEdges(int screen) const;
224
228 QAction *action(QString name) const;
229
233 void addAction(QString name, QAction *action);
234
238 QList<QAction*> actions() const;
239
246 void enableAction(const QString &name, bool enable);
247
254 void updateShortcuts();
255
262 void addShortcuts(KActionCollection *newShortcuts);
263
271 KAction* addAction(QString name);
272
277 void setContainmentActionsDefaults(Containment::Type containmentType, const ContainmentActionsPluginsConfig &config);
278
283 ContainmentActionsPluginsConfig containmentActionsDefaults(Containment::Type containmentType);
284
290 void setDialogManager(AbstractDialogManager *manager);
291
297 AbstractDialogManager *dialogManager();
298
309#ifndef KDE_NO_DEPRECATED
310 KDE_DEPRECATED QList<Plasma::Containment *> importLayout(const KConfigBase &config);
311#endif
312
320 QString preferredToolBoxPlugin(const Containment::Type type) const;
321
331 QList<Plasma::Containment *> importLayout(const KConfigGroup &config);
332
340 void exportLayout(KConfigGroup &config, QList<Containment*> containments);
341
342public Q_SLOTS:
351 void initializeLayout(const QString &config = QString());
352
360 void loadLayout(const QString &config = QString());
361
366 void saveLayout(const QString &config = QString()) const;
367
371 ImmutabilityType immutability() const;
372
378 void setImmutability(const ImmutabilityType immutable);
379
384 void requestConfigSync();
385
393 void requireConfigSync();
394
401 void layoutContainments();
402
403Q_SIGNALS:
408 void containmentAdded(Plasma::Containment *containment);
409
418 void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment *containment);
419
426 void releaseVisualFocus();
427
431 void configSynced();
432
436 void availableScreenRegionChanged();
437
444 void immutabilityChanged(Plasma::ImmutabilityType immutability);
445
454 void shortcutsChanged();
455
456protected:
460 virtual void loadDefaultLayout();
461
469 void mapAnimation(Animator::Animation from, Animator::Animation to);
470
478 void mapAnimation(Animator::Animation from, const QString &to);
479
486 void setPreferredToolBoxPlugin(const Containment::Type type, const QString &plugin);
487
492 void setDefaultContainmentPlugin(const QString &name);
493
494 //Reimplemented from QGraphicsScene
495 void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
496 void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
497 void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
498
499private:
500 CoronaPrivate *const d;
501
502 Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
503 Q_PRIVATE_SLOT(d, void offscreenWidgetDestroyed(QObject *))
504 Q_PRIVATE_SLOT(d, void syncConfig())
505 Q_PRIVATE_SLOT(d, void toggleImmutability())
506 Q_PRIVATE_SLOT(d, void showShortcutConfig())
507
508 friend class CoronaPrivate;
509 friend class View;
510};
511
512} // namespace Plasma
513
514#endif
515
applet.h
Plasma::AbstractDialogManager
The AbstractDialogManager class shows the dialogs shown by applets and the rest of the shell.
Definition: abstractdialogmanager.h:44
Plasma::Animator::Animation
Animation
Definition: animator.h:55
Plasma::ContainmentActionsPluginsConfig
A class that holds a map of triggers to plugin names.
Definition: containmentactionspluginsconfig.h:42
Plasma::Containment
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:73
Plasma::Containment::Type
Type
Definition: containment.h:99
Plasma::Corona
A QGraphicsScene for Plasma::Applets.
Definition: corona.h:49
Plasma::Corona::releaseVisualFocus
void releaseVisualFocus()
This signal indicates that an application launch, window creation or window focus event was triggered...
Plasma::Corona::immutabilityChanged
void immutabilityChanged(Plasma::ImmutabilityType immutability)
emitted when immutability changes.
Plasma::Corona::containmentAdded
void containmentAdded(Plasma::Containment *containment)
This signal indicates a new containment has been added to the Corona.
Plasma::Corona::configSynced
void configSynced()
This signal indicates that the configuration file was flushed to disc.
Plasma::Corona::screenOwnerChanged
void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment *containment)
This signal indicates that a containment has been newly associated (or dissociated) with a physical s...
Plasma::Corona::shortcutsChanged
void shortcutsChanged()
Plasma::Corona::availableScreenRegionChanged
void availableScreenRegionChanged()
This signal inicates that a change in available screen goemetry occurred.
Plasma::View
A QGraphicsView for a single Containment.
Definition: view.h:48
QGraphicsScene
QGraphicsWidget
QObject
containment.h
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
Plasma::ImmutabilityType
ImmutabilityType
Defines the immutability of items like applets, corona and containments they can be free to modify,...
Definition: plasma.h:197
plasma.h
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal