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

Plasma

corona.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2007 Aaron Seigo <aseigo@kde.org>
00003  *   Copyright 2007 Matt Broadstone <mbroadst@gmail.com>
00004  *
00005  *   This program is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU Library General Public License as
00007  *   published by the Free Software Foundation; either version 2, or
00008  *   (at your option) any later version.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details
00014  *
00015  *   You should have received a copy of the GNU Library General Public
00016  *   License along with this program; if not, write to the
00017  *   Free Software Foundation, Inc.,
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 #ifndef PLASMA_CORONA_H
00022 #define PLASMA_CORONA_H
00023 
00024 #include <QtGui/QGraphicsScene>
00025 
00026 #include <plasma/applet.h>
00027 #include <plasma/plasma.h>
00028 #include <plasma/plasma_export.h>
00029 
00030 class QGraphicsGridLayout;
00031 class QAction;
00032 
00033 class KAction;
00034 
00035 namespace Plasma
00036 {
00037 
00038 class Containment;
00039 class CoronaPrivate;
00040 
00046 class PLASMA_EXPORT Corona : public QGraphicsScene
00047 {
00048     Q_OBJECT
00049 
00050 //typedef QHash<QString, QList<Plasma::Applet*> > layouts;
00051 
00052 public:
00053     explicit Corona(QObject * parent = 0);
00054     ~Corona();
00055 
00060     void setAppletMimeType(const QString &mimetype);
00061 
00065     QString appletMimeType();
00066 
00070     QList<Containment*> containments() const;
00071 
00075     void clearContainments();
00076 
00080     KSharedConfig::Ptr config() const;
00081 
00094     Containment *addContainment(const QString &name, const QVariantList &args = QVariantList());
00095 
00103     Containment *containmentForScreen(int screen, int desktop = -1) const;
00104 
00111     void addOffscreenWidget(QGraphicsWidget *widget);
00112 
00117     void removeOffscreenWidget(QGraphicsWidget *widget);
00118 
00123     QList <QGraphicsWidget *> offscreenWidgets() const;
00124 
00130     virtual int numScreens() const;
00131 
00138     virtual QRect screenGeometry(int id) const;
00139 
00148     virtual QRegion availableScreenRegion(int id) const;
00149 
00157     QPoint popupPosition(const QGraphicsItem *item, const QSize &size);
00158 
00165     QList<Plasma::Location> freeEdges(int screen) const;
00166 
00170     QAction *action(QString name) const;
00171 
00175     void addAction(QString name, QAction *action);
00176 
00180     QList<QAction*> actions() const;
00181 
00188     void enableAction(const QString &name, bool enable);
00189 
00196     void updateShortcuts();
00197 
00204     void addShortcuts(KActionCollection *newShortcuts);
00205 
00213     KAction* addAction(QString name);
00214 
00215 public Q_SLOTS:
00224     void initializeLayout(const QString &config = QString());
00225 
00233     void loadLayout(const QString &config = QString());
00234 
00239     void saveLayout(const QString &config = QString()) const;
00240 
00244     ImmutabilityType immutability() const;
00245 
00251     void setImmutability(const ImmutabilityType immutable);
00252 
00257     void requestConfigSync();
00258 
00266     void requireConfigSync();
00267 
00268 Q_SIGNALS:
00273     void containmentAdded(Plasma::Containment *containment);
00274 
00283     void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment *containment);
00284 
00291     void releaseVisualFocus();
00292 
00296     void configSynced();
00297 
00301     void availableScreenRegionChanged();
00302 
00309     void immutabilityChanged(Plasma::ImmutabilityType immutability);
00310 
00319     void shortcutsChanged();
00320 
00321 protected:
00325     virtual void loadDefaultLayout();
00326 
00341     Containment *addContainmentDelayed(const QString &name,
00342                                        const QVariantList &args = QVariantList());
00343 
00344     //Reimplemented from QGraphicsScene
00345     void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
00346     void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
00347     void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
00348 
00349 private:
00350     CoronaPrivate *const d;
00351 
00352     Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
00353     Q_PRIVATE_SLOT(d, void offscreenWidgetDestroyed(QObject *))
00354     Q_PRIVATE_SLOT(d, void syncConfig())
00355     Q_PRIVATE_SLOT(d, void toggleImmutability())
00356     Q_PRIVATE_SLOT(d, void showShortcutConfig())
00357 
00358     friend class CoronaPrivate;
00359 };
00360 
00361 } // namespace Plasma
00362 
00363 #endif
00364 

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal