24#include "standardmailactionmanager.h"
26#include "emptytrashcommand_p.h"
27#include "markascommand_p.h"
28#include "movetotrashcommand_p.h"
29#include "specialmailcollections.h"
30#include "removeduplicatesjob.h"
32#include "akonadi/agentfilterproxymodel.h"
33#include "akonadi/agentinstance.h"
34#include "akonadi/agentinstancecreatejob.h"
35#include "akonadi/agentmanager.h"
36#include "akonadi/agenttypedialog.h"
37#include "akonadi/collectionstatistics.h"
38#include "akonadi/entitytreemodel.h"
39#include "akonadi/kmime/messagestatus.h"
41#include "akonadi/mimetypechecker.h"
42#include "akonadi/subscriptiondialog_p.h"
45#include <kactioncollection.h>
47#include <klocalizedstring.h>
48#include <kmessagebox.h>
49#include <kmime/kmime_message.h>
51#include <QtCore/QPointer>
52#include <QItemSelectionModel>
56class StandardMailActionManager::Private
60 : mActionCollection(actionCollection)
61 , mParentWidget(parentWidget)
62 , mCollectionSelectionModel(0)
63 , mItemSelectionModel(0)
71 mGenericManager->setMimeTypeFilter(QStringList() << KMime::Message::mimeType());
72 mGenericManager->setCapabilityFilter(QStringList() << QLatin1String(
"Resource"));
77 delete mGenericManager;
80 void updateGenericAllActions()
125 i18n(
"Add Folder..."));
127 i18n(
"Add a new folder to the currently selected account."));
129 i18n(
"Add a new folder to the currently selected account."));
131 mGenericManager->setContextText(
133 i18nc(
"@title:window",
"New Folder"));
135 mGenericManager->setContextText(
137 ki18n(
"Could not create folder: %1"));
139 mGenericManager->setContextText(
141 i18n(
"Folder creation failed"));
146 ki18np(
"Copy Folder",
"Copy %1 Folders"));
148 i18n(
"Copy the selected folders to the clipboard."));
150 i18n(
"Copy the selected folders to the clipboard."));
151 mGenericManager->setContextText(
153 ki18nc(
"@title:window",
"Properties of Folder %1"));
158 ki18np(
"Delete Folder",
"Delete %1 Folders"));
160 i18n(
"Delete the selected folders from the account."));
162 i18n(
"Delete the selected folders from the account."));
163 mGenericManager->setContextText(
165 ki18np(
"Do you really want to delete this folder and all its sub-folders?",
166 "Do you really want to delete %1 folders and all their sub-folders?"));
168 mGenericManager->setContextText(
170 ki18ncp(
"@title:window",
"Delete folder?",
"Delete folders?"));
172 mGenericManager->setContextText(
174 ki18n(
"Could not delete folder: %1"));
176 mGenericManager->setContextText(
178 i18n(
"Folder deletion failed"));
183 ki18np(
"Update Folder",
"Update Folders"));
186 i18n(
"Update the contents of the selected folders."));
188 i18n(
"Update the contents of the selected folders."));
192 ki18np(
"Cut Folder",
"Cut %1 Folders"));
194 i18n(
"Cut the selected folders from the account."));
196 i18n(
"Cut the selected folders from the account."));
200 i18n(
"Folder Properties..."));
202 i18n(
"Open a dialog to edit the properties of the selected folder."));
204 i18n(
"Open a dialog to edit the properties of the selected folder."));
208 ki18np(
"Copy Message",
"Copy %1 Messages"));
210 i18n(
"Copy the selected messages to the clipboard."));
212 i18n(
"Copy the selected messages to the clipboard."));
216 ki18np(
"Delete Message",
"Delete %1 Messages"));
218 i18n(
"Delete the selected messages from the folder."));
220 i18n(
"Delete the selected messages from the folder."));
221 mGenericManager->setContextText(
223 ki18np(
"Do you really want to delete the selected message?",
224 "Do you really want to delete %1 messages?"));
226 mGenericManager->setContextText(
228 ki18ncp(
"@title:window",
"Delete Message?",
"Delete Messages?"));
230 mGenericManager->setContextText(
232 ki18n(
"Could not delete message: %1"));
234 mGenericManager->setContextText(
236 i18n(
"Message deletion failed"));
240 ki18np(
"Cut Message",
"Cut %1 Messages"));
242 i18n(
"Cut the selected message from the folder."));
244 i18n(
"Cut the selected message from the folder."));
248 i18n(
"Add &Account..."));
250 i18n(
"Add a new account<p>"
251 "You will be presented with a dialog where you can select "
252 "the type of the account that shall be added.</p>"));
253 mGenericManager->setContextText(
255 i18nc(
"@title:window",
"Add Account"));
257 mGenericManager->setContextText(
259 ki18n(
"Could not create account: %1"));
261 mGenericManager->setContextText(
263 i18n(
"Account creation failed"));
267 ki18np(
"&Delete Account",
"&Delete %1 Accounts"));
269 i18n(
"Delete the selected accounts<p>"
270 "The currently selected accounts will be deleted, "
271 "along with all the messages they contain.</p>"));
272 mGenericManager->setContextText(
274 ki18np(
"Do you really want to delete this account?",
275 "Do you really want to delete %1 accounts?"));
277 mGenericManager->setContextText(
279 ki18ncp(
"@title:window",
"Delete Account?",
"Delete Accounts?"));
283 i18n(
"Account Properties..."));
285 i18n(
"Open a dialog to edit properties of the selected account."));
289 ki18np(
"Update Account",
"Update %1 Accounts"));
291 i18n(
"Updates the content of all folders of the selected accounts."));
297 ki18np(
"Update This Folder and All Its Subfolders",
298 "Update These Folders and All Their Subfolders"));
301 i18n(
"Update the contents of the selected folders and all their subfolders."));
303 i18n(
"Update the contents of the selected folders and all their subfolders."));
306 mGenericManager->setContextText(
308 ki18n(
"Could not paste message: %1"));
310 mGenericManager->setContextText(
312 i18n(
"Paste failed"));
322 const Akonadi::Item::List
selectedItems = mGenericManager->selectedItems();
328 if (itemIsSelected) {
329 bool allMarkedAsImportant =
true;
330 bool allMarkedAsRead =
true;
331 bool allMarkedAsUnread =
true;
332 bool allMarkedAsActionItem =
true;
338 allMarkedAsImportant =
false;
341 allMarkedAsRead =
false;
343 allMarkedAsUnread =
false;
346 allMarkedAsActionItem =
false;
352 updateMarkAction(
action, allMarkedAsRead);
353 if (allMarkedAsRead) {
354 action->setEnabled(
false);
362 updateMarkAction(
action, allMarkedAsUnread);
363 if (allMarkedAsUnread) {
364 action->setEnabled(
false);
372 action->setCheckable(
true);
373 updateMarkAction(
action, allMarkedAsImportant);
374 if (allMarkedAsImportant) {
375 action->setText(i18n(
"Remove Important Mark"));
378 action->setText(i18n(
"&Mark Mail as Important"));
379 action->setChecked(
false);
386 action->setCheckable(
true);
387 updateMarkAction(
action, allMarkedAsActionItem);
388 if (allMarkedAsActionItem) {
389 action->setText(i18n(
"Remove Action Item Mark"));
392 action->setText(i18n(
"&Mark Mail as Action Item"));
393 action->setChecked(
false);
400 action->setEnabled(
false);
405 action->setEnabled(
false);
410 action->setEnabled(
false);
414 bool enableMarkAllAsRead =
false;
415 bool enableMarkAllAsUnread =
false;
416 bool canDeleteItem =
true;
417 bool isSystemFolder =
false;
418 if (collectionIsSelected) {
420 if (collection.isValid()) {
422 if (!enableMarkAllAsRead) {
425 if (!enableMarkAllAsUnread) {
431 if (!isSystemFolder) {
440 if (enableMarkAllAsRead && enableMarkAllAsUnread && !canDeleteItem && isSystemFolder) {
446 if (isSystemFolder) {
461 action->setEnabled(enableMarkAllAsRead);
466 action->setEnabled(enableMarkAllAsUnread);
469 emit mParent->actionStateUpdated();
472 void updateMarkAction(QAction *
action,
bool allMarked)
474 QByteArray data =
action->data().toByteArray();
476 if (!data.startsWith(
'!')) {
480 if (data.startsWith(
'!')) {
489 const QAction *
action = qobject_cast<QAction *>(mParent->sender());
492 const Akonadi::Item::List items = mGenericManager->selectedItems();
493 if (items.isEmpty()) {
497 QByteArray typeStr =
action->data().toByteArray();
498 kDebug() <<
"Mark mail as: " << typeStr;
501 if (typeStr.startsWith(
'!')) {
503 typeStr = typeStr.mid(1);
510 if (typeStr ==
"U") {
514 }
else if (typeStr ==
"K") {
516 }
else if (typeStr ==
"G") {
520 if (mInterceptedActions.contains(type)) {
524 MarkAsCommand *command =
new MarkAsCommand(targetStatus, items, invert, mParent);
530 const QAction *
action = qobject_cast<QAction *>(mParent->sender());
533 QByteArray typeStr =
action->data().toByteArray();
534 kDebug() <<
"Mark all as: " << typeStr;
537 if (collections.isEmpty()) {
545 if (typeStr.startsWith(
'!')) {
547 typeStr = typeStr.mid(1);
551 if (typeStr ==
"U") {
555 }
else if (typeStr ==
"K") {
557 }
else if (typeStr ==
"G") {
561 if (mInterceptedActions.contains(type)) {
565 MarkAsCommand *command =
new MarkAsCommand(targetStatus, collections, invert, mParent);
569 void slotMoveToTrash()
575 if (mCollectionSelectionModel->selection().indexes().isEmpty()) {
579 const Item::List items = mGenericManager->selectedItems();
580 if (items.isEmpty()) {
584 MoveToTrashCommand *command =
new MoveToTrashCommand(mCollectionSelectionModel->model(), items, mParent);
588 void slotMoveAllToTrash()
594 if (mCollectionSelectionModel->selection().indexes().isEmpty()) {
598 const Collection::List collections = mGenericManager->selectedCollections();
599 if (collections.isEmpty()) {
603 MoveToTrashCommand *command =
new MoveToTrashCommand(mCollectionSelectionModel->model(), collections, mParent);
607 void slotRemoveDuplicates()
613 const Collection::List collections = mGenericManager->selectedCollections();
614 if (collections.isEmpty()) {
619 connect(job, SIGNAL(finished(KJob*)), mParent, SLOT(slotJobFinished(KJob*)));
622 void slotJobFinished(KJob *job)
625 Util::showJobError(job);
629 void slotEmptyAllTrash()
635 EmptyTrashCommand *command =
new EmptyTrashCommand(
const_cast<QAbstractItemModel *
>(mCollectionSelectionModel->model()), mParent);
639 void slotEmptyTrash()
645 if (mCollectionSelectionModel->selection().indexes().isEmpty()) {
649 const Collection::List collections = mGenericManager->selectedCollections();
650 if (collections.count() != 1) {
654 EmptyTrashCommand *command =
new EmptyTrashCommand(collections.first(), mParent);
658 KActionCollection *mActionCollection;
659 QWidget *mParentWidget;
661 QItemSelectionModel *mCollectionSelectionModel;
662 QItemSelectionModel *mItemSelectionModel;
663 QHash<StandardMailActionManager::Type, KAction *> mActions;
664 QSet<StandardMailActionManager::Type> mInterceptedActions;
670 , d(new Private(actionCollection, parent, this))
681 d->mCollectionSelectionModel = selectionModel;
682 d->mGenericManager->setCollectionSelectionModel(selectionModel);
684 connect(selectionModel->model(), SIGNAL(rowsInserted(QModelIndex,
int,
int)),
685 SLOT(updateActions()));
686 connect(selectionModel->model(), SIGNAL(rowsRemoved(QModelIndex,
int,
int)),
687 SLOT(updateActions()));
688 connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
689 SLOT(updateActions()));
696 d->mItemSelectionModel = selectionModel;
697 d->mGenericManager->setItemSelectionModel(selectionModel);
699 connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
700 SLOT(updateActions()));
703 connect(selectionModel->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
704 SLOT(updateActions()));
711 if (d->mActions.contains(type)) {
712 return d->mActions.value(type);
719 action =
new KAction(d->mParentWidget);
720 action->setIcon(KIcon(QLatin1String(
"mail-mark-read")));
721 action->setText(i18n(
"&Mark Message as Read"));
722 action->setIconText(i18n(
"Mark as Read"));
723 action->setHelpText(i18n(
"Mark selected messages as read."));
724 action->setWhatsThis(i18n(
"Mark selected messages as read."));
726 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_mark_as_read"),
action);
727 action->setData(QByteArray(
"R"));
728 action->setShortcut(Qt::CTRL + Qt::Key_R);
729 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMarkAs()));
732 action =
new KAction(d->mParentWidget);
733 action->setIcon(KIcon(QLatin1String(
"mail-mark-unread")));
734 action->setText(i18n(
"&Mark Message as Unread"));
735 action->setIconText(i18n(
"Mark as Unread"));
736 action->setHelpText(i18n(
"Mark selected messages as unread."));
737 action->setWhatsThis(i18n(
"Mark selected messages as unread."));
739 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_mark_as_unread"),
action);
740 action->setShortcut(Qt::CTRL + Qt::Key_U);
741 action->setData(QByteArray(
"U"));
742 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMarkAs()));
745 action =
new KAction(d->mParentWidget);
746 action->setIcon(KIcon(QLatin1String(
"mail-mark-important")));
747 action->setText(i18n(
"&Mark Message as Important"));
748 action->setIconText(i18n(
"Mark as Important"));
749 action->setHelpText(i18n(
"Mark selected messages as important."));
752 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_mark_as_important"),
action);
753 action->setData(QByteArray(
"G"));
754 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMarkAs()));
757 action =
new KAction(d->mParentWidget);
758 action->setIcon(KIcon(QLatin1String(
"mail-mark-task")));
759 action->setText(i18n(
"&Mark Message as Action Item"));
760 action->setIconText(i18n(
"Mark as Action Item"));
761 action->setHelpText(i18n(
"Mark selected messages as action items."));
762 action->setWhatsThis(i18n(
"Mark selected messages as action items."));
764 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_mark_as_action_item"),
action);
765 action->setData(QByteArray(
"K"));
766 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMarkAs()));
769 action =
new KAction(d->mParentWidget);
770 action->setIcon(KIcon(QLatin1String(
"mail-mark-read")));
771 action->setText(i18n(
"Mark &All Messages as Read"));
772 action->setIconText(i18n(
"Mark All as Read"));
773 action->setHelpText(i18n(
"Mark all messages as read."));
774 action->setWhatsThis(i18n(
"Mark all messages as read."));
776 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_mark_all_as_read"),
action);
777 action->setData(QByteArray(
"R"));
778 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMarkAllAs()));
781 action =
new KAction(d->mParentWidget);
782 action->setIcon(KIcon(QLatin1String(
"mail-mark-unread")));
783 action->setText(i18n(
"Mark &All Messages as Unread"));
784 action->setIconText(i18n(
"Mark All as Unread"));
785 action->setHelpText(i18n(
"Mark all messages as unread."));
786 action->setWhatsThis(i18n(
"Mark all messages as unread."));
788 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_mark_all_as_unread"),
action);
789 action->setData(QByteArray(
"U"));
790 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMarkAllAs()));
793 action =
new KAction(d->mParentWidget);
794 action->setIcon(KIcon(QLatin1String(
"mail-mark-important")));
795 action->setText(i18n(
"Mark &All Messages as Important"));
796 action->setIconText(i18n(
"Mark All as Important"));
797 action->setHelpText(i18n(
"Mark all messages as important."));
798 action->setWhatsThis(i18n(
"Mark all messages as important."));
800 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_mark_all_as_important"),
action);
801 action->setData(QByteArray(
"G"));
802 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMarkAllAs()));
805 action =
new KAction(d->mParentWidget);
806 action->setIconText(i18n(
"Mark All as Action Item"));
807 action->setText(i18n(
"Mark &All Messages as Action Item"));
808 action->setIcon(KIcon(QLatin1String(
"mail-mark-task")));
809 action->setHelpText(i18n(
"Mark all messages as action items."));
810 action->setWhatsThis(i18n(
"Mark all messages as action items."));
812 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_mark_all_as_action_item"),
action);
813 action->setData(QByteArray(
"K"));
814 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMarkAllAs()));
817 action =
new KAction(d->mParentWidget);
818 action->setIcon(KIcon(QLatin1String(
"user-trash")));
819 action->setText(i18n(
"Move to &Trash"));
820 action->setShortcut(QKeySequence(Qt::Key_Delete));
821 action->setHelpText(i18n(
"Move selected messages to the trash folder."));
822 action->setWhatsThis(i18n(
"Move selected messages to the trash folder."));
824 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_move_to_trash"),
action);
825 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMoveToTrash()));
828 action =
new KAction(d->mParentWidget);
829 action->setIcon(KIcon(QLatin1String(
"user-trash")));
830 action->setText(i18n(
"Move All to &Trash"));
831 action->setHelpText(i18n(
"Move all messages to the trash folder."));
832 action->setWhatsThis(i18n(
"Move all messages to the trash folder."));
834 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_move_all_to_trash"),
action);
835 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotMoveAllToTrash()));
838 action =
new KAction(d->mParentWidget);
839 action->setText(i18n(
"Remove &Duplicate Messages"));
840 action->setHelpText(i18n(
"Remove duplicate messages."));
841 action->setWhatsThis(i18n(
"Remove duplicate messages."));
842 action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Asterisk));
844 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_remove_duplicates"),
action);
845 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotRemoveDuplicates()));
848 action =
new KAction(d->mParentWidget);
849 action->setText(i18n(
"Empty All &Trash Folders"));
850 action->setHelpText(i18n(
"Permanently delete all messages from all trash folders."));
851 action->setWhatsThis(i18n(
"Permanently delete all messages from all trash folders."));
853 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_empty_all_trash"),
action);
854 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotEmptyAllTrash()));
857 action =
new KAction(d->mParentWidget);
858 action->setText(i18n(
"E&mpty Trash"));
859 action->setHelpText(i18n(
"Permanently delete all messages from the trash folder."));
860 action->setWhatsThis(i18n(
"Permanently delete all messages from the trash folder."));
862 d->mActionCollection->addAction(QString::fromLatin1(
"akonadi_empty_trash"),
action);
863 connect(
action, SIGNAL(triggered(
bool)),
this, SLOT(slotEmptyTrash()));
875 KAction *act = d->mGenericManager->action(type);
877 act = d->mGenericManager->createAction(type);
879 d->updateGenericAction(type);
899 d->mGenericManager->createAllActions();
900 d->updateGenericAllActions();
907 if (d->mActions.contains(type)) {
908 return d->mActions.value(type);
916 return d->mGenericManager->action(type);
921 d->mGenericManager->setActionText(type, text);
927 d->mInterceptedActions.insert(type);
929 d->mInterceptedActions.remove(type);
935 d->mGenericManager->interceptAction(type, intercept);
940 return d->mGenericManager->selectedCollections();
945 return d->mGenericManager->selectedItems();
950 d->mGenericManager->setFavoriteCollectionsModel(favoritesModel);
955 d->mGenericManager->setFavoriteSelectionModel(selectionModel);
958void StandardMailActionManager::setCollectionPropertiesPageNames(
const QStringList &names)
960 d->mGenericManager->setCollectionPropertiesPageNames(names);
965 return d->mGenericManager;
968#include "moc_standardmailactionmanager.cpp"
Provides statistics information of a Collection.
qint64 unreadCount() const
Returns the number of unread items in this collection or -1 if this information is not available.
qint64 count() const
Returns the number of items in this collection or -1 if this information is not available.
Represents a collection of PIM items.
QList< Collection > List
Describes a list of collections.
@ CanDeleteItem
Can delete items in this collection.
A model that lists a set of favorite collections.
Akonadi KMime Message Status.
void setRead(bool read=true)
Set the status to read.
bool isRead() const
Check for Read status.
bool isImportant() const
Check for Important status.
void setStatusFromFlags(const QSet< QByteArray > &flags)
Set the status as a whole e.g.
void setStatusFromStr(const QString &aStr)
Set the status based on a string representation.
bool isToAct() const
Check for ToAct status.
Job that finds and removes duplicate messages in given collection.
@ Inbox
The inbox collection.
@ Drafts
The drafts collection.
@ SentMail
The sent-mail collection.
@ Trash
The trash collection.
@ Outbox
The outbox collection.
@ Templates
The templates collection.
static SpecialMailCollections * self()
Returns the global SpecialMailCollections instance.
Akonadi::Collection defaultCollection(Type type) const
Returns the special mail collection of given type in the default resource, or an invalid collection i...
Manages generic actions for collection and item views.
Type
Describes the supported actions.
@ CreateResource
Creates a new resource.
@ CreateCollection
Creates an collection.
@ MoveToTrashRestoreItem
Move Item to Trash or Restore it from Trash, needs EntityDeletedAttribute.
@ SynchronizeResources
Synchronizes the selected resources.
@ RemoveFromFavoriteCollections
Remove the collection from the favorite collections model.
@ DeleteItems
Deletes the selected items.
@ CopyCollectionToDialog
Copy a collection into another collection, select the target in a dialog.
@ SynchronizeCollections
Synchronizes collections.
@ MoveCollectionToDialog
Move a collection into another collection, select the target in a dialog.
@ CopyItemToMenu
Menu allowing to quickly copy an item into a collection.
@ RenameFavoriteCollection
Rename the collection of the favorite collections model.
@ SynchronizeFavoriteCollections
Synchronize favorite collections.
@ ResourceProperties
Provides the resource properties.
@ CutItems
Cuts the selected items.
@ DeleteCollections
Deletes the selected collections.
@ MoveToTrashRestoreCollection
Move Collection to Trash or Restore it from Trash, needs EntityDeletedAttribute.
@ ToggleWorkOffline
Toggles the work offline state of all resources.
@ ManageLocalSubscriptions
Manages local subscriptions.
@ CutCollections
Cuts the selected collections.
@ CopyCollectionToMenu
Menu allowing to quickly copy a collection into another collection.
@ MoveItemToMenu
Menu allowing to move item into a collection.
@ AddToFavoriteCollections
Add the collection to the favorite collections model.
@ SynchronizeCollectionsRecursive
Synchronizes collections in a recursive way.
@ MoveItemsToTrash
Moves the selected items to trash and marks them as deleted, needs EntityDeletedAttribute.
@ CopyCollections
Copies the selected collections.
@ Paste
Paste collections or items.
@ CollectionProperties
Provides collection properties.
@ MoveToTrashRestoreCollectionAlternative
Helper type for MoveToTrashRestoreCollection, do not create directly. Use this to override texts of t...
@ DeleteResources
Deletes the selected resources.
@ RestoreItemsFromTrash
Restores the selected items from trash, needs EntityDeletedAttribute.
@ MoveToTrashRestoreItemAlternative
Helper type for MoveToTrashRestoreItem, do not create directly. Use this to override texts of the res...
@ RestoreCollectionsFromTrash
Restores the selected collection from trash, needs EntityDeletedAttribute.
@ CopyItems
Copies the selected items.
@ MoveCollectionToMenu
Menu allowing to move a collection into another collection.
@ MoveItemToDialog
Move an item into a collection, select the target in a dialog.
@ CopyItemToDialog
Copy an item into a collection, select the target in a dialog.
@ MoveCollectionsToTrash
Moves the selected collection to trash and marks it as deleted, needs EntityDeletedAttribute.
@ MessageBoxText
The text of a message box.
@ ErrorMessageText
The text of an error message.
@ MessageBoxTitle
The window title of a message box.
@ DialogTitle
The window title of a dialog.
@ ErrorMessageTitle
The window title of an error message.
Manages emails specific actions for collection and item views.
~StandardMailActionManager()
Destroys the standard mail action manager.
void setFavoriteCollectionsModel(FavoriteCollectionsModel *favoritesModel)
Sets the favorite collections model based on which the collection relatedactions should operate.
KAction * action(Type type) const
Returns the action of the given type, 0 if it has not been created (yet).
StandardMailActionManager(KActionCollection *actionCollection, QWidget *parent=0)
Creates a new standard mail action manager.
KAction * createAction(Type type)
Creates the action of the given type and adds it to the action collection specified in the constructo...
void setActionText(StandardActionManager::Type type, const KLocalizedString &text)
Sets the label of the action type to text, which is used during updating the action state and substit...
void setItemSelectionModel(QItemSelectionModel *selectionModel)
Sets the item selection model based on which the item related actions should operate.
void setFavoriteSelectionModel(QItemSelectionModel *selectionModel)
Sets the favorite collection selection model based on which the favorite collection related actions s...
void createAllActions()
Convenience method to create all standard actions.
Akonadi::Item::List selectedItems() const
Returns the list of items that are currently selected.
Type
Describes the supported actions.
@ RemoveDuplicates
Removes all duplicated messages.
@ MoveToTrash
Move all selected messages and folders to trash.
@ EmptyTrash
Empties the trash folder, if a trash folder was selected.
@ MarkMailAsActionItem
Marks a mail as action item.
@ MarkMailAsRead
Marks a mail as read.
@ MarkAllMailAsActionItem
Marks all mails in a folder as action item.
@ MarkMailAsUnread
Marks a mail as unread.
@ EmptyAllTrash
Empties trash folders on all accounts.
@ MoveAllToTrash
Move all messages of the current folder to trash.
@ MarkAllMailAsImportant
Marks all mails in a folder as important.
@ MarkAllMailAsRead
Marks all mails in a folder as read.
@ MarkMailAsImportant
Marks a mail as important.
@ MarkAllMailAsUnread
Marks all mails in a folder as unread.
Akonadi::Collection::List selectedCollections() const
Returns the list of collections that are currently selected.
void interceptAction(Type type, bool intercept=true)
Sets whether the default implementation for the given action type shall be executed when the action i...
void actionStateUpdated()
This signal is emitted whenever the action state has been updated.
void setCollectionSelectionModel(QItemSelectionModel *selectionModel)
Sets the collection selection model based on which the collection related actions should operate.
FreeBusyManager::Singleton.