kmmainwidget.h 22.3 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
2
3
  This file is part of KMail, the KDE mail client.
  Copyright (c) 2002 Don Sanders <sanders@kde.org>
4

5
  Based on the work of Stefan Taferner <taferner@kde.org>
6

7
8
9
  KMail is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License, version 2, as
  published by the Free Software Foundation.
10

11
12
13
14
  KMail is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
15

16
17
18
  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
20
*/

Laurent Montel's avatar
Laurent Montel committed
21
22
#ifndef KMAIL_KMMAINWIDGET
#define KMAIL_KMMAINWIDGET
Stephan Kulow's avatar
Stephan Kulow committed
23

Allen Winter's avatar
Allen Winter committed
24
25
26
27
#include "kmail_export.h"
#include "kmreaderwin.h" //for inline actions
#include "kmkernel.h" // for access to config

Laurent Montel's avatar
Laurent Montel committed
28
#include "mailcommon/foldertreewidget.h"
29

30
#include <KXMLGUIClient>
31
#include "messageactions.h"
32
#include <KActionCollection>
Laurent Montel's avatar
Laurent Montel committed
33
#include <mailcommon/foldersettings.h>
34
#include <QPointer>
35
#include <QTimer>
36
#include <Akonadi/KMime/StandardMailActionManager>
Laurent Montel's avatar
Laurent Montel committed
37
#include <AkonadiCore/tag.h>
Laurent Montel's avatar
Laurent Montel committed
38
#include <MessageList/View>
Thomas McGuire's avatar
Thomas McGuire committed
39

40
41
42
43
44
45
#ifdef WITH_KUSERFEEDBACK
namespace KUserFeedback {
class NotificationPopup;
}
#endif

Laurent Montel's avatar
Laurent Montel committed
46
namespace MailTransport {
47
48
class Transport;
}
Laurent Montel's avatar
Laurent Montel committed
49
namespace Akonadi {
50
51
52
class Tag;
}

Laurent Montel's avatar
Laurent Montel committed
53
namespace KMime {
Laurent Montel's avatar
Laurent Montel committed
54
class Message;
55
}
Laurent Montel's avatar
Laurent Montel committed
56
class QUrl;
57
58
class QVBoxLayout;
class QSplitter;
59
class KMLaunchExternalComponent;
60
class DisplayMessageFormatActionMenu;
Laurent Montel's avatar
Laurent Montel committed
61
class QAction;
62
class KActionMenu;
63
class KToggleAction;
Stephan Kulow's avatar
Stephan Kulow committed
64
class KMMetaFilterActionCommand;
65
class CollectionPane;
66
67
class KMCommand;
class KMMoveCommand;
68
class KMTrashMsgCommand;
Laurent Montel's avatar
Laurent Montel committed
69
class KRecentFilesAction;
70
class ManageShowCollectionProperties;
71
class KActionMenuTransport;
Laurent Montel's avatar
Laurent Montel committed
72
class KActionMenuAccount;
Laurent Montel's avatar
Laurent Montel committed
73
class ZoomLabelWidget;
74

Laurent Montel's avatar
Laurent Montel committed
75
namespace KIO {
Laurent Montel's avatar
Laurent Montel committed
76
class Job;
Stephan Kulow's avatar
Stephan Kulow committed
77
78
}

Laurent Montel's avatar
Laurent Montel committed
79
namespace KMail {
Laurent Montel's avatar
Laurent Montel committed
80
81
82
83
class SearchWindow;
class VacationScriptIndicatorWidget;
class TagActionManager;
class FolderShortcutActionManager;
84
85
}

