kmmainwidget.h 22.2 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
2
  This file is part of KMail, the KDE mail client.
3
  SPDX-FileCopyrightText: 2002 Don Sanders <sanders@kde.org>
4

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

7
  SPDX-License-Identifier: GPL-2.0-only
8
9
*/

Laurent Montel's avatar
Laurent Montel committed
10
#pragma once
Stephan Kulow's avatar
Stephan Kulow committed
11

Allen Winter's avatar
Allen Winter committed
12
13
#include "kmail_export.h"
#include "kmkernel.h" // for access to config
Laurent Montel's avatar
Laurent Montel committed
14
#include "kmreaderwin.h" //for inline actions
Allen Winter's avatar
Allen Winter committed
15

Laurent Montel's avatar
Laurent Montel committed
16
#include <MailCommon/FolderTreeWidget>
17

18
#include "messageactions.h"
Laurent Montel's avatar
Laurent Montel committed
19
#include <Akonadi/KMime/StandardMailActionManager>
20
#include <Akonadi/Tag>
21
#include <KActionCollection>
Laurent Montel's avatar
Laurent Montel committed
22
#include <KXMLGUIClient>
Laurent Montel's avatar
Laurent Montel committed
23
#include <MailCommon/FolderSettings>
Laurent Montel's avatar
Laurent Montel committed
24
#include <MessageList/View>
25
#include <QPointer>
26
#include <QTimer>
Thomas McGuire's avatar
Thomas McGuire committed
27

28
#ifdef WITH_KUSERFEEDBACK
Laurent Montel's avatar
Laurent Montel committed
29
30
namespace KUserFeedback
{
31
32
33
34
class NotificationPopup;
}
#endif

Laurent Montel's avatar
Laurent Montel committed
35
36
namespace MailTransport
{
37
38
class Transport;
}
Laurent Montel's avatar
Laurent Montel committed
39
40
namespace Akonadi
{
41
42
43
class Tag;
}

Laurent Montel's avatar
Laurent Montel committed
44
45
namespace KMime
{
Laurent Montel's avatar
Laurent Montel committed
46
class Message;
47
}
Laurent Montel's avatar
Laurent Montel committed
48
class QUrl;
49
50
class QVBoxLayout;
class QSplitter;
51
class KMLaunchExternalComponent;
52
class DisplayMessageFormatActionMenu;
Laurent Montel's avatar
Laurent Montel committed
53
class QAction;
54
class KActionMenu;
55
class KToggleAction;
Stephan Kulow's avatar
Stephan Kulow committed
56
class KMMetaFilterActionCommand;
57
class CollectionPane;
58
59
class KMCommand;
class KMMoveCommand;
60
class KMTrashMsgCommand;
Laurent Montel's avatar
Laurent Montel committed
61
class KRecentFilesMenu;
62
class ManageShowCollectionProperties;
63
class KActionMenuTransport;
Laurent Montel's avatar
Laurent Montel committed
64
class KActionMenuAccount;
Laurent Montel's avatar
Laurent Montel committed
65
class ZoomLabelWidget;
66

Laurent Montel's avatar
Laurent Montel committed
67
68
namespace KIO
{
Laurent Montel's avatar
Laurent Montel committed
69
class Job;
Stephan Kulow's avatar
Stephan Kulow committed
70
71
}

Laurent Montel's avatar
Laurent Montel committed
72
73
namespace KMail
{
Laurent Montel's avatar
Laurent Montel committed
74
75
76
77
class SearchWindow;
class VacationScriptIndicatorWidget;
class TagActionManager;
class FolderShortcutActionManager;
78
79
}

