Plasma/libplasma2/API Review/Containment: Difference between revisions

From KDE Community Wiki
(Created page with "= Constructors = All still needed? * explicit Containment(QObject *parent = 0, const QString &serviceId = QString(), uint containmentId = 0) * Containment(QObject *parent, c...")
 
No edit summary
Line 1: Line 1:
= Constructors =
=Q_PROPERTIES=
All still needed?
All qproperties and invokables must go
* explicit Containment(QObject *parent = 0,  const QString &serviceId = QString(),  uint containmentId = 0)
* Containment(QObject *parent, const QVariantList &args);
* private Containment(const QString &packagePath, uint appletId, const QVariantList &args);


= Methods =
=Enums=
* Applet *addApplet(const QString &name, const QVariantList &args = QVariantList(),  const QRectF &geometry = QRectF(-1, -1, -1, -1)); Remove Geometry? not possible anymore
Type probably goes in plasma.h
* void addApplet(Applet *applet, const QPointF &pos = QPointF(-1, -1)); Remove pos? (not possible anymore)
        enum Type {
* void setScreen(int screen, int desktop = -1); Drop desktop? (that means dropping the per-virtual desktop views feature, it can be "emulated" with activities and would make things dramatically simpler)
            NoContainmentType = -1, /**< @internal */
* int desktop() const;
            DesktopContainment = 0, /**< A desktop containment */
* int lastDesktop() const;
New name -> suggestions [ Canvas ]
* void showContextMenu(const QPointF &containmentPos, const QPoint &screenPos);
            PanelContainment,       /**< A desktop panel */
* virtual void showDropZone(const QPoint pos);
            CustomContainment = 127, /**< A containment that is neither a desktop nor a panel
* void contextMenuEvent(QContextMenuEvent *event);
                                        but something application specific */
* void keyPressEvent(QKeyEvent *event);
          CustomPanelContainment = 128 /**< A customized desktop panel */
* void wheelEvent(QWheelEvent *event);
        };


=== In PluginLoader? ===
ToolType goes in plasma.h
* static KPluginInfo::List listContainments(const QString &category = QString(), const QString &parentApp = QString());
it becomes  ActionType (not related to toolbox anymore)
* static KPluginInfo::List listContainmentsOfType(const QString &type,  const QString &category = QString(), const QString &parentApp = QString());
        enum ToolType {
* static QStringList listContainmentTypes();
            AddTool = 0,
* static KPluginInfo::List listContainmentsForMimeType(const QString &mimeType);
            ConfigureTool = 100,
            ControlTool = 200,
            MiscTool = 300,
            DestructiveTool = 400,
            UserToolType = DestructiveTool + 1000
        };
        Q_ENUMS(ToolType)


= Signals =
= Bookkeeping =
* void toolBoxToggled();
 
* void toolBoxVisibilityChanged(bool);
{| cellspacing="0" cellpadding="5" border="1" style="border: 1px solid gray; border-collapse: collapse; text-align: left; width: 100%;" class="sortable"
* void showAddWidgetsInterface(const QPointF &pos); (cannot have a position, maybe not needed at all)
|- style="background: rgb(236, 236, 236) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; white-space: nowrap;"
as
! Status
! Action
! Method
 
{{FeatureDone|Keep| uint id() const;}}
 
|}

Revision as of 14:18, 18 February 2013

Q_PROPERTIES

All qproperties and invokables must go

Enums

Type probably goes in plasma.h

       enum Type {
           NoContainmentType = -1,  /**< @internal */
           DesktopContainment = 0,  /**< A desktop containment */

New name -> suggestions [ Canvas ]

           PanelContainment,        /**< A desktop panel */
           CustomContainment = 127, /**< A containment that is neither a desktop nor a panel
                                       but something application specific */
          CustomPanelContainment = 128 /**< A customized desktop panel */
       };

ToolType goes in plasma.h it becomes ActionType (not related to toolbox anymore)

       enum ToolType {
           AddTool = 0,
           ConfigureTool = 100,
           ControlTool = 200,
           MiscTool = 300,
           DestructiveTool = 400,
           UserToolType = DestructiveTool + 1000
       };
       Q_ENUMS(ToolType)

Bookkeeping

as
Status Action Method
DONE Keep uint id() const;