Laurent Montel's avatar
Laurent Montel committed
86
namespace KSieveUi {
87
class SieveImapPasswordProvider;
Laurent Montel's avatar
Laurent Montel committed
88
89
class ManageSieveScriptsDialog;
class VacationManager;
90
}
Laurent Montel's avatar
Laurent Montel committed
91
92
93
namespace MessageViewer {
class DKIMWidgetInfo;
}
Laurent Montel's avatar
Laurent Montel committed
94
namespace MailCommon {
Laurent Montel's avatar
Laurent Montel committed
95
96
class FolderSelectionDialog;
class FavoriteCollectionWidget;
97
class MailFilter;
Andras Mantia's avatar
Andras Mantia committed
98
}
Laurent Montel's avatar
Laurent Montel committed
99
class QStatusBar;
Allen Winter's avatar
Allen Winter committed
100
class KMAIL_EXPORT KMMainWidget : public QWidget
Stephan Kulow's avatar
Stephan Kulow committed
101
{
Laurent Montel's avatar
Laurent Montel committed
102
    Q_OBJECT
Stephan Kulow's avatar
Stephan Kulow committed
103

Laurent Montel's avatar
Laurent Montel committed
104
public:
Laurent Montel's avatar
Laurent Montel committed
105
    typedef QList<KMMainWidget *> PtrList;
106

Laurent Montel's avatar
Laurent Montel committed
107
    KMMainWidget(QWidget *parent, KXMLGUIClient *aGUIClient, KActionCollection *actionCollection, const KSharedConfig::Ptr &config = KMKernel::self()->config());
Laurent Montel's avatar
Laurent Montel committed
108
    ~KMMainWidget() override;
109
110
111
    void destruct();

    /** Read configuration options before widgets are created. */
112
    void readPreConfig();
113
114

    /** Read configuration for current folder. */
115
    void readFolderConfig();
116
117

    /** Write configuration for current folder. */
118
    void writeFolderConfig();
119
120

    /** Read configuration options after widgets are created. */
121
    void readConfig();
122
123

    /** Write configuration options. */
124
    void writeConfig(bool force = true);
125

126
127
    void writeReaderConfig();

128
    /** Easy access to main components of the window. */
Laurent Montel's avatar
Laurent Montel committed
129
    KMReaderWin *messageView() const;
130
    /** Access to the header list pane. */
Laurent Montel's avatar
Laurent Montel committed
131
    CollectionPane *messageListPane() const;
132

Laurent Montel's avatar
Laurent Montel committed
133
    Akonadi::Collection currentCollection() const;
Laurent Montel's avatar
Laurent Montel committed
134
    QSharedPointer<MailCommon::FolderSettings> currentFolder() const;
135
136

    static void cleanup();
Laurent Montel's avatar
Laurent Montel committed
137
138
139
140
141
142
    QAction *action(const QString &name);

    QAction *sendQueuedAction() const;

    KActionMenuTransport *sendQueueViaMenu() const;

143
144
145
146
    /**
      Returns a list of all KMMainWidgets. Warning, the list itself can be 0.
      @return the list of all main widgets, or 0 if it is not yet initialized
    */
147
    static const PtrList *mainWidgetList();
148

149
    QWidget *vacationScriptIndicator() const;
Laurent Montel's avatar
Laurent Montel committed
150
    QWidget *dkimWidgetInfo() const;
Laurent Montel's avatar
Laurent Montel committed
151
    MailCommon::FolderTreeView *folderTreeView() const;
Laurent Montel's avatar
Port++    
Laurent Montel committed
152

153
    /** Returns the XML GUI client. */
Laurent Montel's avatar
Laurent Montel committed
154
    KXMLGUIClient *guiClient() const;
Laurent Montel's avatar
Port++    
Laurent Montel committed
155

Laurent Montel's avatar
Laurent Montel committed
156
    KMail::TagActionManager *tagActionManager() const;
Laurent Montel's avatar
Laurent Montel committed
157

Laurent Montel's avatar
Laurent Montel committed
158
    KMail::FolderShortcutActionManager *folderShortcutActionManager() const;
159
    void savePaneSelection();
Laurent Montel's avatar
Port++    
Laurent Montel committed
160

161
    void updatePaneTagComboBox();
Laurent Montel's avatar
Laurent Montel committed
162

Laurent Montel's avatar
Laurent Montel committed
163
    void addRecentFile(const QUrl &mUrl);
164
165
    void updateQuickSearchLineText();

166
    void populateMessageListStatusFilterCombo();
Laurent Montel's avatar
Laurent Montel committed
167
    void initializePluginActions();
168

Laurent Montel's avatar
Laurent Montel committed
169
    Q_REQUIRED_RESULT Akonadi::Item::List currentSelection() const;
170

Laurent Montel's avatar
Laurent Montel committed
171
    Q_REQUIRED_RESULT QString fullCollectionPath() const;
172

Laurent Montel's avatar
Laurent Montel committed
173
    void initializeFilterActions(bool clearFilter);
174
175
176
177
178
179
180
181
182
    /** Clear and create actions for marked filters */
    void clearFilterActions();
    /**
     * Convenience function to get the action collection in a list.
     *
     * @return a list of action collections. The list only has one item, and
     *         that is the action collection of this main widget as returned
     *         by actionCollection().
     */
Laurent Montel's avatar
Laurent Montel committed
183
    Q_REQUIRED_RESULT QList<KActionCollection *> actionCollections() const;
184
185
186
187
    void refreshMessageListSelection();
    Akonadi::StandardMailActionManager *standardMailActionManager() const;
    QAction *akonadiStandardAction(Akonadi::StandardActionManager::Type type);
    QAction *akonadiStandardAction(Akonadi::StandardMailActionManager::Type type);
Laurent Montel's avatar
Laurent Montel committed
188
    QWidget *zoomLabelIndicator() const;
189

190
    void clearPluginActions();
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
public Q_SLOTS:

    /**
      Open a separate viewer window containing the specified message.
    */
    void slotMessageActivated(const Akonadi::Item &);

    /**
      Opens mail in the internal viewer.
    */
    void slotMessageSelected(const Akonadi::Item &);

    void slotItemsFetchedForActivation(KMCommand *command);
    void slotMessageStatusChangeRequest(const Akonadi::Item &, const Akonadi::MessageStatus &, const Akonadi::MessageStatus &);

    /** Adds if not existing/removes if existing the tag identified by @p aLabel
        in all selected messages */
    void slotUpdateMessageTagList(const Akonadi::Tag &tag);

    void slotSelectCollectionFolder(const Akonadi::Collection &col);

    void slotUpdateConfig();
Q_SIGNALS:
    void messagesTransfered(bool);
    void captionChangeRequest(const QString &caption);
    void recreateGui();

protected:
    void showEvent(QShowEvent *event) override;

Laurent Montel's avatar
Laurent Montel committed
221
private:
222
    void assignLoadExternalReference();
223
224
225
226
227
228
    KMail::MessageActions *messageActions() const;

    KActionMenu *filterMenu() const;

    KActionMenu *mailingListActionMenu() const;

229
230
231
232
233
234
235
236
237
238
239
240
241
242
    // Moving messages around
    /**
     * This will ask for a destination folder and move the currently selected
     * messages (in MessageListView) into it.
     */
    void slotMoveSelectedMessageToFolder();

    // Copying messages around

    /**
     * This will ask for a destination folder and copy the currently selected
     * messages (in MessageListView) into it.
     */
    void slotCopySelectedMessagesToFolder();
243
244
245
    /**
     * Implements the "move to trash" action
     */
246
    void slotTrashSelectedMessages();
247

248
    void slotCheckMail();
249
250
    void slotCheckMailOnStartup();

Laurent Montel's avatar
Laurent Montel committed
251
252
253
254
255
256
    /** Trigger the dialog for editing out-of-office scripts.  */
    void slotEditVacation(const QString &serverName);

    void slotStartCheckMail();
    void slotEndCheckMail();
    void restoreCollectionFolderViewConfig();
257
258
259
260
261
262
263
    /** Update message actions */
    void updateMessageActions(bool fast = false);
    void updateMessageActionsDelayed();
    /**
      Update message menu
    */
    void updateMessageMenu();
Laurent Montel's avatar
Laurent Montel committed
264

265
    void slotRemoveDuplicates();
266
267
268
269
    /**
      Select the given folder
      If the folder is 0 the intro is shown
    */
Laurent Montel's avatar
Laurent Montel committed
270
    void folderSelected(const Akonadi::Collection &col);
271
272
273
274
275

    /**
      Start a timer to update message actions
    */
    void startUpdateMessageActionsTimer();
276
    void slotSelectMoreMessageTagList();
277
278
    void setupActions();
    void createWidgets();
279
    void deleteWidgets();
280
    void layoutSplitters();
Laurent Montel's avatar
Laurent Montel committed
281
282
283
    void newFromTemplate(const Akonadi::Item &);
    void moveSelectedMessagesToFolder(const Akonadi::Collection &dest);
    void copySelectedMessagesToFolder(const Akonadi::Collection &dest);
284
    KActionCollection *actionCollection() const;
285
286
287
288
289
    /**
      @return the correct config dialog depending on whether the parent of
      the mainWidget is a KPart or a KMMainWindow.
      When dealing with geometries, use this pointer
    */
290
    KSharedConfig::Ptr config();
291

292
293
294
295
296
297
    void checkAkonadiServerManagerState();
    void updateHtmlMenuEntry();

    void updateMoveAction(const Akonadi::CollectionStatistics &statistic);
    void updateMoveAction(bool hasUnreadMails);

Laurent Montel's avatar
Laurent Montel committed
298
    void updateAllToTrashAction(qint64 statistics);
299
300
301

    /** Get override character encoding. */
    QString overrideEncoding() const;
302

303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
    void moveMessageSelected(MessageList::Core::MessageItemSetReference ref, const Akonadi::Collection &dest, bool confirmOnDeletion = true);

    void copyMessageSelected(const Akonadi::Item::List &selectMsg, const Akonadi::Collection &dest);

    /**
     * Move the messages referenced by the specified set to trash.
     * The set parameter must not be null and the ownership is passed
     * to this function.
     */
    void trashMessageSelected(MessageList::Core::MessageItemSetReference ref);
    /**
     * Set the status of the messages referenced by the specified set, eventually toggling it.
     * The set parameter must not be null and the ownership is passed to this function.
     */
    void setMessageSetStatus(const Akonadi::Item::List &select, const Akonadi::MessageStatus &status, bool toggle);
    /**
     * Toggles a tag for the messages referenced by the specified set.
     * The set parameter must not be null and the ownership is passed to this function.
     */
    void toggleMessageSetTag(const Akonadi::Item::List &select, const Akonadi::Tag &tag);
    /**
     * This applies setMessageSetStatus() on the current thread.
     */
    void setCurrentThreadStatus(const Akonadi::MessageStatus &status, bool toggle);

    void applyFilters(const Akonadi::Item::List &selectedMessages);
    void applyFilters(const Akonadi::Collection::List &selectedCols);
    void applyFilter(const Akonadi::Collection::List &selectedCols, const QString &filter);

    /**
     * Internal helper that creates the folder selection dialog used for the
     * move and copy to folder actions on demand. Only folders where items can
     * be added are listed.
     */
    MailCommon::FolderSelectionDialog *moveOrCopyToDialog();

    /**
     * Internal helper that creates the folder selection dialog used for
     * jumping to folders, or adding them as favourites. All folders are listed.
     */
    MailCommon::FolderSelectionDialog *selectFromAllFoldersDialog();

    /**
     * Internal helper that applies the current settings so the
     * favorite folder view.
     */
    void refreshFavoriteFoldersViewProperties();

    void openFilterDialog(const QByteArray &field, const QString &value);

Laurent Montel's avatar
Laurent Montel committed
353
    void showMessagePopup(const Akonadi::Item &msg, const QUrl &aUrl, const QUrl &imageUrl, const QPoint &aPoint, bool contactAlreadyExists, bool uniqueContactFound, const WebEngineViewer::WebHitTestResult &result);
354

Laurent Montel's avatar
Laurent Montel committed
355
356
    void setZoomChanged(qreal zoomFactor);

Laurent Montel's avatar
Laurent Montel committed
357
private Q_SLOTS:
358
    void updateFileMenu();
359
360
361
362
363
364
    void slotFilter();
    void slotManageSieveScripts();
    void slotCompose();
    void slotPostToML();
    void slotExpireFolder();
    void slotExpireAll();
Thomas McGuire's avatar
Thomas McGuire committed
365
    void slotArchiveFolder();
366
367
    void slotRemoveFolder();
    void slotEmptyFolder();
Laurent Montel's avatar
Laurent Montel committed
368
    void slotClearCurrentFolder();
369
    void slotAddFavoriteFolder();
Laurent Montel's avatar
Laurent Montel committed
370
    void slotShowSelectedFolderInPane();
371
372
373
    void slotOverrideHtmlLoadExt();
    void slotUseTemplate();
    void slotTrashThread();
374
    void slotDeleteThread(bool confirmDelete);    // completely delete thread
375
376
377
378
379
380
    void slotUndo();
    void slotReadOn();
    void slotSaveMsg();
    void slotOpenMsg();
    void slotSaveAttachments();
    void slotJumpToFolder();
381
    void slotCheckVacation();
382
383
    void slotDebugSieve();
    void slotApplyFilters();
384
385
    void slotApplyFiltersOnFolder(bool recursive);
    void slotApplyFilterOnFolder(bool recursive);
386
387
388
389
390
391
392
    void slotExpandThread();
    void slotExpandAllThreads();
    void slotCollapseThread();
    void slotCollapseAllThreads();
    void slotSetThreadStatusUnread();
    void slotSetThreadStatusRead();
    void slotSetThreadStatusImportant();
393
    void slotSetThreadStatusToAct();
394
395
396
    void slotSetThreadStatusWatched();
    void slotSetThreadStatusIgnored();
    void slotSendQueued();
Laurent Montel's avatar
Laurent Montel committed
397
    void slotSendQueuedVia(MailTransport::Transport *transport);
398
    void slotOnlineStatus();
Laurent Montel's avatar
Laurent Montel committed
399
    void slotUpdateOnlineStatus(KMailSettings::EnumNetworkState::type);
400
    void slotMessagePopup(const Akonadi::Item &aMsg, const WebEngineViewer::WebHitTestResult &result, const QPoint &aPoint);
Laurent Montel's avatar
Laurent Montel committed
401
    void slotContactSearchJobForMessagePopupDone(KJob *job);
Laurent Montel's avatar
Laurent Montel committed
402
    void slotSelectAllMessages();
403
    void slotFocusQuickSearch();
404

405
406
    void slotIntro();
    void slotShowStartupFolder();
407
    void slotCopyDecryptedTo(QAction *action);
408

409
    /** Message navigation */
410
411
412
413
414
415
416
417
    void slotSelectNextMessage();
    void slotExtendSelectionToNextMessage();
    void slotSelectNextUnreadMessage();
    void slotSelectPreviousMessage();
    void slotExtendSelectionToPreviousMessage();
    void slotSelectPreviousUnreadMessage();
    void slotFocusOnNextMessage();
    void slotFocusOnPrevMessage();
418
419
    void slotSelectFirstMessage();
    void slotSelectLastMessage();
420
421
    void slotSelectFocusedMessage();

422
423
424
425
426
427
428
    void slotNextUnreadFolder();
    void slotPrevUnreadFolder();

    /** etc. */
    void slotDisplayCurrentMessage();

    void slotShowNewFromTemplate();
Laurent Montel's avatar
Laurent Montel committed
429
430
    void slotDelayedShowNewFromTemplate(KJob *);
    void slotNewFromTemplate(QAction *);
431
432
433
434
435
436
437
438
439
440
441
442
443

    /** Update the undo action */
    void slotUpdateUndo();

    /** Update html and threaded messages preferences in Folder menu. */
    void updateFolderMenu();

    /** Settings menu */

    /** XML-GUI stuff */
    void slotEditNotifications();

    /** Slot to reply to a message */
Laurent Montel's avatar
Laurent Montel committed
444
445
    void slotCustomReplyToMsg(const QString &tmpl);
    void slotCustomReplyAllToMsg(const QString &tmpl);
446
    void slotForwardInlineMsg();
Laurent Montel's avatar
Laurent Montel committed
447
448
    void slotForwardAttachedMessage();
    void slotRedirectMessage();
Laurent Montel's avatar
Laurent Montel committed
449
    void slotCustomForwardMsg(const QString &tmpl);
450
451
452
453
    void slotSubjectFilter();
    void slotFromFilter();
    void slotToFilter();

Thomas McGuire's avatar
Thomas McGuire committed
454
    void slotConfigChanged();
455
456
457

    /** Show a splash screen for the longer-lasting operation */
    void slotShowBusySplash();
458

459
460
461
462
463
    /**
      Show a message screen explaining that we are currently offline, when
      an online folder is selected.
    */
    void showOfflinePage();
464
    void showResourceOfflinePage();
Laurent Montel's avatar
Laurent Montel committed
465
    void updateVacationScriptStatus(bool active, const QString &serverName = QString());
Volker Krause's avatar
Volker Krause committed
466

Laurent Montel's avatar
Laurent Montel committed
467
468
469
    void slotItemAdded(const Akonadi::Item &, const Akonadi::Collection &col);
    void slotItemRemoved(const Akonadi::Item &);
    void slotItemMoved(const Akonadi::Item &item, const Akonadi::Collection &from, const Akonadi::Collection &to);
Laurent Montel's avatar
Laurent Montel committed
470
    void slotCollectionStatisticsChanged(Akonadi::Collection::Id, const Akonadi::CollectionStatistics &);
471
472

    void slotAkonadiStandardActionUpdated();
Laurent Montel's avatar
Laurent Montel committed
473
474
    void slotCollectionChanged(const Akonadi::Collection &, const QSet<QByteArray> &);
    void slotCreateNewTab(bool);
Laurent Montel's avatar
Laurent Montel committed
475
    void slotUpdateActionsAfterMailChecking();
476
    void slotCreateAddressBookContact();
Laurent Montel's avatar
Laurent Montel committed
477
    void slotOpenRecentMessage(const QUrl &url);
478

479
    void slotMoveMessageToTrash();
480
481
482
    /**
     * Called when a "move to trash" operation is completed
     */
483
    void slotTrashMessagesCompleted(KMTrashMsgCommand *command);
484
485
486
487

    /**
     * Called when a "move" operation is completed
     */
Laurent Montel's avatar
Laurent Montel committed
488
    void slotMoveMessagesCompleted(KMMoveCommand *command);
489
490
491
492

    /**
     * Called when a "copy" operation is completed
     */
Laurent Montel's avatar
Laurent Montel committed
493
    void slotCopyMessagesCompleted(KMCommand *command);
494

495
    void slotRequestFullSearchFromQuickSearch();
Laurent Montel's avatar
Laurent Montel committed
496
497
    void slotFolderChanged(const Akonadi::Collection &);
    void slotCollectionFetched(int collectionId);
498

Laurent Montel's avatar
Laurent Montel committed
499
500
    void itemsReceived(const Akonadi::Item::List &list);
    void itemsFetchDone(KJob *job);
501

502
    void slotServerSideSubscription();
503
    void slotServerStateChanged(Akonadi::ServerManager::State state);
504
    void slotArchiveMails();
505
506
    void slotChangeDisplayMessageFormat(MessageViewer::Viewer::DisplayFormatMessage format);

507
    void slotCollectionRemoved(const Akonadi::Collection &col);
Laurent Montel's avatar
Laurent Montel committed
508
    void slotCcFilter();
509
510
    void slotDeleteMessages();

511
    void slotMarkAllMessageAsReadInCurrentFolderAndSubfolder();
512
    void slotRemoveDuplicateRecursive();
513
    void slotRedirectCurrentMessage();
Laurent Montel's avatar
Laurent Montel committed
514
    void slotEditCurrentVacation();
515
    void slotReplyMessageTo(const KMime::Message::Ptr &message, bool replyToAll);
516
private:
517
    void slotSetFocusToViewer();
Laurent Montel's avatar
Laurent Montel committed
518
    void deleteSelectedMessages(bool confirmDelete);    // completely delete message
519
    bool showSearchDialog();
520
521
    void clearCurrentFolder();
    void setCurrentCollection(const Akonadi::Collection &col);
Laurent Montel's avatar
Laurent Montel committed
522
    void showMessageActivities(const QString &str);
523
    void slotPageIsScrolledToBottom(bool isAtBottom);
Laurent Montel's avatar
Laurent Montel committed
524
    void printCurrentMessage(bool preview);
Laurent Montel's avatar
Laurent Montel committed
525
    void replyCurrentMessageCommand(MessageComposer::ReplyStrategy strategy);
526
    void setupUnifiedMailboxChecker();
527
    QAction *filterToAction(MailCommon::MailFilter *filter);
Laurent Montel's avatar
Laurent Montel committed
528
    Akonadi::Collection::List applyFilterOnCollection(bool recursive);
Laurent Montel's avatar
Laurent Montel committed
529
    void setShowStatusBarMessage(const QString &msg);
Laurent Montel's avatar
Laurent Montel committed
530
531
    void slotRestartAccount();
    void slotAccountSettings();
Laurent Montel's avatar
Laurent Montel committed
532

533
    // Message actions
534
535
536
537
538
539
540
541
542
543
544
545
546
    QAction *mDeleteAction = nullptr;
    QAction *mTrashThreadAction = nullptr;
    QAction *mDeleteThreadAction = nullptr;
    QAction *mSaveAsAction = nullptr;
    QAction *mApplyAllFiltersAction = nullptr;
    QAction *mSaveAttachmentsAction = nullptr;
    QAction *mOpenAction = nullptr;
    QAction *mMoveMsgToFolderAction = nullptr;
    QAction *mCollectionProperties = nullptr;
    QAction *mSendQueued = nullptr;
    QAction *mArchiveAction = nullptr;
    QAction *mSelectAllMessages = nullptr;
    KActionMenuTransport *mSendActionMenu = nullptr;
Laurent Montel's avatar
Laurent Montel committed
547
    QAction *mRestartAccountSettings = nullptr;
548
    // Filter actions
549
550
551
552
553
554
    KActionMenu *mFilterMenu = nullptr;
    QAction *mExpireConfigAction = nullptr;
    KActionMenu *mApplyFilterFolderActionsMenu = nullptr;
    KActionMenu *mApplyFilterFolderRecursiveActionsMenu = nullptr;
    QAction *mApplyAllFiltersFolderAction = nullptr;
    QAction *mApplyAllFiltersFolderRecursiveAction = nullptr;
555
    // Custom template actions menu
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
    KActionMenu *mTemplateMenu = nullptr;

    KActionMenu *mThreadStatusMenu = nullptr;
    KActionMenu *mApplyFilterActionsMenu = nullptr;
    QAction *mCopyActionMenu = nullptr;
    QAction *mMoveActionMenu = nullptr;
    QAction *mCopyDecryptedActionMenu = nullptr;
    QAction *mMarkThreadAsReadAction = nullptr;
    QAction *mMarkThreadAsUnreadAction = nullptr;
    KToggleAction *mToggleThreadImportantAction = nullptr;
    KToggleAction *mToggleThreadToActAction = nullptr;

    KToggleAction *mWatchThreadAction = nullptr;
    KToggleAction *mIgnoreThreadAction = nullptr;

    MailCommon::FavoriteCollectionWidget *mFavoriteCollectionsView = nullptr;
    Akonadi::FavoriteCollectionsModel *mFavoritesModel = nullptr;
    KMReaderWin *mMsgView = nullptr;
    QSplitter *mSplitter1 = nullptr;
    QSplitter *mSplitter2 = nullptr;
    QSplitter *mFolderViewSplitter = nullptr;
Thomas McGuire's avatar
Thomas McGuire committed
577
    Akonadi::Collection mTemplateFolder;
578
579
580
581
582
583
584
585
586
587
    bool mLongFolderList = false;
    bool mStartupDone = false;
    bool mWasEverShown = false;
    bool mHtmlGlobalSetting = false;
    bool mHtmlLoadExtGlobalSetting = false;
    bool mFolderHtmlLoadExtPreference = false;
    bool mReaderWindowActive = false;
    bool mReaderWindowBelow = false;
    bool mEnableFavoriteFolderView = false;
    bool mEnableFolderQuickSearch = false;
588

Volker Krause's avatar
Volker Krause committed
589
    QPointer<KMail::SearchWindow> mSearchWin;
590

Laurent Montel's avatar
Laurent Montel committed
591
592
593
594
595
596
    QAction *mExpireFolderAction = nullptr;
    QAction *mFolderMailingListPropertiesAction = nullptr;
    QAction *mShowFolderShortcutDialogAction = nullptr;
    QAction *mArchiveFolderAction = nullptr;
    QAction *mMessageNewList = nullptr;
    KToggleAction *mPreferHtmlLoadExtAction = nullptr;
597

Laurent Montel's avatar
Laurent Montel committed
598
599
    QTimer *menutimer = nullptr;
    QTimer *mShowBusySplashTimer = nullptr;
600

601
    KSieveUi::VacationManager *mVacationManager = nullptr;
Laurent Montel's avatar
Laurent Montel committed
602
603
604
    KActionCollection *mActionCollection = nullptr;
    QAction *mToolbarActionSeparator = nullptr;
    QVBoxLayout *mTopLayout = nullptr;
Laurent Montel's avatar
Laurent Montel committed
605
    bool mDestructed = false;
Laurent Montel's avatar
Laurent Montel committed
606
    QList<QAction *> mFilterMenuActions;
607
608
    QList<QAction *> mFilterFolderMenuActions;
    QList<QAction *> mFilterFolderMenuRecursiveActions;
Laurent Montel's avatar
Laurent Montel committed
609
610
    QList<QAction *> mFilterTBarActions;
    QList<KMMetaFilterActionCommand *> mFilterCommands;
611

Laurent Montel's avatar
Laurent Montel committed
612
613
    KMail::TagActionManager *mTagActionManager = nullptr;
    KMail::FolderShortcutActionManager *mFolderShortcutActionManager = nullptr;
614
    KSharedConfig::Ptr mConfig;
Laurent Montel's avatar
Laurent Montel committed
615
    KXMLGUIClient *mGUIClient = nullptr;
616

Laurent Montel's avatar
Laurent Montel committed
617
618
619
    KMail::MessageActions *mMsgActions = nullptr;
    Akonadi::StandardMailActionManager *mAkonadiStandardActionManager = nullptr;
    CollectionPane *mMessagePane = nullptr;
Laurent Montel's avatar
Laurent Montel committed
620
    QSharedPointer<MailCommon::FolderSettings> mCurrentFolderSettings;
621

Laurent Montel's avatar
Laurent Montel committed
622
    MailCommon::FolderTreeWidget *mFolderTreeWidget = nullptr;
623

Laurent Montel's avatar
Laurent Montel committed
624
    KMail::VacationScriptIndicatorWidget *mVacationScriptIndicator = nullptr;
Laurent Montel's avatar
Laurent Montel committed
625
626
    bool mVacationIndicatorActive = false;
    bool mGoToFirstUnreadMessageInSelectedFolder = false;
627
628
    MessageList::Core::PreSelectionMode mPreSelectionMode;

Laurent Montel's avatar
Laurent Montel committed
629
    QTimer mCheckMailTimer;
630

Laurent Montel's avatar
Laurent Montel committed
631
    KSieveUi::SieveImapPasswordProvider *mSievePasswordProvider = nullptr;
632
633
    QPointer<MailCommon::FolderSelectionDialog> mMoveOrCopyToDialog;
    QPointer<MailCommon::FolderSelectionDialog> mSelectFromAllFoldersDialog;
634
    QAction *mServerSideSubscription = nullptr;
635
    QAction *mAccountSettings = nullptr;
636
    KRecentFilesAction *mOpenRecentAction = nullptr;
637
    QPointer<KSieveUi::ManageSieveScriptsDialog> mManageSieveDialog;
Laurent Montel's avatar
Laurent Montel committed
638
639
    QAction *mQuickSearchAction = nullptr;
    DisplayMessageFormatActionMenu *mDisplayMessageFormatMenu = nullptr;
640
    MessageViewer::Viewer::DisplayFormatMessage mFolderDisplayFormatPreference = MessageViewer::Viewer::UseGlobalSetting;
Laurent Montel's avatar
Laurent Montel committed
641
642
643
644
645
646
647
    QAction *mSearchMessages = nullptr;
    KMLaunchExternalComponent *mLaunchExternalComponent = nullptr;
    ManageShowCollectionProperties *mManageShowCollectionProperties = nullptr;
    QAction *mShowIntroductionAction = nullptr;
    QAction *mMarkAllMessageAsReadAndInAllSubFolder = nullptr;
    KActionMenuAccount *mAccountActionMenu = nullptr;
    QAction *mRemoveDuplicateRecursiveAction = nullptr;
648
    Akonadi::Collection mCurrentCollection;
Laurent Montel's avatar
Laurent Montel committed
649
    QStatusBar *mCurrentStatusBar = nullptr;
Laurent Montel's avatar
Laurent Montel committed
650
    ZoomLabelWidget *mZoomLabelIndicator = nullptr;
651
652
653
#ifdef WITH_KUSERFEEDBACK
    KUserFeedback::NotificationPopup *mUserFeedBackNotificationPopup = nullptr;
#endif
Stephan Kulow's avatar
Stephan Kulow committed
654
655
656
};

#endif