Unity 8
|
A model of top-level surfaces. More...
#include <plugins/WindowManager/TopLevelSurfaceList.h>
Inherits QAbstractListModel.
Public Types | |
enum | Roles { SurfaceRole = Qt::UserRole, ApplicationRole = Qt::UserRole + 1, IdRole = Qt::UserRole + 2 } |
The Roles supported by the model. More... | |
Public Slots | |
unity::shell::application::MirSurfaceInterface * | surfaceAt (int index) const |
Returns the surface at the given index. More... | |
unity::shell::application::ApplicationInfoInterface * | applicationAt (int index) const |
Returns the application at the given index. | |
int | idAt (int index) const |
Returns the unique id of the element at the given index. | |
int | indexForId (int id) const |
Returns the index where the row with the given id is located. More... | |
void | raiseId (int id) |
Raises the row with the given id to index 0. | |
void | doRaiseId (int id) |
Signals | |
void | countChanged () |
void | listChanged () |
Emitted when the list changes. More... | |
void | nextIdChanged () |
void | applicationsModelChanged () |
Properties | |
QAbstractListModel | applicationsModel |
A list model of applications. More... | |
int | count |
Number of top-level surfaces in this model. More... | |
int | nextId |
A model of top-level surfaces.
It's an abstraction of top-level application windows.
When an entry first appears, it normaly doesn't have a surface yet, meaning that the application is still starting up. A shell should then display a splash screen or saved screenshot of the application until its surface comes up.
As applications can have multiple surfaces and you can also have entries without surfaces at all, the only way to unambiguously refer to an entry in this model is through its id.
Definition at line 47 of file TopLevelSurfaceList.h.
The Roles supported by the model.
SurfaceRole - A MirSurfaceInterface. It will be null if the application is still starting up ApplicationRole - An ApplicationInfoInterface IdRole - A unique identifier for this entry. Useful to unambiguosly track elements as they move around in the list
Definition at line 82 of file TopLevelSurfaceList.h.
|
slot |
Returns the index where the row with the given id is located.
Returns -1 if there's no row with the given id.
Definition at line 272 of file TopLevelSurfaceList.cpp.
|
signal |
Emitted when the list changes.
Emitted when model gains an element, loses an element or when elements exchange positions.
|
slot |
Returns the surface at the given index.
It will be a nullptr if the application is still starting up and thus hasn't yet created and drawn into a surface.
Definition at line 245 of file TopLevelSurfaceList.cpp.
|
readwrite |
A list model of applications.
It's expected to have a role called "application" which returns a ApplicationInfoInterface
Definition at line 59 of file TopLevelSurfaceList.h.
|
read |
Number of top-level surfaces in this model.
This is the same as rowCount, added in order to keep compatibility with QML ListModels.
Definition at line 66 of file TopLevelSurfaceList.h.
|
read |
The id to be used on the next entry created Useful for tests
Definition at line 72 of file TopLevelSurfaceList.h.