Akonadi Mime
standardmailactionmanager.cpp
46 StandardMailActionManagerPrivate(KActionCollection *actionCollection, QWidget *parentWidget, StandardMailActionManager *parent)
57 [this](const Collection::List &selectedCollections, const Collection::List &selectedFavoriteCollections, const Item::List &selectedItems) {
62 QObject::connect(mGenericManager, &StandardActionManager::actionStateUpdated, mParent, &StandardMailActionManager::actionStateUpdated);
123 mGenericManager->setContextText(StandardActionManager::CreateCollection, StandardActionManager::DialogTitle, i18nc("@title:window", "New Folder"));
129 mGenericManager->setContextText(StandardActionManager::CreateCollection, StandardActionManager::ErrorMessageTitle, i18n("Folder creation failed"));
133 mGenericManager->setActionText(Akonadi::StandardActionManager::CopyCollections, ki18np("Copy Folder", "Copy %1 Folders"));
134 mGenericManager->action(Akonadi::StandardActionManager::CopyCollections)->setWhatsThis(i18n("Copy the selected folders to the clipboard."));
135 setHelpText(mGenericManager->action(Akonadi::StandardActionManager::CopyCollections), i18n("Copy the selected folders to the clipboard."));
141 mGenericManager->setActionText(Akonadi::StandardActionManager::DeleteCollections, ki18np("Delete Folder", "Delete %1 Folders"));
142 mGenericManager->action(Akonadi::StandardActionManager::DeleteCollections)->setWhatsThis(i18n("Delete the selected folders from the account."));
143 setHelpText(mGenericManager->action(Akonadi::StandardActionManager::DeleteCollections), i18n("Delete the selected folders from the account."));
157 mGenericManager->setContextText(StandardActionManager::DeleteCollections, StandardActionManager::ErrorMessageTitle, i18n("Folder deletion failed"));
161 mGenericManager->setActionText(Akonadi::StandardActionManager::SynchronizeCollections, ki18np("Update Folder", "Update Folders"));
163 mGenericManager->action(Akonadi::StandardActionManager::SynchronizeCollections)->setWhatsThis(i18n("Update the contents of the selected folders."));
164 setHelpText(mGenericManager->action(Akonadi::StandardActionManager::SynchronizeCollections), i18n("Update the contents of the selected folders."));
167 mGenericManager->setActionText(Akonadi::StandardActionManager::CutCollections, ki18np("Cut Folder", "Cut %1 Folders"));
168 mGenericManager->action(Akonadi::StandardActionManager::CutCollections)->setWhatsThis(i18n("Cut the selected folders from the account."));
169 setHelpText(mGenericManager->action(Akonadi::StandardActionManager::CutCollections), i18n("Cut the selected folders from the account."));
172 mGenericManager->action(Akonadi::StandardActionManager::CollectionProperties)->setText(i18n("Folder Properties"));
179 mGenericManager->setActionText(Akonadi::StandardActionManager::CopyItems, ki18np("Copy Message", "Copy %1 Messages"));
180 mGenericManager->action(Akonadi::StandardActionManager::CopyItems)->setWhatsThis(i18n("Copy the selected messages to the clipboard."));
181 setHelpText(mGenericManager->action(Akonadi::StandardActionManager::CopyItems), i18n("Copy the selected messages to the clipboard."));
184 mGenericManager->setActionText(Akonadi::StandardActionManager::DeleteItems, ki18np("Delete Message", "Delete %1 Messages"));
185 mGenericManager->action(Akonadi::StandardActionManager::DeleteItems)->setWhatsThis(i18n("Delete the selected messages from the folder."));
186 setHelpText(mGenericManager->action(Akonadi::StandardActionManager::DeleteItems), i18n("Delete the selected messages from the folder."));
189 ki18np("Do you really want to delete the selected message?", "Do you really want to delete %1 messages?"));
195 mGenericManager->setContextText(StandardActionManager::DeleteItems, StandardActionManager::ErrorMessageText, ki18n("Could not delete message: %1"));
197 mGenericManager->setContextText(StandardActionManager::DeleteItems, StandardActionManager::ErrorMessageTitle, i18n("Message deletion failed"));
200 mGenericManager->setActionText(Akonadi::StandardActionManager::CutItems, ki18np("Cut Message", "Cut %1 Messages"));
201 mGenericManager->action(Akonadi::StandardActionManager::CutItems)->setWhatsThis(i18n("Cut the selected message from the folder."));
202 setHelpText(mGenericManager->action(Akonadi::StandardActionManager::CutItems), i18n("Cut the selected message from the folder."));
205 mGenericManager->action(Akonadi::StandardActionManager::CreateResource)->setText(i18n("Add &Account…"));
210 mGenericManager->setContextText(StandardActionManager::CreateResource, StandardActionManager::DialogTitle, i18nc("@title:window", "Add Account"));
216 mGenericManager->setContextText(StandardActionManager::CreateResource, StandardActionManager::ErrorMessageTitle, i18n("Account creation failed"));
219 mGenericManager->setActionText(Akonadi::StandardActionManager::DeleteResources, ki18np("&Delete Account", "&Delete %1 Accounts"));
226 ki18np("Do you really want to delete this account?", "Do you really want to delete %1 accounts?"));
233 mGenericManager->action(Akonadi::StandardActionManager::ResourceProperties)->setText(i18n("Account Properties…"));
238 mGenericManager->setActionText(Akonadi::StandardActionManager::SynchronizeResources, ki18np("Update Account", "Update %1 Accounts"));
244 ki18np("Update This Folder and All Its Subfolders", "Update These Folders and All Their Subfolders"));
248 setHelpText(mGenericManager->action(Akonadi::StandardActionManager::SynchronizeCollectionsRecursive),
252 mGenericManager->setContextText(StandardActionManager::Paste, StandardActionManager::ErrorMessageText, ki18n("Could not paste message: %1"));
254 mGenericManager->setContextText(StandardActionManager::Paste, StandardActionManager::ErrorMessageTitle, i18n("Paste failed"));
357 void updateActions(const Collection::List &selectedCollections, const Collection::List &selectedFavoriteCollections, const Item::List &selectedItems)
382 isSystemFolder = (collection == SpecialMailCollections::self()->defaultCollection(SpecialMailCollections::Inbox)
383 || collection == SpecialMailCollections::self()->defaultCollection(SpecialMailCollections::Outbox)
384 || collection == SpecialMailCollections::self()->defaultCollection(SpecialMailCollections::SentMail)
385 || collection == SpecialMailCollections::self()->defaultCollection(SpecialMailCollections::Trash)
386 || collection == SpecialMailCollections::self()->defaultCollection(SpecialMailCollections::Drafts)
387 || collection == SpecialMailCollections::self()->defaultCollection(SpecialMailCollections::Templates)
388 || collection == SpecialMailCollections::self()->defaultCollection(SpecialMailCollections::Spam));
442 void markItemsAs(QByteArray typeStr, const Akonadi::Item::List &items, bool checkIntercept = true)
488 void markAllItemsAs(QByteArray typeStr, const Akonadi::Collection::List &collections, bool checkIntercept = true)
572 auto command = new MoveToTrashCommand(mCollectionSelectionModel->model(), collections, mParent);
606 auto command = new EmptyTrashCommand(const_cast<QAbstractItemModel *>(mCollectionSelectionModel->model()), mParent);
639StandardMailActionManager::StandardMailActionManager(KActionCollection *actionCollection, QWidget *parent)
930void StandardMailActionManager::setActionText(StandardActionManager::Type type, const KLocalizedString &text)
944void StandardMailActionManager::interceptAction(StandardActionManager::Type type, bool intercept)
959void StandardMailActionManager::setFavoriteCollectionsModel(FavoriteCollectionsModel *favoritesModel)
979void StandardMailActionManager::markItemsAs(const QByteArray &typeStr, const Item::List &items, bool checkIntercept)
984void StandardMailActionManager::markAllItemsAs(const QByteArray &typeStr, const Collection::List &collections, bool checkIntercept)
qint64 unreadCount() const
qint64 count() const
CanDeleteItem
void setStatusFromFlags(const QSet< QByteArray > &flags)
Set the status as a whole e.g.
Definition messagestatus.cpp:617
void setStatusFromStr(const QString &aStr)
Set the status based on a string representation.
Definition messagestatus.cpp:501
Job that finds and removes duplicate messages in given collection.
Definition removeduplicatesjob.h:31
static SpecialMailCollections * self()
Returns the global SpecialMailCollections instance.
Definition specialmailcollections.cpp:76
Akonadi::Collection defaultCollection(Type type) const
Returns the special mail collection of given type in the default resource, or an invalid collection i...
Definition specialmailcollections.cpp:110
void setActionText(Type type, const KLocalizedString &text)
void actionStateUpdated()
Akonadi::Item::List selectedItems() const
void setCapabilityFilter(const QStringList &capabilities)
void setMimeTypeFilter(const QStringList &mimeTypes)
CreateResource
CreateCollection
MoveToTrashRestoreItem
SynchronizeResources
RemoveFromFavoriteCollections
DeleteItems
CopyCollectionToDialog
SynchronizeCollections
MoveCollectionToDialog
CopyItemToMenu
RenameFavoriteCollection
SynchronizeFavoriteCollections
ResourceProperties
DeleteCollections
MoveToTrashRestoreCollection
ToggleWorkOffline
ManageLocalSubscriptions
CutCollections
CopyCollectionToMenu
MoveItemToMenu
AddToFavoriteCollections
SynchronizeCollectionsRecursive
MoveItemsToTrash
CopyCollections
CollectionProperties
MoveToTrashRestoreCollectionAlternative
DeleteResources
RestoreItemsFromTrash
MoveToTrashRestoreItemAlternative
RestoreCollectionsFromTrash
MoveCollectionToMenu
MoveItemToDialog
CopyItemToDialog
MoveCollectionsToTrash
void setContextText(Type type, TextContext context, const KLocalizedString &text)
Akonadi::Collection::List selectedCollections() const
QAction * action(Type type) const
void selectionsChanged(const Collection::List &selectedCollectionsList, const Collection::List &selectedFavoriteCollectionsList, const Item::List &selectedItems)
MessageBoxText
ErrorMessageText
MessageBoxTitle
DialogTitle
ErrorMessageTitle
Manages emails specific actions for collection and item views.
Definition standardmailactionmanager.h:36
void setFavoriteCollectionsModel(FavoriteCollectionsModel *favoritesModel)
Sets the favorite collections model based on which the collection relatedactions should operate.
Definition standardmailactionmanager.cpp:959
StandardMailActionManager(KActionCollection *actionCollection, QWidget *parent=nullptr)
Creates a new standard mail action manager.
Definition standardmailactionmanager.cpp:639
~StandardMailActionManager() override
Destroys the standard mail action manager.
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...
Definition standardmailactionmanager.cpp:930
void setItemSelectionModel(QItemSelectionModel *selectionModel)
Sets the item selection model based on which the item related actions should operate.
Definition standardmailactionmanager.cpp:668
QAction * createAction(Type type)
Creates the action of the given type and adds it to the action collection specified in the constructo...
Definition standardmailactionmanager.cpp:683
void setFavoriteSelectionModel(QItemSelectionModel *selectionModel)
Sets the favorite collection selection model based on which the favorite collection related actions s...
Definition standardmailactionmanager.cpp:964
void createAllActions()
Convenience method to create all standard actions.
Definition standardmailactionmanager.cpp:897
Akonadi::Item::List selectedItems() const
Returns the list of items that are currently selected.
Definition standardmailactionmanager.cpp:954
@ MoveToTrash
Move all selected messages and folders to trash.
Definition standardmailactionmanager.h:53
@ EmptyTrash
Empties the trash folder, if a trash folder was selected.
Definition standardmailactionmanager.h:57
@ MarkAllMailAsReadRecursive
Marks all mails in a folder and its subfolders as read.
Definition standardmailactionmanager.h:49
@ MarkAllMailAsActionItem
Marks all mails in a folder as action item.
Definition standardmailactionmanager.h:52
@ MoveAllToTrash
Move all messages of the current folder to trash.
Definition standardmailactionmanager.h:54
@ MarkAllMailAsImportant
Marks all mails in a folder as important.
Definition standardmailactionmanager.h:51
@ MarkAllMailAsUnread
Marks all mails in a folder as unread.
Definition standardmailactionmanager.h:50
Akonadi::Collection::List selectedCollections() const
Returns the list of collections that are currently selected.
Definition standardmailactionmanager.cpp:949
void interceptAction(Type type, bool intercept=true)
Sets whether the default implementation for the given action type shall be executed when the action i...
Definition standardmailactionmanager.cpp:935
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.
Definition standardmailactionmanager.cpp:647
QAction * action(Type type) const
Returns the action of the given type, 0 if it has not been created (yet).
Definition standardmailactionmanager.cpp:920
int error() const
void finished(KJob *job)
static QString mimeType()
Q_SCRIPTABLE CaptureState status()
KLocalizedString KI18N_EXPORT ki18np(const char *singular, const char *plural)
KLocalizedString KI18N_EXPORT ki18n(const char *text)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text)
QString i18n(const char *text, const TYPE &arg...)
Type type(const QSqlDatabase &db)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
void rowsInserted(const QModelIndex &parent, int first, int last)
void rowsRemoved(const QModelIndex &parent, int first, int last)
void setCheckable(bool)
void setChecked(bool)
QVariant data() const const
void setEnabled(bool)
void setIcon(const QIcon &icon)
void setIconText(const QString &text)
void setData(const QVariant &data)
void setStatusTip(const QString &statusTip)
void setText(const QString &text)
void setToolTip(const QString &tip)
void triggered(bool checked)
void setWhatsThis(const QString &what)
QByteArray & prepend(QByteArrayView ba)
QByteArray & remove(qsizetype pos, qsizetype len)
bool startsWith(QByteArrayView bv) const const
T value(const Key &key) const const
QIcon fromTheme(const QString &name)
QModelIndexList indexes() const const
QAbstractItemModel * model()
const QItemSelection selection() const const
qsizetype count() const const
T & first()
bool isEmpty() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * sender() const const
bool contains(const QSet< T > &other) const const
Key_R
CTRL
QByteArray toByteArray() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:31 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:31 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.