KDE 4.9 PyKDE API Reference

- KDE's Python API

# StandardMailActionManager Class Reference

`from PyKDE4.akonadi import *`

Inherits: QObject
Namespace: Akonadi

## Detailed Description

Manages emails specific actions for collection and item views.

Author:
  Andras Mantia <amantia@kde.org>

Since:
  4.6

## Enumerations

Type | { MarkMailAsRead, MarkMailAsUnread, MarkMailAsImportant, MarkMailAsActionItem, MarkAllMailAsRead, MarkAllMailAsUnread, MarkAllMailAsImportant, MarkAllMailAsActionItem, MoveToTrash, MoveAllToTrash, RemoveDuplicates, EmptyAllTrash, EmptyTrash, LastType }

## Signals

| actionStateUpdated ()

## Methods

| __init__ (self, KActionCollection actionCollection, QWidget parent=0)
KAction | action (self, Akonadi.StandardMailActionManager.Type type)
KAction | action (self, Akonadi.StandardActionManager.Type type)
KAction | createAction (self, Akonadi.StandardMailActionManager.Type type)
KAction | createAction (self, Akonadi.StandardActionManager.Type type)
| createAllActions (self)
| interceptAction (self, Akonadi.StandardMailActionManager.Type type, bool intercept=1)
| interceptAction (self, Akonadi.StandardActionManager.Type type, bool intercept=1)
[Akonadi.Collection] | selectedCollections (self)
[Akonadi.Item] | selectedItems (self)
| setActionText (self, Akonadi.StandardActionManager.Type type, KLocalizedString text)
| setCollectionPropertiesPageNames (self, QStringList names)
| setCollectionSelectionModel (self, QItemSelectionModel selectionModel)
| setFavoriteCollectionsModel (self, Akonadi.FavoriteCollectionsModel favoritesModel)
| setFavoriteSelectionModel (self, QItemSelectionModel selectionModel)
| setItemSelectionModel (self, QItemSelectionModel selectionModel)
Akonadi.StandardActionManager | standardActionManager (self)

## Signal Documentation

actionStateUpdated | ( |  | ) |

This signal is emitted whenever the action state has been updated. In case you have special needs for changing the state of some actions, connect to this signal and adjust the action state.

Signal syntax:
  `QObject.connect(source, SIGNAL("actionStateUpdated()"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | KActionCollection | actionCollection,
|  | QWidget | parent=0
| ) |  |  |

Creates a new standard mail action manager.

Parameters:

  | actionCollection | The action collection to operate on.
  | parent | The parent widget.

KAction action | ( | self, |
|  | Akonadi.StandardMailActionManager.Type | type
| ) |  |  |

Returns the action of the given type, 0 if it has not been created (yet).

KAction action | ( | self, |
|  | Akonadi.StandardActionManager.Type | type
| ) |  |  |

Returns the action of the given type, 0 if it has not been created (yet).

KAction createAction | ( | self, |
|  | Akonadi.StandardMailActionManager.Type | type
| ) |  |  |

Creates the action of the given type and adds it to the action collection specified in the constructor if it does not exist yet. The action is connected to its default implementation provided by this class.

KAction createAction | ( | self, |
|  | Akonadi.StandardActionManager.Type | type
| ) |  |  |

Creates the action of the given type and adds it to the action collection specified in the constructor if it does not exist yet. The action is connected to its default implementation provided by this class.

createAllActions | ( |  | self ) |

Convenience method to create all standard actions.

See also:
  createAction()

interceptAction | ( | self, |
|  | Akonadi.StandardMailActionManager.Type | type,
|  | bool | intercept=1
| ) |  |  |

Sets whether the default implementation for the given action type shall be executed when the action is triggered.

Parameters:

  | intercept | If false, the default implementation will be executed, if true no action is taken.

interceptAction | ( | self, |
|  | Akonadi.StandardActionManager.Type | type,
|  | bool | intercept=1
| ) |  |  |

Sets whether the default implementation for the given action type shall be executed when the action is triggered.

Parameters:

  | intercept | If false, the default implementation will be executed, if true no action is taken.

[Akonadi.Collection] selectedCollections | ( |  | self ) |

Returns the list of collections that are currently selected. The list is empty if no collection is currently selected.

[Akonadi.Item] selectedItems | ( |  | self ) |

Returns the list of items that are currently selected. The list is empty if no item is currently selected.

setActionText | ( | self, |
|  | Akonadi.StandardActionManager.Type | type,
|  | KLocalizedString | text
| ) |  |  |

Sets the label of the action type to text, which is used during updating the action state and substituted according to the number of selected objects. This is mainly useful to customize the label of actions that can operate on multiple objects.

Example:

     acctMgr->setActionText( Akonadi.StandardActionManager.CopyItems,
                             ki18np( "Copy Item", "Copy %1 Items" ) );

setCollectionPropertiesPageNames | ( | self, |
|  | QStringList | names
| ) |  |  |

setCollectionSelectionModel | ( | self, |
|  | QItemSelectionModel | selectionModel
| ) |  |  |

Sets the collection selection model based on which the collection related actions should operate. If none is set, all collection actions will be disabled.

setFavoriteCollectionsModel | ( | self, |
|  | Akonadi.FavoriteCollectionsModel | favoritesModel
| ) |  |  |

Sets the favorite collections model based on which the collection relatedactions should operate. If none is set, the "Add to Favorite Folders" action will be disabled.

setFavoriteSelectionModel | ( | self, |
|  | QItemSelectionModel | selectionModel
| ) |  |  |

Sets the favorite collection selection model based on which the favorite collection related actions should operate. If none is set, all favorite modifications actions will be disabled.

setItemSelectionModel | ( | self, |
|  | QItemSelectionModel | selectionModel
| ) |  |  |

Sets the item selection model based on which the item related actions should operate. If none is set, all item actions will be disabled.

Akonadi.StandardActionManager standardActionManager | ( |  | self ) |

## Enumeration Documentation

Type

Describes the supported actions.

Enumerator:

  CreateCollection |
  CopyCollections |
  DeleteCollections |
  SynchronizeCollections |
  CollectionProperties |
  CopyItems |
  Paste |
  DeleteItems |
  ManageLocalSubscriptions |
  AddToFavoriteCollections |
  RemoveFromFavoriteCollections |
  RenameFavoriteCollection |
  CopyCollectionToMenu |
  CopyItemToMenu |
  MoveItemToMenu |
  MoveCollectionToMenu |
  CutItems |
  CutCollections |
  CreateResource |
  DeleteResources |
  ResourceProperties |
  SynchronizeResources |
  ToggleWorkOffline |
  CopyCollectionToDialog |
  MoveCollectionToDialog |
  CopyItemToDialog |
  MoveItemToDialog |
  SynchronizeCollectionsRecursive |
  MoveCollectionsToTrash |
  MoveItemsToTrash |
  RestoreCollectionsFromTrash |
  RestoreItemsFromTrash |
  MoveToTrashRestoreCollection |
  MoveToTrashRestoreCollectionAlternative |
  MoveToTrashRestoreItem |
  MoveToTrashRestoreItemAlternative |
  SynchronizeFavoriteCollections |
  LastType |