21 #ifndef __KMMAINWIDGET
22 #define __KMMAINWIDGET
25 #include <kxmlguiclient.h>
26 #include <tqguardedptr.h>
27 #include <tqlistview.h>
29 #include <tqvaluevector.h>
31 #include "kmreaderwin.h"
33 #include "messageactions.h"
34 #include <tdeaction.h>
41 class TDEActionCollection;
44 class TDEToggleAction;
46 class KStatusBarLabel;
51 class KMFolderTreeItem;
53 class KMMetaFilterActionCommand;
54 class FolderShortcutCommand;
61 template <
typename T>
class TQValueList;
62 template <
typename T,
typename S>
class TQMap;
63 template <
typename T>
class TQGuardedPtr;
71 class SieveDebugDialog;
73 class HeaderListQuickSearch;
75 class ImapAccountBase;
76 class FavoriteFolderView;
79 typedef TQMap<int,KMFolder*> KMMenuToFolder;
82 class TDE_EXPORT KMMainWidget :
public TQWidget
88 KMMainWidget(TQWidget *parent,
const char *name,
89 KXMLGUIClient *aGUIClient,
90 TDEActionCollection *actionCollection,
91 TDEConfig*config = KMKernel::config() );
92 virtual ~KMMainWidget();
96 virtual void readPreConfig(
void);
99 virtual void readFolderConfig(
void);
102 virtual void writeFolderConfig(
void);
105 virtual void readConfig(
void);
108 virtual void writeConfig(
void);
111 KMReaderWin* messageView(
void)
const {
return mMsgView; }
112 KMFolderTree* folderTree(
void)
const {
return mFolderTree; }
113 KMail::FavoriteFolderView *favoriteFolderView()
const {
return mFavoriteFolderView; }
115 static void cleanup();
117 TDEAction *action(
const char *name ) {
return mActionCollection->action( name ); }
118 TDEActionMenu *customReplyAction()
const {
return mCustomReplyActionMenu; }
119 TDEActionMenu *customReplyAllAction()
const {
return mCustomReplyAllActionMenu; }
120 TDEActionMenu *forwardMenu()
const {
return mForwardActionMenu; }
121 TDEAction *forwardInlineAction()
const {
return mForwardInlineAction; }
122 TDEAction *forwardAttachedAction()
const {
return mForwardAttachedAction; }
123 TDEAction *forwardDigestAction()
const {
return mForwardDigestAction; }
124 TDEAction *redirectAction()
const {
return mRedirectAction; }
125 TDEActionMenu *customForwardAction()
const {
return mCustomForwardActionMenu; }
126 TDEActionMenu *filterMenu()
const {
return mFilterMenu; }
127 TDEAction *printAction()
const {
return mPrintAction; }
128 TDEAction *trashAction()
const {
return mTrashAction; }
129 TDEAction *deleteAction()
const {
return mDeleteAction; }
130 TDEAction *trashThreadAction()
const {
return mTrashThreadAction; }
131 TDEAction *deleteThreadAction()
const {
return mDeleteThreadAction; }
132 TDEAction *saveAsAction()
const {
return mSaveAsAction; }
133 TDEAction *editAction()
const {
return mMsgActions->editAction(); }
134 TDEAction *useAction()
const {
return mUseAction; }
135 TDEAction *sendAgainAction()
const {
return mSendAgainAction; }
136 TDEAction *applyAllFiltersAction()
const {
return mApplyAllFiltersAction; }
137 TDEAction *findInMessageAction()
const {
return mFindInMessageAction; }
138 TDEAction *saveAttachmentsAction()
const {
return mSaveAttachmentsAction; }
139 TDEAction *openAction()
const {
return mOpenAction; }
140 TDEAction *viewSourceAction()
const {
return mViewSourceAction; }
143 TDEActionMenu *statusMenu()
const{
return mMsgActions->messageStatusMenu(); }
144 TDEActionMenu *threadStatusMenu()
const {
return mThreadStatusMenu; }
145 TDEActionMenu *moveActionMenu()
const{
return mMoveActionMenu; }
146 TDEActionMenu *mopyActionMenu()
const {
return mCopyActionMenu; }
147 TDEActionMenu *applyFilterActionsMenu()
const {
return mApplyFilterActionsMenu; }
149 TDEToggleAction *watchThreadAction()
const {
return mWatchThreadAction; }
150 TDEToggleAction *ignoreThreadAction()
const {
return mIgnoreThreadAction; }
152 KMHeaders *headers()
const {
return mHeaders; }
153 void toggleSystemTray();
155 void updateListFilterAction();
159 static const TQValueList<KMMainWidget*>* mainWidgetList() {
return s_mainWidgetList; }
165 bool shortcutIsValid(
const TDEShortcut& )
const;
168 void modifyFolder( KMFolderTreeItem* folderItem );
174 void setAccelsEnabled(
bool enabled =
true );
179 void setupForwardingActionsList();
181 KStatusBarLabel* vacationScriptIndicator()
const {
return mVacationScriptIndicator; }
182 void updateVactionScripStatus() { updateVactionScripStatus( mVacationIndicatorActive ); }
185 void slotMoveMsgToFolder(
KMFolder *dest);
191 void slotCheckMail();
197 void folderSelected(
KMFolder*,
bool forceJumpToUnread =
false );
200 void folderSelected();
203 void folderSelectedUnread(
KMFolder* );
211 void slotMsgChanged();
217 void slotReplaceMsgByUnencryptedVersion();
220 void updateMessageMenu();
222 void startUpdateMessageActionsTimer();
224 void updateMessageActions();
227 void slotSubscriptionDialog();
230 void slotLocalSubscriptionDialog();
233 void slotFolderTreeColumnsChanged();
236 void clearFilterActions();
237 void initializeFilterActions();
240 void initializeIMAPActions() { initializeIMAPActions(
true ); }
243 void initializeFolderShortcutActions();
246 void slotShortcutChanged(
KMFolder *folder );
248 void updateCustomTemplateMenus();
249 void slotEditVacation();
252 void messagesTransfered(
bool );
253 void captionChangeRequest(
const TQString & caption );
257 void createWidgets();
258 void activatePanners();
260 void updateFileMenu();
263 TDEActionCollection * actionCollection()
const {
return mActionCollection; }
268 TDEConfig * config();
271 void slotCheckOneAccount(
int);
272 void slotMailChecked(
bool newMail,
bool sendOnCheck,
273 const TQMap<TQString, int> & newInFolder );
274 void getAccountMenu();
275 void getTransportMenu();
278 void slotPopFilter();
279 void slotManageSieveScripts();
282 void slotViewChange();
285 void slotModifyFolder();
286 void slotFolderMailingListProperties();
287 void slotFolderShortcutCommand();
288 void slotExpireFolder();
289 void slotExpireAll();
290 void slotInvalidateIMAPFolders();
291 void slotMarkAllAsRead();
292 void slotArchiveFolder();
293 void slotRemoveFolder();
294 void slotEmptyFolder();
295 void slotCompactFolder();
296 void slotRefreshFolder();
297 void slotTroubleshootFolder();
298 void slotCompactAll();
299 void slotOverrideHtml();
300 void slotOverrideHtmlLoadExt();
301 void slotOverrideThread();
302 void slotToggleSubjectThreading();
303 void slotMessageQueuedOrDrafted();
304 void slotUseTemplate();
306 void slotDeleteMsg(
bool confirmDelete =
true );
307 void slotTrashThread();
308 void slotDeleteThread(
bool confirmDelete =
true );
313 void slotSaveAttachments();
314 void slotJumpToFolder();
317 void slotCopyMsgToFolder(
KMFolder *dest);
319 void slotResendMsg();
320 void slotCheckVacation();
321 void slotDebugSieve();
322 void slotStartCertManager();
323 void slotStartWatchGnuPG();
324 void slotApplyFilters();
325 void slotExpandThread();
326 void slotExpandAllThreads();
327 void slotCollapseThread();
328 void slotCollapseAllThreads();
329 void slotShowMsgSrc();
330 void slotSetThreadStatusNew();
331 void slotSetThreadStatusUnread();
332 void slotSetThreadStatusRead();
333 void slotSetThreadStatusTodo();
334 void slotSetThreadStatusFlag();
335 void slotSetThreadStatusWatched();
336 void slotSetThreadStatusIgnored();
337 void slotToggleUnread();
338 void slotToggleTotalColumn();
339 void slotToggleSizeColumn();
340 void slotSendQueued();
341 void slotSendQueuedVia(
int item );
342 void slotOnlineStatus();
343 void slotUpdateOnlineStatus( GlobalSettings::EnumNetworkState::type );
344 void slotMsgPopup(
KMMessage &msg,
const KURL &aUrl,
const TQPoint&);
348 void slotSearchClosed();
351 void slotShowStartupFolder();
354 void slotAntiSpamWizard();
355 void slotAntiVirusWizard();
356 void slotFilterLogViewer();
359 void slotNextMessage();
360 void slotNextUnreadMessage();
361 void slotNextImportantMessage();
362 void slotNextUnreadFolder();
363 void slotPrevMessage();
364 void slotPrevUnreadMessage();
365 void slotPrevImportantMessage();
366 void slotPrevUnreadFolder();
369 void slotDisplayCurrentMessage();
371 void slotShowNewFromTemplate();
372 void slotNewFromTemplate(
int );
375 void slotUpdateUndo();
378 virtual void moveSelectedToFolder(
int menuId );
380 virtual void copySelectedToFolder(
int menuId );
382 void updateFolderMenu();
385 void updateMarkAsReadAction();
388 void slotToggleShowQuickSearch();
391 void slotEditNotifications();
395 void slotChangeCaption(TQListViewItem*);
396 void removeDuplicates();
398 void slotCustomReplyToMsg(
int tid );
399 void slotCustomReplyAllToMsg(
int tid );
400 void slotForwardInlineMsg();
401 void slotForwardAttachedMsg();
402 void slotForwardDigestMsg();
403 void slotRedirectMsg();
404 void slotCustomForwardMsg(
int tid );
405 void slotNoQuoteReplyToMsg();
406 void slotSubjectFilter();
407 void slotMailingListFilter();
408 void slotFromFilter();
411 void slotCreateTodo();
413 void slotConfigChanged();
415 void slotFolderRemoved(
KMFolder *folder );
418 void slotShowBusySplash();
421 void showOfflinePage();
425 TQString overrideEncoding()
const;
427 void initializeIMAPActions(
bool setState );
432 KMail::ImapAccountBase* findCurrentImapAccountBase();
437 TQString findCurrentImapPath();
444 void setupForwardActions();
446 void setupFolderView();
449 void slotRequestFullSearchFromQuickSearch();
450 void updateVactionScripStatus(
bool active );
454 TDEAction *mTrashAction, *mDeleteAction, *mTrashThreadAction,
455 *mDeleteThreadAction, *mSaveAsAction, *mUseAction,
456 *mSendAgainAction, *mApplyAllFiltersAction, *mFindInMessageAction,
457 *mSaveAttachmentsAction, *mOpenAction, *mViewSourceAction,
458 *mFavoritesCheckMailAction,
459 *mMoveMsgToFolderAction;
461 TDEAction *mPrintAction,
462 *mForwardInlineAction, *mForwardAttachedAction, *mForwardDigestAction,
464 TDEActionMenu *mForwardActionMenu;
466 TDEActionMenu *mFilterMenu;
467 TDEAction *mSubjectFilterAction, *mFromFilterAction, *mToFilterAction,
469 TDEActionMenu *mTemplateMenu;
472 TDEActionMenu *mCustomReplyActionMenu,
473 *mCustomReplyAllActionMenu,
474 *mCustomForwardActionMenu;
476 TQSignalMapper *mCustomReplyMapper,
477 *mCustomReplyAllMapper,
478 *mCustomForwardMapper;
480 TDEActionMenu *mThreadStatusMenu,
481 *mMoveActionMenu, *mCopyActionMenu, *mApplyFilterActionsMenu;
482 TDEAction *mMarkThreadAsNewAction;
483 TDEAction *mMarkThreadAsReadAction;
484 TDEAction *mMarkThreadAsUnreadAction;
485 TDEToggleAction *mToggleThreadTodoAction;
486 TDEToggleAction *mToggleThreadFlagAction;
488 TDEToggleAction *mWatchThreadAction, *mIgnoreThreadAction;
491 TDERadioAction* mUnreadColumnToggle;
492 TDERadioAction* mUnreadTextToggle;
493 TDEToggleAction* mTotalColumnToggle;
494 TDEToggleAction* mSizeColumnToggle;
496 TDEToggleAction *mToggleShowQuickSearchAction;
498 KMFolderTree *mFolderTree;
499 KMail::FavoriteFolderView *mFavoriteFolderView;
500 TQWidget *mFolderView;
501 TQSplitter *mFolderViewParent;
503 TQSplitter *mPanner1, *mPanner2;
504 TQSplitter *mFolderViewSplitter;
506 TQVBox *mSearchAndHeaders;
507 TDEToolBar *mSearchToolBar;
508 KMail::HeaderListQuickSearch *mQuickSearchLine;
509 TQGuardedPtr<KMFolder> mFolder;
511 TQPopupMenu *mViewMenu, *mBodyPartsMenu;
512 TDEAction *mlistFilterAction;
516 TQString mStartupFolder;
517 int mMessageStatusId;
518 TQValueList<int> mPanner1Sep, mPanner2Sep;
520 TQPopupMenu *mActMenu;
521 TQPopupMenu *mSendMenu;
522 TQPopupMenu *mFileMenu;
524 bool mLongFolderList;
527 KMMenuToFolder mMenuToFolder;
528 int copyId, moveId, htmlId, threadId;
529 bool mHtmlPref, mHtmlLoadExtPref, mThreadPref,
530 mFolderHtmlPref, mFolderHtmlLoadExtPref, mFolderThreadPref,
531 mFolderThreadSubjPref, mReaderWindowActive, mReaderWindowBelow;
532 bool mEnableFavoriteFolderView;
537 TDEAction *mNewFolderAction, *mModifyFolderAction, *mRemoveFolderAction, *mExpireFolderAction,
538 *mCompactFolderAction, *mRefreshFolderAction, *mEmptyFolderAction,
539 *mMarkAllAsReadAction, *mFolderMailingListPropertiesAction,
540 *mFolderShortCutCommandAction, *mTroubleshootFolderAction,
541 *mRemoveDuplicatesAction, *mArchiveFolderAction;
542 TDEToggleAction *mPreferHtmlAction, *mPreferHtmlLoadExtAction, *mThreadMessagesAction;
543 TDEToggleAction *mThreadBySubjectAction;
544 TDEToggleAction *mFolderAction, *mHeaderAction, *mMimeAction;
547 TQTimer *mShowBusySplashTimer;
549 TQGuardedPtr<KMail::Vacation> mVacation;
551 TQGuardedPtr<KMail::SieveDebugDialog> mSieveDebugDialog;
553 TDEActionCollection *mActionCollection;
554 TDEActionSeparator *mToolbarActionSeparator;
555 TQVBoxLayout *mTopLayout;
556 bool mDestructed, mForceJumpToUnread, mShowingOfflineScreen;
557 TQPtrList<TDEAction> mFilterMenuActions;
558 TQPtrList<TDEAction> mFilterTBarActions;
559 TQPtrList<KMMetaFilterActionCommand> mFilterCommands;
560 TQDict<FolderShortcutCommand> mFolderShortcutCommands;
561 TQGuardedPtr <KMail::FolderJob> mJob;
563 TQValueVector<TQString> mCustomTemplates;
564 TQPtrList<TDEAction> mCustomTemplateActions;
568 KXMLGUIClient *mGUIClient;
572 static TQValueList<KMMainWidget*>* s_mainWidgetList;
574 KStatusBarLabel *mVacationScriptIndicator;
575 bool mVacationIndicatorActive;
KMail list that manages the contents of one directory that may contain folders and/or other directori...
This class implements a "reader window", that is a window used for reading or viewing messages.
KMSystemTray extends KSystemTray and handles system tray notification for KMail.
Manages common actions that can be performed on one or more messages.
The SearchWindow class provides a dialog for triggering a search on folders and storing that search a...