// 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);
    QList<QGraphicsWidget*>  offscreenWidgets () const;
    virtual int             numScreens () const;
    virtual QRect           screenGeometry (int id) const;
    virtual QRegion         availableScreenRegion (int id) const;
    QPoint                  popupPosition (const QGraphicsItem* item, const QSize& size);
    QList<Plasma::Location>  freeEdges (int screen) const;
    QAction*                action (QString name) const;
    void                    addAction (QString name, QAction* action);
    QList<QAction*>         actions () const;
    void                    enableAction (const QString& name, bool enable);
    void                    updateShortcuts ();
    void                    addShortcuts (KActionCollection* newShortcuts);
    KAction*                addAction (QString name);
    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 ();
    void                    immutabilityChanged (Plasma::ImmutabilityType immutability);
    void                    shortcutsChanged ();

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);
public:
    ~Corona ();
    QPoint                  popupPosition (const QGraphicsItem* item, const QSize& size, Qt::AlignmentFlag alignment);
    void                    setContainmentActionsDefaults (Plasma::Containment::Type containmentType, const Plasma::ContainmentActionsPluginsConfig& config);
    Plasma::ContainmentActionsPluginsConfig  containmentActionsDefaults (Plasma::Containment::Type containmentType);
    void                    setDialogManager (Plasma::AbstractDialogManager* manager);
    Plasma::AbstractDialogManager*  dialogManager ();
    QList<Plasma::Containment*>  importLayout (const KConfigBase& config);
    void                    layoutContainments ();
protected:
    void                    mapAnimation (Plasma::Animator::Animation from, Plasma::Animator::Animation to);
    void                    mapAnimation (Plasma::Animator::Animation from, const QString& to);
public:
    Plasma::Containment*    containmentForScreen (int screen, int desktop, const QString& defaultPluginIfNonExistent, const QVariantList& defaultArgs = QVariantList());
    QString                 preferredToolBoxPlugin (const Plasma::Containment::Type type) const;
    QList<Plasma::Containment*>  importLayout (const KConfigGroup& config);
    void                    exportLayout (KConfigGroup& config, QList<Plasma::Containment*> containments);
protected:
    void                    setPreferredToolBoxPlugin (const Plasma::Containment::Type type, const QString& plugin);
public:
    QString                 defaultContainmentPlugin () const;
protected:
    void                    setDefaultContainmentPlugin (const QString& name);
};
// Corona

};
// Plasma


