Plasma/libplasma2/API Review: Difference between revisions

From KDE Community Wiki
Line 100: Line 100:


= Corona =
= Corona =
== Methods ==
* Containment *containmentForScreen(int screen, int desktop = -1) const; Remove desktop?
* Containment *containmentForScreen(int screen, int desktop, const QString &defaultPluginIfNonExistent,  const QVariantList &defaultArgs = QVariantList()); Remove desktop?
Still necassary?
* void setAppletMimeType(const QString &mimetype);
* QString appletMimeType();
* void setDialogManager(AbstractDialogManager *manager); DialogManager was fow main windows of config uis. If all config is going to be qml, this could go (alternative is that we do an AbstractDialogManager that is a declarative view: possible as well).
* AbstractDialogManager *dialogManager();
* QString preferredToolBoxPlugin(const Containment::Type type) const; Toolboxes, instead of plugin may come from the only corona QML package.
void setPreferredToolBoxPlugin(const Containment::Type type, const QString &plugin);
*  void setDefaultContainmentPlugin(const QString &name);  Default containment plugin also told in the one Corona QML package?
* void requestConfigSync(); Ugly api: are requestConfigSync and requireConfigSync still required both?
* void requireConfigSync();
==Signals ==
* void releaseVisualFocus();

Revision as of 15:35, 6 February 2013

Applet

Contstructors

Probably not all of them are still required:

  • explicit Applet(QObject *parent = 0, const QString &serviceId = QString(), uint appletId = 0);
  • explicit Applet(const KPluginInfo &info, QObject *parent = 0, uint appletId = 0);
  • explicit Applet(QObject *parent, const QString &serviceId, uint appletId, const QVariantList &args);
  • protected Applet(QObject *parent, const QVariantList &args);
  • private Applet(const QString &packagePath, uint appletId, const QVariantList &args);

Methods

To be removed

Those two in some qml binding:

  • QPoint popupPosition(const QSize &s) const;
  • QPoint popupPosition(const QSize &s, Qt::AlignmentFlag alignment) const;

Needs to see what constraints are still valid and what not (probably just sizeconstraint invalid now)

  • void updateConstraints(Plasma::Constraints constraints = Plasma::AllConstraints);

Completely obsolete:

  • QFont font() const;
  • bool shouldConserveResources() const;
  • void showMessage(const QIcon &icon, const QString &message, const Plasma::MessageButtons buttons); (messagebox qml components)

Are those still applicable?

  • bool destroyed() const;
  • bool hasAuthorization(const QString &constraint) const;

In PluginLoader?

  • static KPluginInfo::List listAppletInfo(const QString &category = QString(), const QString &parentApp = QString());
  • static KPluginInfo::List listAppletInfoForMimeType(const QString &mimetype);
  • static KPluginInfo::List listAppletInfoForUrl(const QUrl &url);
  • static QStringList listCategories(const QString &parentApp = QString(), bool visibleOnly = true);
  • void setCustomCategories(const QStringList &categories);
  • QStringList customCategories();
  • static Applet *loadPlasmoid(const QString &path, uint appletId = 0, const QVariantList &args = QVariantList());
  • static QString category(const KPluginInfo &applet);
  • static QString category(const QString &appletName);


Signals

  • void releaseVisualFocus();
  • void appletTransformedByUser();
  • void appletTransformedItself();
  • void messageButtonPressed(const Plasma::MessageButton button);

Slots

  • void destroy(); (is used to do an animation before deleting, animations are not managed here anymore tough)
  • virtual void showConfigurationInterface();
  • void showConfigurationInterface(QWidget *widget); probably still valid, but not qwidget based
  • bool hasFocus() const;
  • void setFocus(Qt::FocusReason);

Containment

Constructors

All still needed?

  • 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

  • Applet *addApplet(const QString &name, const QVariantList &args = QVariantList(), const QRectF &geometry = QRectF(-1, -1, -1, -1)); Remove Geometry? not possible anymore
  • void addApplet(Applet *applet, const QPointF &pos = QPointF(-1, -1)); Remove pos? (not possible anymore)
  • 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)
  • int desktop() const;
  • int lastDesktop() const;
  • void showContextMenu(const QPointF &containmentPos, const QPoint &screenPos);
  • virtual void showDropZone(const QPoint pos);
  • void contextMenuEvent(QContextMenuEvent *event);
  • void keyPressEvent(QKeyEvent *event);
  • void wheelEvent(QWheelEvent *event);

In PluginLoader?

  • static KPluginInfo::List listContainments(const QString &category = QString(), const QString &parentApp = QString());
  • static KPluginInfo::List listContainmentsOfType(const QString &type, const QString &category = QString(), const QString &parentApp = QString());
  • static QStringList listContainmentTypes();
  • static KPluginInfo::List listContainmentsForMimeType(const QString &mimeType);

Signals

  • void toolBoxToggled();
  • void toolBoxVisibilityChanged(bool);
  • void showAddWidgetsInterface(const QPointF &pos); (cannot have a position, maybe not needed at all)

Corona

Methods

  • Containment *containmentForScreen(int screen, int desktop = -1) const; Remove desktop?
  • Containment *containmentForScreen(int screen, int desktop, const QString &defaultPluginIfNonExistent, const QVariantList &defaultArgs = QVariantList()); Remove desktop?

Still necassary?

  • void setAppletMimeType(const QString &mimetype);
  • QString appletMimeType();
  • void setDialogManager(AbstractDialogManager *manager); DialogManager was fow main windows of config uis. If all config is going to be qml, this could go (alternative is that we do an AbstractDialogManager that is a declarative view: possible as well).
  • AbstractDialogManager *dialogManager();
  • QString preferredToolBoxPlugin(const Containment::Type type) const; Toolboxes, instead of plugin may come from the only corona QML package.

void setPreferredToolBoxPlugin(const Containment::Type type, const QString &plugin);

  • void setDefaultContainmentPlugin(const QString &name); Default containment plugin also told in the one Corona QML package?
  • void requestConfigSync(); Ugly api: are requestConfigSync and requireConfigSync still required both?
  • void requireConfigSync();

Signals

  • void releaseVisualFocus();