WidgetManager1.0

back

Commands

Events

A service that allows for managing of widgets in an Opera host.

The manager allows for installing new widgets to the host, upgrading existing ones or uninstalling widget. Widgets can be opened and closed to be shown to the user of the host.

The service also reports about any widget which is installed or uninstalled from the host, even those installed by the client. It also reports back any failures in downloading or installing a widget.

Existing widgets on the host can be queried by calling ListWidgets.

CloseWidget

Closes a widget on the host, the widget will no longer be usable until it is re-opened.

All persistent settings of the widget is kept while the widget is closed.

command CloseWidget(CloseWidgetArg)
{
}
returns (Default)
{
}
= 4;

CreateInstaller

Create a new installer in the host. The installer will keep a temporary file on the host which can be filled with binary data (one chunk at a time) by calling UpdateInstaller. It is also possible to specify a widget ID, if specified the installer will upgrade an existing widget to use a new widget file instead of installing a new one.

To use the installer call InstallWidget, to cancel the installer call RemoveInstaller.

command CreateInstaller(CreateInstallerArg)
{
}
returns (Installer)
{
}
= 5;

GetSettings

Returns the current settings of the host.

command GetSettings(Default)
{
}
returns (Settings)
{
}
= 1;

InstallWidget

Installs a widget by using the specified installer created by CreateInstaller. Once the widget is installed the installer and temporary file will be removed from the host.

If the installation succeded it will return INSTALL_SUCCESSFUL, otherwise INSTALL_FAILED.

A OnWidgetInstalled will be sent before the call is finished if the widget was installed.

command InstallWidget(InstallWidgetArg)
{
}
returns (WidgetInstallResult)
{
}
= 8;

InstallWidgetByURL

Install a widget by telling the host to download the widget file from the specified URL first. If the file was succesfully downloaded it will be installed in the host.

If the download and installation succeded it will return INSTALL_SUCCESSFUL, otherwise it returns one of the failure types.

A OnWidgetInstalled will be sent before the call is finished if the widget was installed. A OnWidgetInstallFailed event is sent if the the download failed or the widget could not be installed.

command InstallWidgetByURL(InstallWidgetByURLArg)
{
}
returns (WidgetInstallResult)
{
}
= 9;

ListWidgets

Lists all widgets installed in the host.

command ListWidgets(Default)
{
}
returns (WidgetList)
{
}
= 2;

OpenWidget

Opens a widget on the host, the widget will then be visible for the user of the host.

command OpenWidget(OpenWidgetArg)
{
}
returns (Default)
{
}
= 3;

RemoveInstaller

Cancels an installation by removing the installer and the temporary file from the host.

command RemoveInstaller(RemoveInstallerArg)
{
}
returns (Default)
{
}
= 7;

UninstallWidget

Removes a widget from the host, the widget is closed and the widget file is removed.

A OnWidgetUninstalled will be sent if the widget could be uninstalled.

command UninstallWidget(UninstallWidgetArg)
{
}
returns (Default)
{
}
= 10;

UpdateInstaller

Adds additional data to an existing installer. The binary data will be appended to the temporary file.

Make sure the client does not send more data in one chunk than the host can deal with. The max chunk size can be attained by calling GetSettings.

command UpdateInstaller(UpdateInstallerArg)
{
}
returns (Default)
{
}
= 6;

OnWidgetInstallFailed

A widget failed to install in the host.

event OnWidgetInstallFailed returns (WidgetInstallResult)
{
}
= 13;

OnWidgetInstalled

A new widget has been installed.

event OnWidgetInstalled returns (Widget)
{
}
= 11;

OnWidgetUninstalled

A widget was uninstalled from the host.

event OnWidgetUninstalled returns (WidgetUninstalled)
{
}
= 14;

OnWidgetUpgraded

An existing widget has been upgraded to use a new widget file.

event OnWidgetUpgraded returns (Widget)
{
}
= 12;