// Copyright 2008 Simon Edwards <simon@simonzone.com>

//                 Generated by twine

// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details

// You should have received a copy of the GNU Library General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


namespace Plasma
{

class Corona : QGraphicsScene
{
%TypeHeaderCode
#include <plasma/corona.h>
%End


public:
    explicit                Corona (QObject* parent /TransferThis/ = 0);
    void                    setAppletMimeType (const QString& mimetype);
    QString                 appletMimeType ();
    QList<Plasma::Containment*>  containments () const;
    void                    clearContainments ();
    KSharedConfig::Ptr      config () const;
    Plasma::Containment*    addContainment (const QString& name, const QVariantList& args = QVariantList());
    Plasma::Containment*    containmentForScreen (int screen, int desktop = -1) const;
    void                    addOffscreenWidget (QGraphicsWidget* widget);
    void                    removeOffscreenWidget (QGraphicsWidget* widget);
    virtual int             numScreens () const;
    virtual QRect           screenGeometry (int id) const;
    virtual QRegion         availableScreenRegion (int id) const;
    QPoint                  popupPosition (const QGraphicsItem* item, const QSize& s);
//FIXME    QList<Plasma::Location>  freeEdges (int screen) const;
    void                    initializeLayout (const QString& config = QString());
    void                    loadLayout (const QString& config = QString());
    void                    saveLayout (const QString& config = QString()) const;
    Plasma::ImmutabilityType  immutability () const;
    void                    setImmutability (const Plasma::ImmutabilityType immutable);
    void                    requestConfigSync ();
    void                    requireConfigSync ();

signals:
    void                    containmentAdded (Plasma::Containment* containment);
    void                    screenOwnerChanged (int wasScreen, int isScreen, Plasma::Containment* containment);
    void                    releaseVisualFocus ();
    void                    configSynced ();
    void                    availableScreenRegionChanged ();

protected:
    virtual void            loadDefaultLayout ();
    Plasma::Containment*    addContainmentDelayed (const QString& name, const QVariantList& args = QVariantList());
    void                    dragEnterEvent (QGraphicsSceneDragDropEvent* event);
    void                    dragLeaveEvent (QGraphicsSceneDragDropEvent* event);
    void                    dragMoveEvent (QGraphicsSceneDragDropEvent* event);
};   // Corona

};   // Plasma