Laurent Montel's avatar
Laurent Montel committed
80
81
namespace KSieveUi
{
82
class SieveImapPasswordProvider;
Laurent Montel's avatar
Laurent Montel committed
83
84
class ManageSieveScriptsDialog;
class VacationManager;
85
}
Laurent Montel's avatar
Laurent Montel committed
86
87
namespace MailCommon
{
Laurent Montel's avatar
Laurent Montel committed
88
89
class FolderSelectionDialog;
class FavoriteCollectionWidget;
90
class MailFilter;
Andras Mantia's avatar
Andras Mantia committed
91
}
Laurent Montel's avatar
Laurent Montel committed
92
class QStatusBar;
93
class KMailPluginCheckBeforeDeletingManagerInterface;
94
class HistorySwitchFolderManager;
Allen Winter's avatar
Allen Winter committed
95
class KMAIL_EXPORT KMMainWidget : public QWidget
Stephan Kulow's avatar
Stephan Kulow committed
96
{
Laurent Montel's avatar
Laurent Montel committed
97
    Q_OBJECT
Stephan Kulow's avatar
Stephan Kulow committed
98

Laurent Montel's avatar
Laurent Montel committed
99
public:
Laurent Montel's avatar
Laurent Montel committed
100
101
102
103
    KMMainWidget(QWidget *parent,
                 KXMLGUIClient *aGUIClient,
                 KActionCollection *actionCollection,
                 const KSharedConfig::Ptr &config = KMKernel::self()->config());
Laurent Montel's avatar
Laurent Montel committed
104
    ~KMMainWidget() override;
105
106
107
    void destruct();

    /** Read configuration options before widgets are created. */
108
    void readPreConfig();
109
110

    /** Read configuration for current folder. */
111
    void readFolderConfig();
112
113

    /** Write configuration for current folder. */
114
    void writeFolderConfig();
115
116

    /** Read configuration options after widgets are created. */
117
    void readConfig();
118
119

    /** Write configuration options. */
120
    void writeConfig(bool force = true);
121

122
123
    void writeReaderConfig();

124
    /** Easy access to main components of the window. */
125
    Q_REQUIRED_RESULT KMReaderWin *messageView() const;
126
    /** Access to the header list pane. */
Laurent Montel's avatar
Laurent Montel committed
127
    CollectionPane *messageListPane() const;
128

129
130
    Q_REQUIRED_RESULT Akonadi::Collection currentCollection() const;
    Q_REQUIRED_RESULT QSharedPointer<MailCommon::FolderSettings> currentFolder() const;
131
132

    static void cleanup();
Laurent Montel's avatar
Laurent Montel committed
133
134
135
136
137
138
    QAction *action(const QString &name);

    QAction *sendQueuedAction() const;

    KActionMenuTransport *sendQueueViaMenu() const;

139
140
141
142
    /**
      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
    */
143
    static const KMMainWidget *mainWidgetList();
144

145
    QWidget *vacationScriptIndicator() const;
Laurent Montel's avatar
Laurent Montel committed
146
    Q_REQUIRED_RESULT QWidget *dkimWidgetInfo() const;
Laurent Montel's avatar
Laurent Montel committed
147
    MailCommon::FolderTreeView *folderTreeView() const;
Laurent Montel's avatar
Port++    
Laurent Montel committed
148

149
    /** Returns the XML GUI client. */
Laurent Montel's avatar
Laurent Montel committed
150
    KXMLGUIClient *guiClient() const;
Laurent Montel's avatar
Port++    
Laurent Montel committed
151

Laurent Montel's avatar
Laurent Montel committed
152
    KMail::TagActionManager *tagActionManager() const;
Laurent Montel's avatar
Laurent Montel committed
153

Laurent Montel's avatar
Laurent Montel committed
154
    KMail::FolderShortcutActionManager *folderShortcutActionManager() const;
155
    void savePaneSelection();
Laurent Montel's avatar
Port++    
Laurent Montel committed
156

157
    void updatePaneTagComboBox();
Laurent Montel's avatar
Laurent Montel committed
158

Laurent Montel's avatar
Laurent Montel committed
159
    void addRecentFile(const QUrl &mUrl);
160
161
    void updateQuickSearchLineText();

162
    void populateMessageListStatusFilterCombo();
Laurent Montel's avatar
Laurent Montel committed
163
    void initializePluginActions();
164

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

Laurent Montel's avatar
Laurent Montel committed
167
    Q_REQUIRED_RESULT QString fullCollectionPath() const;
168

Laurent Montel's avatar
Laurent Montel committed
169
    void initializeFilterActions(bool clearFilter);
170
171
172
173
174
175
176
177
178
    /** 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
179
    Q_REQUIRED_RESULT QList<KActionCollection *> actionCollections() const;
180
181
182
183
    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
184
    Q_REQUIRED_RESULT QWidget *zoomLabelIndicator() const;
185

186
    void clearPluginActions();
Laurent Montel's avatar
Laurent Montel committed
187

Laurent Montel's avatar
Laurent Montel committed
188
    void replyMessageTo(const Akonadi::Item &item, bool replyToAll);
189
190
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
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 captionChangeRequest(const QString &caption);
    void recreateGui();

protected:
    void showEvent(QShowEvent *event) override;

Laurent Montel's avatar
Laurent Montel committed
218
private:
219
    void assignLoadExternalReference();
220
221
222
223
224
225
    KMail::MessageActions *messageActions() const;

    KActionMenu *filterMenu() const;

    KActionMenu *mailingListActionMenu() const;

226
227
228
229
230
231
232
233
234
235
236
237
238
239
    // 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();
240
241
242
    /**
     * Implements the "move to trash" action
     */
243
    void slotTrashSelectedMessages();
244

245
    void slotCheckMail();
246
247
    void slotCheckMailOnStartup();

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

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

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

    /**
      Start a timer to update message actions
    */
    void startUpdateMessageActionsTimer();
273
    void slotSelectMoreMessageTagList();
274
275
    void setupActions();
    void createWidgets();
276
    void deleteWidgets();
277
    void layoutSplitters();
Laurent Montel's avatar
Laurent Montel committed
278
279
280
    void newFromTemplate(const Akonadi::Item &);
    void moveSelectedMessagesToFolder(const Akonadi::Collection &dest);
    void copySelectedMessagesToFolder(const Akonadi::Collection &dest);
281
    KActionCollection *actionCollection() const;
282
283
284
285
286
    /**
      @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
    */
287
    Q_REQUIRED_RESULT KSharedConfig::Ptr config();
288

289
290
291
292
293
294
    void checkAkonadiServerManagerState();
    void updateHtmlMenuEntry();

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

Laurent Montel's avatar
Laurent Montel committed
295
    void updateAllToTrashAction(qint64 statistics);
296
297

    /** Get override character encoding. */
298
    Q_REQUIRED_RESULT QString overrideEncoding() const;
299

300
301
302
303
304
305
306
307
308
309
310
311
312
313
    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.
     */
Laurent Montel's avatar
Laurent Montel committed
314
    void setMessageSetStatus(const Akonadi::Item::List &select, Akonadi::MessageStatus status, bool toggle);
315
316
317
318
319
320
321
322
    /**
     * 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.
     */
Laurent Montel's avatar
Laurent Montel committed
323
    void setCurrentThreadStatus(Akonadi::MessageStatus status, bool toggle);
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

    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
350
351
352
353
354
355
356
    void showMessagePopup(const Akonadi::Item &msg,
                          const QUrl &aUrl,
                          const QUrl &imageUrl,
                          const QPoint &aPoint,
                          bool contactAlreadyExists,
                          bool uniqueContactFound,
                          const WebEngineViewer::WebHitTestResult &result);
357

Laurent Montel's avatar
Laurent Montel committed
358
359
    void setZoomChanged(qreal zoomFactor);

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

408
409
    void slotIntro();
    void slotShowStartupFolder();
410
    void slotCopyDecryptedTo(QAction *action);
411

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

425
426
427
428
429
430
431
    void slotNextUnreadFolder();
    void slotPrevUnreadFolder();

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

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

    /** 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
447
448
    void slotCustomReplyToMsg(const QString &tmpl);
    void slotCustomReplyAllToMsg(const QString &tmpl);
449
    void slotForwardInlineMsg();
Laurent Montel's avatar
Laurent Montel committed
450
451
    void slotForwardAttachedMessage();
    void slotRedirectMessage();
452
    void slotNewMessageToRecipients();
Laurent Montel's avatar
Laurent Montel committed
453
    void slotCustomForwardMsg(const QString &tmpl);
454
455
456
457
    void slotSubjectFilter();
    void slotFromFilter();
    void slotToFilter();

Thomas McGuire's avatar
Thomas McGuire committed
458
    void slotConfigChanged();
459
460
461

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

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

Laurent Montel's avatar
Laurent Montel committed
471
472
473
    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
474
    void slotCollectionStatisticsChanged(Akonadi::Collection::Id, const Akonadi::CollectionStatistics &);
475
476

    void slotAkonadiStandardActionUpdated();
Laurent Montel's avatar
Laurent Montel committed
477
478
    void slotCollectionChanged(const Akonadi::Collection &, const QSet<QByteArray> &);
    void slotCreateNewTab(bool);
Laurent Montel's avatar
Laurent Montel committed
479
    void slotUpdateActionsAfterMailChecking();
480
    void slotCreateAddressBookContact();
Laurent Montel's avatar
Laurent Montel committed
481
    void slotOpenRecentMessage(const QUrl &url);
482

483
    void slotMoveMessageToTrash();
484
485
486
    /**
     * Called when a "move to trash" operation is completed
     */
487
    void slotTrashMessagesCompleted(KMTrashMsgCommand *command);
488
489
490
491

    /**
     * Called when a "move" operation is completed
     */
Laurent Montel's avatar
Laurent Montel committed
492
    void slotMoveMessagesCompleted(KMMoveCommand *command);
493
494
495
496

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

499
    void slotRequestFullSearchFromQuickSearch();
Laurent Montel's avatar
Laurent Montel committed
500
501
    void slotFolderChanged(const Akonadi::Collection &);
    void slotCollectionFetched(int collectionId);
502

Laurent Montel's avatar
Laurent Montel committed
503
504
    void itemsReceived(const Akonadi::Item::List &list);
    void itemsFetchDone(KJob *job);
505

506
    void slotServerSideSubscription();
507
    void slotServerStateChanged(Akonadi::ServerManager::State state);
508
    void slotArchiveMails();
509
510
    void slotChangeDisplayMessageFormat(MessageViewer::Viewer::DisplayFormatMessage format);

511
    void slotCollectionRemoved(const Akonadi::Collection &col);
Laurent Montel's avatar
Laurent Montel committed
512
    void slotCcFilter();
513
514
    void slotDeleteMessages();

515
    void slotMarkAllMessageAsReadInCurrentFolderAndSubfolder();
516
    void slotRemoveDuplicateRecursive();
517
    void slotRedirectCurrentMessage();
Laurent Montel's avatar
Laurent Montel committed
518
    void slotEditCurrentVacation();
519
    void slotReplyMessageTo(const KMime::Message::Ptr &message, bool replyToAll);
Laurent Montel's avatar
Laurent Montel committed
520

521
private:
522
    void slotSetFocusToViewer();
Laurent Montel's avatar
Laurent Montel committed
523
    void deleteSelectedMessages(bool confirmDelete); // completely delete message
524
    bool showSearchDialog();
525
526
    void clearCurrentFolder();
    void setCurrentCollection(const Akonadi::Collection &col);
Laurent Montel's avatar
Laurent Montel committed
527
    void showMessageActivities(const QString &str);
528
    void slotPageIsScrolledToBottom(bool isAtBottom);
Laurent Montel's avatar
Laurent Montel committed
529
    void printCurrentMessage(bool preview);
530
    void setupUnifiedMailboxChecker();
531
    QAction *filterToAction(MailCommon::MailFilter *filter);
532
    Q_REQUIRED_RESULT Akonadi::Collection::List applyFilterOnCollection(bool recursive);
Laurent Montel's avatar
Laurent Montel committed
533
    void setShowStatusBarMessage(const QString &msg);
Laurent Montel's avatar
Laurent Montel committed
534
535
    void slotRestartAccount();
    void slotAccountSettings();
536
    void updateDisplayFormatMessage();
537

538
    // Message actions
539
540
541
542
543
544
545
546
547
548
549
550
551
    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
552
    QAction *mRestartAccountSettings = nullptr;
553
    // Filter actions
554
555
556
557
558
559
    KActionMenu *mFilterMenu = nullptr;
    QAction *mExpireConfigAction = nullptr;
    KActionMenu *mApplyFilterFolderActionsMenu = nullptr;
    KActionMenu *mApplyFilterFolderRecursiveActionsMenu = nullptr;
    QAction *mApplyAllFiltersFolderAction = nullptr;
    QAction *mApplyAllFiltersFolderRecursiveAction = nullptr;
560
    // Custom template actions menu
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
    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
582
    Akonadi::Collection mTemplateFolder;
583
584
585
586
587
588
589
590
591
592
    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;
593

Volker Krause's avatar
Volker Krause committed
594
    QPointer<KMail::SearchWindow> mSearchWin;
595

Laurent Montel's avatar
Laurent Montel committed
596
597
598
599
600
601
    QAction *mExpireFolderAction = nullptr;
    QAction *mFolderMailingListPropertiesAction = nullptr;
    QAction *mShowFolderShortcutDialogAction = nullptr;
    QAction *mArchiveFolderAction = nullptr;
    QAction *mMessageNewList = nullptr;
    KToggleAction *mPreferHtmlLoadExtAction = nullptr;
602

Laurent Montel's avatar
Laurent Montel committed
603
604
    QTimer *menutimer = nullptr;
    QTimer *mShowBusySplashTimer = nullptr;
605

606
    KSieveUi::VacationManager *mVacationManager = nullptr;
Laurent Montel's avatar
Laurent Montel committed
607
608
609
    KActionCollection *mActionCollection = nullptr;
    QAction *mToolbarActionSeparator = nullptr;
    QVBoxLayout *mTopLayout = nullptr;
Laurent Montel's avatar
Laurent Montel committed
610
    bool mDestructed = false;
Laurent Montel's avatar
Laurent Montel committed
611
    QList<QAction *> mFilterMenuActions;
612
613
    QList<QAction *> mFilterFolderMenuActions;
    QList<QAction *> mFilterFolderMenuRecursiveActions;
Laurent Montel's avatar
Laurent Montel committed
614
615
    QList<QAction *> mFilterTBarActions;
    QList<KMMetaFilterActionCommand *> mFilterCommands;
616

Laurent Montel's avatar
Laurent Montel committed
617
618
    KMail::TagActionManager *mTagActionManager = nullptr;
    KMail::FolderShortcutActionManager *mFolderShortcutActionManager = nullptr;
619
    KSharedConfig::Ptr mConfig;
Laurent Montel's avatar
Laurent Montel committed
620
    KXMLGUIClient *mGUIClient = nullptr;
621

Laurent Montel's avatar
Laurent Montel committed
622
623
624
    KMail::MessageActions *mMsgActions = nullptr;
    Akonadi::StandardMailActionManager *mAkonadiStandardActionManager = nullptr;
    CollectionPane *mMessagePane = nullptr;
Laurent Montel's avatar
Laurent Montel committed
625
    QSharedPointer<MailCommon::FolderSettings> mCurrentFolderSettings;
626

Laurent Montel's avatar
Laurent Montel committed
627
    MailCommon::FolderTreeWidget *mFolderTreeWidget = nullptr;
628

Laurent Montel's avatar
Laurent Montel committed
629
    KMail::VacationScriptIndicatorWidget *mVacationScriptIndicator = nullptr;
Laurent Montel's avatar
Laurent Montel committed
630
631
    bool mVacationIndicatorActive = false;
    bool mGoToFirstUnreadMessageInSelectedFolder = false;
632
633
    MessageList::Core::PreSelectionMode mPreSelectionMode;

Laurent Montel's avatar
Laurent Montel committed
634
    QTimer mCheckMailTimer;
635

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