lomiri::shell::launcher::LauncherModelInterface Class Referenceabstract

A list of launcher items to be displayed. More...

`#include <lomiri/shell/launcher/LauncherModelInterface.h>`

Inheritance diagram for lomiri::shell::launcher::LauncherModelInterface:
[legend]
Collaboration diagram for lomiri::shell::launcher::LauncherModelInterface:
[legend]

## Public Types

enum | Roles { RoleAppId = Qt::UserRole , RoleName , RoleIcon , RolePinned , RoleRunning , RoleRecent , RoleProgress , RoleCount , RoleCountVisible , RoleFocused , RoleAlerting , RoleSurfaceCount }
| The Roles supported by the model. More...

## Signals

void | hint ()
| Emitted when the launcher should hint itself to the user, e.g. to indicate a change the user should be made aware of.

## Public Member Functions

virtual Q_INVOKABLE void | move (int oldIndex, int newIndex)=0
| Move an item in the model. More...
virtual Q_INVOKABLE lomiri::shell::launcher::LauncherItemInterface * | get (int index) const =0
| Get a launcher item. More...
virtual Q_INVOKABLE void | pin (const QString &appId, int index=-1)=0
| Pin an item to the launcher. More...
virtual Q_INVOKABLE void | requestRemove (const QString &appId)=0
| Request removal of an item from the model. More...
virtual Q_INVOKABLE void | quickListActionInvoked (const QString &appId, int actionIndex)=0
| Trigger an action from the QuickList. More...
virtual Q_INVOKABLE void | setUser (const QString &username)=0
| Set the user for which the launcher should display items. More...

## Properties

lomiri::shell::application::ApplicationManagerInterface * | applicationManager
| The ApplicationManager instance the launcher should be connected to. More...
bool | onlyPinned
| Only show pinned apps, hiding the unpinned running/recent ones.

## Detailed Description

A list of launcher items to be displayed.

This model exposes all the launcher items that should be shown in the launcher.

## Member Enumeration Documentation

## Roles

enum lomiri::shell::launcher::LauncherModelInterface::Roles

The Roles supported by the model.

See LauncherItemInterface properties for details.

## Member Function Documentation

## get()

virtual Q_INVOKABLE lomiri::shell::launcher::LauncherItemInterface* lomiri::shell::launcher::LauncherModelInterface::get | ( | int | index | ) | const

pure virtual

Get a launcher item.

Note: QML requires the full namespace in the return value.

Parameters

  index | the index of the item to get

Returns
  The item.

## move()

virtual Q_INVOKABLE void lomiri::shell::launcher::LauncherModelInterface::move | ( | int | oldIndex,
|  | int | newIndex
| ) |  |

pure virtual

Move an item in the model.

Parameters

  oldIndex | The current (old) index of the item to be moved.
  newIndex | The new index where the item should be moved to.

## pin()

virtual Q_INVOKABLE void lomiri::shell::launcher::LauncherModelInterface::pin | ( | const QString & | appId,
|  | int | index = `-1`
| ) |  |

pure virtual

Pin an item to the launcher.

Recent and running applications will eventually disappear from the model as the application is closed or new recent items appear. Pinning an item to the launcher makes it persist until remove is called on it.

Parameters

  appId | The appId of the item to be pinned.
  index | The index where the item should be pinned to. This parameter is optional and if not supplied, the item will be pinned to the current position. Note: If an item is not contained in the launcher yet, calling this without an index will pin the item to the end of the list.

## quickListActionInvoked()

virtual Q_INVOKABLE void lomiri::shell::launcher::LauncherModelInterface::quickListActionInvoked | ( | const QString & | appId,
|  | int | actionIndex
| ) |  |

pure virtual

Trigger an action from the QuickList.

Parameters

  appId | The appId of the LauncherItem.
  actionIndex | The index of the triggered entry in the QuickListModel.

## requestRemove()

virtual Q_INVOKABLE void lomiri::shell::launcher::LauncherModelInterface::requestRemove | ( | const QString & | appId | ) |

pure virtual

Request removal of an item from the model.

Note: The actual removal of the item might be delayed in certain circumstances.

Parameters

  appId | The appId of the item to be removed.

## setUser()

virtual Q_INVOKABLE void lomiri::shell::launcher::LauncherModelInterface::setUser | ( | const QString & | username | ) |

pure virtual

Set the user for which the launcher should display items.

Parameters

  username | The user for which the launcher should display items.

## Property Documentation

## applicationManager

lomiri::shell::application::ApplicationManagerInterface* lomiri::shell::launcher::LauncherModelInterface::applicationManager

read write

The ApplicationManager instance the launcher should be connected to.

The Launcher will display applications contained in the ApplicationManager as running/recent apps and adjust the currently focused app highlight according to this.

The documentation for this class was generated from the following file:

- include/lomiri/shell/launcher/LauncherModelInterface.h