pub trait Plugin {
// Provided methods
fn on_registered(&mut self, session: &PluginSessionHandle) { ... }
fn on_properties(
&mut self,
session: &PluginSessionHandle,
properties: Value,
) { ... }
fn on_tile_properties(
&mut self,
session: &PluginSessionHandle,
tile_id: TileId,
properties: Value,
) { ... }
fn on_inspector_message(
&mut self,
session: &PluginSessionHandle,
inspector: Inspector,
message: Value,
) { ... }
fn on_display_message(
&mut self,
session: &PluginSessionHandle,
display: Display,
message: Value,
) { ... }
fn on_inspector_open(
&mut self,
session: &PluginSessionHandle,
inspector: Inspector,
) { ... }
fn on_inspector_close(
&mut self,
session: &PluginSessionHandle,
inspector: Inspector,
) { ... }
fn on_deep_link(
&mut self,
session: &PluginSessionHandle,
ctx: DeepLinkContext,
) { ... }
fn on_tile_clicked(
&mut self,
session: &PluginSessionHandle,
ctx: TileInteractionContext,
properties: Value,
) { ... }
fn on_device_tiles(
&mut self,
session: &PluginSessionHandle,
device_id: DeviceId,
tiles: Vec<TileModel>,
) { ... }
fn on_visible_tiles(
&mut self,
session: &PluginSessionHandle,
tiles: Vec<TileModel>,
) { ... }
}
Expand description
Trait implemented by your plugin
Provided Methods§
Sourcefn on_registered(&mut self, session: &PluginSessionHandle)
fn on_registered(&mut self, session: &PluginSessionHandle)
Invoked when the plugin is successfully registered with the Tilepad application and has a usable session
§Arguments
session
- The current session
Sourcefn on_properties(&mut self, session: &PluginSessionHandle, properties: Value)
fn on_properties(&mut self, session: &PluginSessionHandle, properties: Value)
Invoked when the plugin properties are received from Tilepad,
this will occur when the plugin calls session.request_properties
or session.get_properties
but also once when the plugin is first registered
§Arguments
session
- The current sessionproperties
- The current plugin properties
Sourcefn on_tile_properties(
&mut self,
session: &PluginSessionHandle,
tile_id: TileId,
properties: Value,
)
fn on_tile_properties( &mut self, session: &PluginSessionHandle, tile_id: TileId, properties: Value, )
Invoked when a tiles properties are received from Tilepad, this will occur when the plugin calls PluginSessionHandle::request_tile_properties or PluginSessionHandle::get_tile_properties
§Arguments
session
- The current sessiontile_id
- ID of the tile that the properties are forproperties
- The current plugin properties
Sourcefn on_inspector_message(
&mut self,
session: &PluginSessionHandle,
inspector: Inspector,
message: Value,
)
fn on_inspector_message( &mut self, session: &PluginSessionHandle, inspector: Inspector, message: Value, )
Invoked when the plugin receives a message from the inspector, this message structure is defined by the developer
§Arguments
session
- The current session- `inspector - Inspector to send messages back
message
- The message sent from the inspector
Sourcefn on_display_message(
&mut self,
session: &PluginSessionHandle,
display: Display,
message: Value,
)
fn on_display_message( &mut self, session: &PluginSessionHandle, display: Display, message: Value, )
Invoked when the plugin receives a message from a display, this message structure is defined by the developer
§Arguments
session
- The current sessiondisplay
- Display to send messages backmessage
- The message sent from the inspector
Sourcefn on_inspector_open(
&mut self,
session: &PluginSessionHandle,
inspector: Inspector,
)
fn on_inspector_open( &mut self, session: &PluginSessionHandle, inspector: Inspector, )
Invoked when the inspector is opened for a tile
§Arguments
session
- The current session- `inspector - Inspector to send messages back
Sourcefn on_inspector_close(
&mut self,
session: &PluginSessionHandle,
inspector: Inspector,
)
fn on_inspector_close( &mut self, session: &PluginSessionHandle, inspector: Inspector, )
Invoked when the inspector is closed for a tile
§Arguments
session
- The current session- `inspector - Inspector to send messages back
Sourcefn on_deep_link(&mut self, session: &PluginSessionHandle, ctx: DeepLinkContext)
fn on_deep_link(&mut self, session: &PluginSessionHandle, ctx: DeepLinkContext)
Invoked when a deep link is received for the plugin
§Arguments
session
- The current sessionctx
- Information about the deep-link
Sourcefn on_tile_clicked(
&mut self,
session: &PluginSessionHandle,
ctx: TileInteractionContext,
properties: Value,
)
fn on_tile_clicked( &mut self, session: &PluginSessionHandle, ctx: TileInteractionContext, properties: Value, )
Invoked when a tile is clicked on a device
§Arguments
session
- The current sessionctx
- Contextual information about tile clicked tile (Device, action, etc)properties
- The current tile properties at the time of clicking
Sourcefn on_device_tiles(
&mut self,
session: &PluginSessionHandle,
device_id: DeviceId,
tiles: Vec<TileModel>,
)
fn on_device_tiles( &mut self, session: &PluginSessionHandle, device_id: DeviceId, tiles: Vec<TileModel>, )
Invoked when the visible tiles on a device change
§Arguments
session
- The current sessiondevice_id
- ID of the device the tiles are fortiles
- The current tiles of the device
Sourcefn on_visible_tiles(
&mut self,
session: &PluginSessionHandle,
tiles: Vec<TileModel>,
)
fn on_visible_tiles( &mut self, session: &PluginSessionHandle, tiles: Vec<TileModel>, )
Invoked when the list of visible tiles is received this will occur when the plugin calls PluginSessionHandle::request_visible_tiles or PluginSessionHandle::get_visible_tiles
§Arguments
session
- The current sessiontiles
- The current visible tiles