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

Plasma

  • sources
  • kde-4.12
  • kdelibs
  • 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 
31 class QGraphicsGridLayout;
32 class QAction;
33 
34 class KAction;
35 
36 namespace Plasma
37 {
38 
39 class CoronaPrivate;
40 class ContainmentActionsPluginsConfig;
41 class AbstractDialogManager;
42 
48 class PLASMA_EXPORT Corona : public QGraphicsScene
49 {
50  Q_OBJECT
51 
52 //typedef QHash<QString, QList<Plasma::Applet*> > layouts;
53 
54 public:
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 
342 public 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 
403 Q_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 
456 protected:
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 
499 private:
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 
QGraphicsScene
Plasma::ImmutabilityType
ImmutabilityType
Defines the immutability of items like applets, corona and containments they can be free to modify...
Definition: plasma.h:197
Plasma::Animator::Animation
Animation
Definition: animator.h:55
containment.h
QObject
Plasma::View
A QGraphicsView for a single Containment.
Definition: view.h:47
applet.h
plasma.h
Plasma::type
static QScriptValue type(QScriptContext *ctx, QScriptEngine *eng)
Definition: easingcurve.cpp:63
Plasma::AbstractDialogManager
The AbstractDialogManager class shows the dialogs shown by applets and the rest of the shell...
Definition: abstractdialogmanager.h:43
Plasma::Containment
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:72
Plasma::Containment::Type
Type
Definition: containment.h:99
Plasma::ContainmentActionsPluginsConfig
A class that holds a map of triggers to plugin names.
Definition: containmentactionspluginsconfig.h:41
plasma_export.h
Plasma::Corona
A QGraphicsScene for Plasma::Applets.
Definition: corona.h:48
QGraphicsWidget
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:33 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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