21 #ifndef __KMMAINWIDGET
22 #define __KMMAINWIDGET
28 #include "foldertreewidget.h"
30 #include <kxmlguiclient.h>
32 #include <kactioncollection.h>
33 #include <foldercollection.h>
37 #include <akonadi/kmime/standardmailactionmanager.h>
38 #include <messagelist/core/view.h>
56 class KRecentFilesAction;
57 class QDBusPendingCallWatcher;
58 template <
typename T,
typename S>
class QMap;
67 class TagActionManager;
68 class FolderShortcutActionManager;
69 class VacationManager;
73 class SieveDebugDialog;
75 class ManageSieveScriptsDialog;
78 namespace MailCommon {
79 class FolderSelectionDialog;
80 class FavoriteCollectionWidget;
91 KActionCollection *actionCollection,
100 void readFolderConfig();
103 void writeFolderConfig();
109 void writeConfig(
bool force =
true);
111 void writeReaderConfig();
120 static void cleanup();
121 QAction *
action(
const QString &name ) {
return mActionCollection->action( name ); }
124 KAction *
editAction()
const {
return mMsgActions->editAction(); }
135 static const PtrList *mainWidgetList();
137 QLabel* vacationScriptIndicator()
const;
141 return mFolderTreeWidget->folderTreeView();
148 return mTagActionManager;
152 return mFolderShortcutActionManager;
154 void savePaneSelection();
156 void updatePaneTagComboBox();
160 void addRecentFile(
const KUrl& mUrl);
167 void slotMoveSelectedMessageToFolder();
175 void slotCopySelectedMessagesToFolder();
180 void slotTrashSelectedMessages();
182 void slotCheckMail();
184 void slotCheckMailOnStartup();
190 void folderSelected(
const Akonadi::Collection & col );
195 void slotMessageActivated(
const Akonadi::Item & );
200 void slotMessageSelected(
const Akonadi::Item & );
202 void slotItemsFetchedForActivation(
const Akonadi::Item::List &list );
203 void slotMessageStatusChangeRequest(
const Akonadi::Item &,
const Akonadi::MessageStatus &,
const Akonadi::MessageStatus & );
206 void slotReplaceMsgByUnencryptedVersion();
211 void updateMessageMenu();
216 void startUpdateMessageActionsTimer();
219 void updateMessageActions(
bool fast =
false );
220 void updateMessageActionsDelayed();
223 void clearFilterActions();
224 void initializeFilterActions();
228 void slotEditVacation();
232 void slotUpdateMessageTagList(
const QString &aLabel );
233 void slotSelectMoreMessageTagList();
245 KAction *akonadiStandardAction( Akonadi::StandardActionManager::Type type );
246 KAction *akonadiStandardAction( Akonadi::StandardMailActionManager::Type type );
249 void refreshMessageListSelection();
251 void slotStartCheckMail();
252 void slotEndCheckMail();
254 void slotCollectionProperties();
255 void slotRemoveDuplicates();
256 void slotRemoveDuplicatesDone(
KJob* );
258 void slotRemoveDuplicatesUpdate(
KJob *,
const QString& );
260 void slotSelectCollectionFolder(
const Akonadi::Collection & col );
263 void messagesTransfered(
bool );
264 void captionChangeRequest(
const QString &caption );
268 void restoreCollectionFolderViewConfig(Akonadi::Collection::Id
id = -1);
270 void createWidgets();
271 void deleteWidgets();
272 void layoutSplitters();
273 void newFromTemplate(
const Akonadi::Item& );
274 void moveSelectedMessagesToFolder(
const Akonadi::Collection & dest );
275 void copySelectedMessagesToFolder(
const Akonadi::Collection& dest );
278 virtual void showEvent( QShowEvent *event );
287 KSharedConfig::Ptr config();
290 void updateFileMenu();
291 void slotCheckOneAccount( QAction* );
292 void getAccountMenu();
293 void getTransportMenu();
296 void slotManageSieveScripts();
301 void slotFolderMailingListProperties();
302 void slotShowFolderShortcutDialog();
303 void slotExpireFolder();
304 void slotExpireAll();
305 void slotArchiveFolder();
306 void slotRemoveFolder();
307 void slotDelayedRemoveFolder(
KJob* );
308 void slotEmptyFolder();
309 void slotAddFavoriteFolder();
310 void slotShowSelectedFolderInPane();
311 void slotOverrideHtml();
312 void slotOverrideHtmlLoadExt();
313 void slotMessageQueuedOrDrafted();
314 void slotUseTemplate();
315 void slotDeleteMsg(
bool confirmDelete =
true );
316 void slotTrashThread();
317 void slotDeleteThread(
bool confirmDelete =
true );
322 void slotSaveAttachments();
323 void slotJumpToFolder();
324 void slotResendMsg();
325 void slotCheckVacation();
326 void slotDebugSieve();
327 void slotStartCertManager();
328 void slotStartWatchGnuPG();
329 void slotApplyFilters();
330 void slotApplyFiltersOnFolder();
331 void slotExpandThread();
332 void slotExpandAllThreads();
333 void slotCollapseThread();
334 void slotCollapseAllThreads();
335 void slotSetThreadStatusUnread();
336 void slotSetThreadStatusRead();
337 void slotSetThreadStatusImportant();
338 void slotSetThreadStatusToAct();
339 void slotSetThreadStatusWatched();
340 void slotSetThreadStatusIgnored();
341 void slotSendQueued();
342 void slotSendQueuedVia( QAction* item );
343 void slotOnlineStatus();
344 void slotUpdateOnlineStatus( GlobalSettings::EnumNetworkState::type );
345 void slotMessagePopup(
const Akonadi::Item& ,
const KUrl&,
const KUrl &imageUrl,
const QPoint& );
346 void slotContactSearchJobForMessagePopupDone(
KJob *job );
348 void slotFocusQuickSearch();
351 void slotShowStartupFolder();
354 void slotAntiSpamWizard();
355 void slotAntiVirusWizard();
356 void slotFilterLogViewer();
357 void slotAccountWizard();
358 void slotImportWizard();
361 void slotSelectNextMessage();
362 void slotExtendSelectionToNextMessage();
363 void slotSelectNextUnreadMessage();
364 void slotSelectPreviousMessage();
365 void slotExtendSelectionToPreviousMessage();
366 void slotSelectPreviousUnreadMessage();
367 void slotFocusOnNextMessage();
368 void slotFocusOnPrevMessage();
369 void slotSelectFirstMessage();
370 void slotSelectLastMessage();
371 void slotSelectFocusedMessage();
373 void slotNextUnreadFolder();
374 void slotPrevUnreadFolder();
377 void slotDisplayCurrentMessage();
379 void slotShowNewFromTemplate();
380 void slotDelayedShowNewFromTemplate(
KJob* );
381 void slotNewFromTemplate( QAction* );
384 void slotUpdateUndo();
387 void updateFolderMenu();
392 void slotEditNotifications();
395 void slotCustomReplyToMsg(
const QString &tmpl );
396 void slotCustomReplyAllToMsg(
const QString &tmpl );
397 void slotForwardInlineMsg();
398 void slotForwardAttachedMsg();
399 void slotRedirectMsg();
400 void slotCustomForwardMsg(
const QString &tmpl );
401 void slotSubjectFilter();
402 void slotFromFilter();
405 void slotConfigChanged();
408 void slotShowBusySplash();
414 void showOfflinePage();
415 void showResourceOfflinePage();
416 void updateVacationScriptStatus(
bool active ,
const QString &serverName = QString());
419 void slotShowExpiryProperties();
420 void slotItemAdded(
const Akonadi::Item &,
const Akonadi::Collection& col);
421 void slotItemRemoved(
const Akonadi::Item & );
422 void slotItemMoved(
const Akonadi::Item &item,
const Akonadi::Collection &
from,
const Akonadi::Collection &
to );
423 void slotCollectionStatisticsChanged(
const Akonadi::Collection::Id,
const Akonadi::CollectionStatistics& );
425 void slotAkonadiStandardActionUpdated();
426 void slotCollectionChanged(
const Akonadi::Collection&,
const QSet<QByteArray>& );
427 void slotCreateNewTab(
bool );
428 void slotUpdateActionsAfterMailChecking();
429 void slotConfigureAutomaticArchiving();
430 void slotExportData();
431 void slotCreateAddressBookContact();
432 void slotOpenRecentMsg(
const KUrl& url);
433 void slotConfigureSendLater();
434 void slotConfigureFolderArchiving();
437 void checkAkonadiServerManagerState();
438 void updateHtmlMenuEntry();
440 void updateMoveAction(
const Akonadi::CollectionStatistics& statistic );
441 void updateMoveAction(
bool hasUnreadMails,
bool hasMails );
443 void updateAllToTrashAction(
int statistics);
446 QString overrideEncoding()
const;
448 void moveMessageSelected( MessageList::Core::MessageItemSetReference ref,
const Akonadi::Collection &dest,
bool confirmOnDeletion =
true );
450 void copyMessageSelected(
const QList<Akonadi::Item> &selectMsg,
const Akonadi::Collection &dest );
458 void trashMessageSelected( MessageList::Core::MessageItemSetReference ref );
464 const Akonadi::MessageStatus &status,
475 void setCurrentThreadStatus(
const Akonadi::MessageStatus &status,
bool toggle );
484 MailCommon::FolderSelectionDialog* moveOrCopyToDialog();
490 MailCommon::FolderSelectionDialog* selectFromAllFoldersDialog();
497 void refreshFavoriteFoldersViewProperties();
499 void openFilterDialog(
const QByteArray &field,
const QString &value);
501 void showMessagePopup(
const Akonadi::Item&msg ,
const KUrl&aUrl,
const KUrl &imageUrl,
const QPoint& aPoint,
bool contactAlreadyExists,
bool uniqueContactFound);
503 void showCollectionProperties(
const QString &pageToShow );
504 void showCollectionPropertiesContinued(
const QString &pageToShow, QPointer<KPIM::ProgressItem> progressItem );
507 void slotMoveMessageToTrash();
521 void slotCopyMessagesCompleted(
KMCommand *command );
523 void slotRequestFullSearchFromQuickSearch();
524 void slotFolderChanged(
const Akonadi::Collection& );
525 void slotCollectionFetched(
int collectionId );
527 void itemsReceived(
const Akonadi::Item::List &list );
528 void itemsFetchDone(
KJob *job );
529 void itemsFetchForActivationDone(
KJob *job );
531 void slotCollectionPropertiesContinued(
KJob* job );
532 void slotCollectionPropertiesFinished(
KJob *job );
533 void slotDeletionCollectionResult(
KJob* job);
534 void slotServerSideSubscription();
535 void slotFetchItemsForFolderDone(
KJob*job);
536 void slotServerStateChanged(Akonadi::ServerManager::State state);
537 void slotConfigureSubscriptionFinished(QDBusPendingCallWatcher* watcher);
538 void slotArchiveMails();
541 KAction *mDeleteAction, *mTrashThreadAction,
542 *mDeleteThreadAction, *mSaveAsAction, *mUseAction,
543 *mSendAgainAction, *mApplyAllFiltersAction,
544 *mSaveAttachmentsAction, *mOpenAction,
545 *mMoveMsgToFolderAction, *mCollectionProperties, *mSendQueued;
546 KAction *mArchiveAction;
547 KActionMenu *mSendActionMenu;
549 KActionMenu *mFilterMenu;
550 KAction *mExpireConfigAction;
551 KAction *mApplyFiltersOnFolder;
553 KActionMenu *mTemplateMenu;
555 KActionMenu *mThreadStatusMenu, *mApplyFilterActionsMenu;
556 KAction *mCopyActionMenu;
557 KAction *mMoveActionMenu;
558 KAction *mMarkThreadAsReadAction;
559 KAction *mMarkThreadAsUnreadAction;
560 KToggleAction *mToggleThreadImportantAction;
561 KToggleAction *mToggleThreadToActAction;
563 KToggleAction *mWatchThreadAction, *mIgnoreThreadAction;
565 MailCommon::FavoriteCollectionWidget *mFavoriteCollectionsView;
566 Akonadi::FavoriteCollectionsModel *mFavoritesModel;
569 QSplitter *mSplitter1, *mSplitter2, *mFolderViewSplitter;
570 Akonadi::Collection mTemplateFolder;
573 bool mLongFolderList;
576 bool mHtmlPref, mHtmlLoadExtPref,
577 mFolderHtmlPref, mFolderHtmlLoadExtPref,
578 mReaderWindowActive, mReaderWindowBelow;
579 bool mEnableFavoriteFolderView;
580 bool mEnableFolderQuickSearch;
582 QPointer<KMail::SearchWindow> mSearchWin;
584 KAction *mExpireFolderAction,
585 *mFolderMailingListPropertiesAction,
586 *mShowFolderShortcutDialogAction,
587 *mArchiveFolderAction, *mMessageNewList;
588 KToggleAction *mPreferHtmlAction, *mPreferHtmlLoadExtAction;
591 QTimer *mShowBusySplashTimer;
595 QPointer<KSieveUi::SieveDebugDialog> mSieveDebugDialog;
597 KActionCollection *mActionCollection;
598 QAction *mToolbarActionSeparator;
599 QVBoxLayout *mTopLayout;
607 KSharedConfig::Ptr mConfig;
611 Akonadi::StandardMailActionManager *mAkonadiStandardActionManager;
615 MailCommon::FolderTreeWidget *mFolderTreeWidget;
618 bool mVacationIndicatorActive;
619 bool mGoToFirstUnreadMessageInSelectedFolder;
620 MessageList::Core::PreSelectionMode mPreSelectionMode;
622 QTimer mCheckMailTimer;
624 QPointer<MailCommon::FolderSelectionDialog> mMoveOrCopyToDialog;
625 QPointer<MailCommon::FolderSelectionDialog> mSelectFromAllFoldersDialog;
626 KAction *mServerSideSubscription;
627 KRecentFilesAction *mOpenRecentAction;
628 QPointer<KSieveUi::ManageSieveScriptsDialog> mManageSieveDialog;
QAction * action(const QString &name)
KAction * editAction() const
This class implements a "reader window", that is a window used for reading or viewing messages...
Manages common actions that can be performed on one or more messages.
CollectionPane * messageListPane() const
Access to the header list pane.
KMail::TagActionManager * tagActionManager() const
KMail::MessageActions * messageActions() const
KMail::FolderShortcutActionManager * folderShortcutActionManager() const
static KMKernel * self()
normal control stuff
Creates actions related to the existing Nepomuk tags and plugs them into the GUI. ...
MailCommon::FolderTreeView * folderTreeView() const
QList< KMMainWidget * > PtrList
KActionCollection * actionCollection() const
Slightly extended QLabel for embedding into the status bar, providing mouse click signals and support...
Small helper structure which encapsulates the KMMessage created when creating a reply, and.
KAction * sendAgainAction() const
void updateVacationScriptStatus()
KActionMenu * filterMenu() const
KAction * sendQueuedAction() const
KActionMenu * sendQueueViaMenu() const
KXMLGUIClient * guiClient() const
Returns the XML GUI client.
KActionMenu * mailingListActionMenu() const
Akonadi::StandardMailActionManager * standardMailActionManager() const
KMReaderWin * messageView() const
Easy access to main components of the window.