# class AgentInstanceModel

###

Module | akonadi
Namespace | Akonadi
Class | AgentInstanceModel
Inherits | QAbstractItemModel

Provides a data model for agent instances.

This class provides the interface of a QAbstractItemModel to access all available agent instances: their name, identifier, supported mimetypes and capabilities.

    Akonadi.AgentInstanceModel *model = new Akonadi.AgentInstanceModel( this );

    QListView *view = new QListView( this );
    view->setModel( model );

To show only agent instances that match a given mime type or special capabilities, use the AgentFilterProxyModel on top of this model.

Author Tobias Koenig <tokoe@kde.org>

### enums

- Roles { TypeRole, TypeIdentifierRole, DescriptionRole, MimeTypesRole, CapabilitiesRole, InstanceRole, InstanceIdentifierRole, StatusRole, StatusMessageRole, ProgressRole, OnlineRole, UserRole }

enum details

### methods

- AgentInstanceModel (parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  parent | QObject | 0

  Creates a new agent instance model.

  parent - The parent object.

- columnCount (parent)

  returns int

  Argument | Type | Default
  --- | --- | ---
  parent | QModelIndex | QModelIndex()

- data (index, role)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |
  role | int | Qt.DisplayRole

- flags (index)

  returns Qt.ItemFlags

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |

- headerData (section, orientation, role)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  section | int |
  orientation | Qt.Orientation |
  role | int | Qt.DisplayRole

- index (row, column, parent)

  returns QModelIndex

  Argument | Type | Default
  --- | --- | ---
  row | int |
  column | int |
  parent | QModelIndex | QModelIndex()

- parent (index)

  returns QModelIndex

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |

- rowCount (parent)

  returns int

  Argument | Type | Default
  --- | --- | ---
  parent | QModelIndex | QModelIndex()

- setData (index, value, role)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |
  value | QVariant |
  role | int |

### enums - detail

- Roles { TypeRole, TypeIdentifierRole, DescriptionRole, MimeTypesRole, CapabilitiesRole, InstanceRole, InstanceIdentifierRole, StatusRole, StatusMessageRole, ProgressRole, OnlineRole, UserRole }

  Describes the roles of this model.

  | TypeRole | - Qt::UserRole+1 | - |
  | TypeIdentifierRole | - | - |
  | DescriptionRole | - | - |
  | MimeTypesRole | - | - |
  | CapabilitiesRole | - | - |
  | InstanceRole | - | - |
  | InstanceIdentifierRole | - | - |
  | StatusRole | - | - |
  | StatusMessageRole | - | - |
  | ProgressRole | - | - |
  | OnlineRole | - | - |
  | UserRole | - Qt::UserRole+42 | - |