My Project
unity::shell::launcher::LauncherModelInterface Class Referenceabstract

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

#include <unity/shell/launcher/LauncherModelInterface.h>

Inheritance diagram for unity::shell::launcher::LauncherModelInterface:
Collaboration diagram for unity::shell::launcher::LauncherModelInterface:

Public Types

enum  Roles {
  RoleAppId = Qt::UserRole, RoleName, RoleIcon, RolePinned,
  RoleRunning, RoleRecent, RoleProgress, RoleCount,
  RoleCountVisible, RoleFocused, RoleAlerting
}
 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 setAlerting (const QString &appId, bool alerting)=0
 Set or unset alert-state on launcher item. More...
 
virtual Q_INVOKABLE void move (int oldIndex, int newIndex)=0
 Move an item in the model. More...
 
virtual Q_INVOKABLE unity::shell::launcher::LauncherItemInterfaceget (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

unity::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

The Roles supported by the model.

See LauncherItemInterface properties for details.

Member Function Documentation

virtual Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* unity::shell::launcher::LauncherModelInterface::get ( int  index) const
pure virtual

Get a launcher item.

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

Parameters
indexthe index of the item to get
Returns
The item.
virtual Q_INVOKABLE void unity::shell::launcher::LauncherModelInterface::move ( int  oldIndex,
int  newIndex 
)
pure virtual

Move an item in the model.

Parameters
oldIndexThe current (old) index of the item to be moved.
newIndexThe new index where the item should be moved to.
virtual Q_INVOKABLE void unity::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
appIdThe appId of the item to be pinned.
indexThe 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.
virtual Q_INVOKABLE void unity::shell::launcher::LauncherModelInterface::quickListActionInvoked ( const QString &  appId,
int  actionIndex 
)
pure virtual

Trigger an action from the QuickList.

Parameters
appIdThe appId of the LauncherItem.
actionIndexThe index of the triggered entry in the QuickListModel.
virtual Q_INVOKABLE void unity::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
appIdThe appId of the item to be removed.
virtual Q_INVOKABLE void unity::shell::launcher::LauncherModelInterface::setAlerting ( const QString &  appId,
bool  alerting 
)
pure virtual

Set or unset alert-state on launcher item.

Parameters
appIdThe appId of the item to affect.
alertingThe flag to set/unset launcher item's alert state.
virtual Q_INVOKABLE void unity::shell::launcher::LauncherModelInterface::setUser ( const QString &  username)
pure virtual

Set the user for which the launcher should display items.

Parameters
usernameThe user for which the launcher should display items.

Property Documentation

unity::shell::application::ApplicationManagerInterface unity::shell::launcher::LauncherModelInterface::applicationManager
readwrite

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: