2 Copyright (c) 2007 Volker Krause <vkrause@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef KMAIL_MESSAGEACTIONS_H
20 #define KMAIL_MESSAGEACTIONS_H
22 #include "MessageComposer/MessageFactory"
32 class KActionCollection
;
42 namespace TemplateParser
44 class CustomTemplatesMenu
;
49 class KUriFilterSearchProviderActions
;
55 Manages common actions that can be performed on one or more messages.
57 class MessageActions
: public QObject
61 explicit MessageActions(KActionCollection
*ac
, QWidget
*parent
);
63 void setMessageView(KMReaderWin
*msgView
);
66 * This function adds or updates the actions of the forward action menu, taking the
67 * preference whether to forward inline or as attachment by default into account.
68 * This has to be called when that preference config has been changed.
70 void setupForwardActions(KActionCollection
*ac
);
73 * Sets up action list for forward menu.
75 void setupForwardingActionsList(KXMLGUIClient
*guiClient
);
77 void setCurrentMessage(const Akonadi::Item
&item
, const Akonadi::Item::List
&items
= Akonadi::Item::List());
79 KActionMenu
*replyMenu() const;
80 QAction
*replyListAction() const;
81 QAction
*forwardInlineAction() const;
82 QAction
*forwardAttachedAction() const;
83 QAction
*redirectAction() const;
85 KActionMenu
*messageStatusMenu() const;
86 KActionMenu
*forwardMenu() const;
88 QAction
*editAction() const;
89 QAction
*annotateAction() const;
90 QAction
*printAction() const;
91 QAction
*printPreviewAction() const;
92 QAction
*listFilterAction() const;
94 KActionMenu
*mailingListActionMenu() const;
95 TemplateParser::CustomTemplatesMenu
*customTemplatesMenu() const;
97 void addWebShortcutsMenu(QMenu
*menu
, const QString
&text
);
99 QAction
*debugBalooAction() const;
100 QAction
*addFollowupReminderAction() const;
103 // This signal is emitted when a reply is triggered and the
104 // action has finished.
105 // This is useful for the stand-alone reader, it might want to close the window in
107 void replyActionFinished();
110 void editCurrentMessage();
111 void annotateMessage();
114 void updateActions();
115 void replyCommand(MessageComposer::ReplyStrategy strategy
);
116 void addMailingListAction(const QString
&item
, const QUrl
&url
);
117 void addMailingListActions(const QString
&item
, const QList
<QUrl
> &list
);
118 void updateMailingListActions(const Akonadi::Item
&messageItem
);
119 void printMessage(bool preview
);
120 void clearMailingListActions();
123 void slotItemModified(const Akonadi::Item
&item
, const QSet
< QByteArray
> &partIdentifiers
);
124 void slotItemRemoved(const Akonadi::Item
&item
);
126 void slotReplyToMsg();
127 void slotReplyAuthorToMsg();
128 void slotReplyListToMsg();
129 void slotReplyAllToMsg();
130 void slotNoQuoteReplyToMsg();
131 void slotRunUrl(QAction
*urlAction
);
133 void slotPrintPreviewMsg();
135 void slotUpdateActionsFetchDone(KJob
*job
);
136 void slotMailingListFilter();
137 void slotDebugBaloo();
139 void slotAddFollowupReminder();
141 QList
<QAction
*> mMailListActionList
;
143 Akonadi::Item mCurrentItem
;
144 Akonadi::Item::List mVisibleItems
;
145 KMReaderWin
*mMessageView
;
147 KActionMenu
*mReplyActionMenu
;
148 QAction
*mReplyAction
;
149 QAction
*mReplyAllAction
;
150 QAction
*mReplyAuthorAction
;
151 QAction
*mReplyListAction
;
152 QAction
*mNoQuoteReplyAction
;
153 QAction
*mForwardInlineAction
;
154 QAction
*mForwardAttachedAction
;
155 QAction
*mRedirectAction
;
156 KActionMenu
*mStatusMenu
;
157 KActionMenu
*mForwardActionMenu
;
158 KActionMenu
*mMailingListActionMenu
;
159 QAction
*mEditAction
;
160 QAction
*mAnnotateAction
;
161 QAction
*mPrintAction
;
162 QAction
*mPrintPreviewAction
;
163 TemplateParser::CustomTemplatesMenu
*mCustomTemplatesMenu
;
164 QAction
*mListFilterAction
;
165 QAction
*mAddFollowupReminderAction
;
166 QAction
*mDebugBalooAction
;
167 KIO::KUriFilterSearchProviderActions
*mWebShortcutMenuManager
;