WidgetSetup

class OCP\Dashboard\Model\WidgetSetup
Interface WidgetSetup
A widget must create an WidgetSetup object and returns it in the
IDashboardWidget::getWidgetSetup method.
Source:lib/public/Dashboard/Model/WidgetSetup.php#45
Implements:JsonSerializable

Constants

SIZE_TYPE_MIN = min
Source:lib/public/Dashboard/Model/WidgetSetup.php#46
SIZE_TYPE_MAX = max
Source:lib/public/Dashboard/Model/WidgetSetup.php#47
SIZE_TYPE_DEFAULT = default
Source:lib/public/Dashboard/Model/WidgetSetup.php#48

Properties

Methods

public OCP\Dashboard\Model\WidgetSetup::getSize($type)
Get the defined size for a specific type (min, max, default)
Returns an array:
[
‘width’ => width,
‘height’ => height
]
Source:

lib/public/Dashboard/Model/WidgetSetup.php#83

Parameters:
  • $type (string)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

array

public OCP\Dashboard\Model\WidgetSetup::getSizes()
Returns all sizes defined for the widget.
Source:lib/public/Dashboard/Model/WidgetSetup.php#99
Since:15.0.0
Deprecated:20.0.0
Returns:array
public OCP\Dashboard\Model\WidgetSetup::addSize($type, $width, $height)
Add a new size to the setup.
Source:

lib/public/Dashboard/Model/WidgetSetup.php#115

Parameters:
  • $type (string)
  • $width (int)
  • $height (int)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetSetup

public OCP\Dashboard\Model\WidgetSetup::getMenuEntries()
Returns menu entries.
Source:lib/public/Dashboard/Model/WidgetSetup.php#132
Since:15.0.0
Deprecated:20.0.0
Returns:array
public OCP\Dashboard\Model\WidgetSetup::addMenuEntry($function, $icon, $text)
Add a menu entry to the widget.
$function is the Javascript function to be called when clicking the
menu entry.
$icon is the css class of the icon.
$text is the display name of the menu entry.
Source:

lib/public/Dashboard/Model/WidgetSetup.php#152

Parameters:
  • $function (string)
  • $icon (string)
  • $text (string)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetSetup

public OCP\Dashboard\Model\WidgetSetup::addDelayedJob($function, $delay)
Add a delayed job to the widget.
$function is the Javascript function to be called.
$delay is the time in seconds between each call.
Source:

lib/public/Dashboard/Model/WidgetSetup.php#177

Parameters:
  • $function (string)
  • $delay (int)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetSetup

public OCP\Dashboard\Model\WidgetSetup::getDelayedJobs()
Get delayed jobs.
Source:lib/public/Dashboard/Model/WidgetSetup.php#194
Since:15.0.0
Deprecated:20.0.0
Returns:array
public OCP\Dashboard\Model\WidgetSetup::getPush()
Get the push function, called when an event is send to the front-end
Source:lib/public/Dashboard/Model/WidgetSetup.php#207
Since:15.0.0
Deprecated:20.0.0
Returns:string
public OCP\Dashboard\Model\WidgetSetup::setPush($function)
Set the Javascript function to be called when an event is pushed to the
frontend.
Source:

lib/public/Dashboard/Model/WidgetSetup.php#222

Parameters:
  • $function (string)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetSetup

public OCP\Dashboard\Model\WidgetSetup::getDefaultSettings()
Returns the default settings for a widget.
Source:lib/public/Dashboard/Model/WidgetSetup.php#237
Since:15.0.0
Deprecated:20.0.0
Returns:array
public OCP\Dashboard\Model\WidgetSetup::setDefaultSettings($settings)
Set the default settings for a widget.
This method is used by the Dashboard app, using the settings created
using WidgetSetting
Source:

lib/public/Dashboard/Model/WidgetSetup.php#255

Parameters:
  • $settings (array)
See:

\OCP\Dashboard\Model\WidgetSetting

Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetSetup

public OCP\Dashboard\Model\WidgetSetup::jsonSerialize()
Source:lib/public/Dashboard/Model/WidgetSetup.php#268
Since:15.0.0
Deprecated:20.0.0
Returns:array