• Skip to content
  • Skip to link menu
KDE 4.2 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 
00032 namespace Plasma
00033 {
00034 
00035 class Containment;
00036 class CoronaPrivate;
00037 
00043 class PLASMA_EXPORT Corona : public QGraphicsScene
00044 {
00045     Q_OBJECT
00046 
00047 //typedef QHash<QString, QList<Plasma::Applet*> > layouts;
00048 
00049 public:
00050     explicit Corona(QObject * parent = 0);
00051     ~Corona();
00052 
00057     void setAppletMimeType(const QString &mimetype);
00058 
00062     QString appletMimeType();
00063 
00067     QList<Containment*> containments() const;
00068 
00072     void clearContainments();
00073 
00077     KSharedConfig::Ptr config() const;
00078 
00091     Containment *addContainment(const QString &name, const QVariantList &args = QVariantList());
00092 
00100     Containment *containmentForScreen(int screen, int desktop = -1) const;
00101 
00108     void addOffscreenWidget(QGraphicsWidget *widget);
00109 
00114     void removeOffscreenWidget(QGraphicsWidget *widget);
00115 
00121     virtual int numScreens() const;
00122 
00129     virtual QRect screenGeometry(int id) const;
00130 
00139     virtual QRegion availableScreenRegion(int id) const;
00140 
00148     QPoint popupPosition(const QGraphicsItem *item, const QSize &size);
00149 
00156     QList<Plasma::Location> freeEdges(int screen) const;
00157 
00158 public Q_SLOTS:
00167     void initializeLayout(const QString &config = QString());
00168 
00176     void loadLayout(const QString &config = QString());
00177 
00182     void saveLayout(const QString &config = QString()) const;
00183 
00187     ImmutabilityType immutability() const;
00188 
00194     void setImmutability(const ImmutabilityType immutable);
00195 
00200     void requestConfigSync();
00201 
00209     void requireConfigSync();
00210 
00211 Q_SIGNALS:
00216     void containmentAdded(Plasma::Containment *containment);
00217 
00226     void screenOwnerChanged(int wasScreen, int isScreen, Plasma::Containment *containment);
00227 
00234     void releaseVisualFocus();
00235 
00239     void configSynced();
00240 
00244     void availableScreenRegionChanged();
00245 
00246 protected:
00250     virtual void loadDefaultLayout();
00251 
00266     Containment *addContainmentDelayed(const QString &name,
00267                                        const QVariantList &args = QVariantList());
00268 
00269     //Reimplemented from QGraphicsScene
00270     void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
00271     void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
00272     void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
00273 
00274 private:
00275     CoronaPrivate *const d;
00276 
00277     Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
00278     Q_PRIVATE_SLOT(d, void offscreenWidgetDestroyed(QObject *))
00279     Q_PRIVATE_SLOT(d, void syncConfig())
00280 
00281     friend class CoronaPrivate;
00282 };
00283 
00284 } // namespace Plasma
00285 
00286 #endif
00287 

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
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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