messageactions.h
00001 /* 00002 Copyright (c) 2007 Volker Krause <vkrause@kde.org> 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef KMAIL_MESSAGEACTIONS_H 00020 #define KMAIL_MESSAGEACTIONS_H 00021 00022 #include "kmcommands.h" 00023 #include "kmreaderwin.h" 00024 00025 #include <tqobject.h> 00026 #include <tqvaluelist.h> 00027 00028 class TQWidget; 00029 class TDEAction; 00030 class TDEActionMenu; 00031 class TDEActionCollection; 00032 class KMMessage; 00033 00034 namespace KMail { 00035 00039 class MessageActions : public TQObject 00040 { 00041 Q_OBJECT 00042 00043 public: 00044 MessageActions( TDEActionCollection* ac, TQWidget *parent ); 00045 void setMessageView( KMReaderWin *msgView ); 00046 00047 void setCurrentMessage( KMMessage *msg ); 00048 void setSelectedSernums( const TQValueList<TQ_UINT32> &sernums ); 00049 void setSelectedVisibleSernums( const TQValueList<TQ_UINT32> &sernums ); 00050 00051 TDEActionMenu* replyMenu() const { return mReplyActionMenu; } 00052 TDEAction* replyListAction() const { return mReplyListAction; } 00053 TDEAction* createTodoAction() const { return mCreateTodoAction; } 00054 00055 TDEActionMenu* messageStatusMenu() const { return mStatusMenu; } 00056 00057 TDEAction* editAction() const { return mEditAction; } 00058 00059 signals: 00060 00061 // This signal is emitted when a reply is triggered and the 00062 // action has finished. 00063 // This is useful for the stand-alone reader, it might want to close the window in 00064 // that case. 00065 void replyActionFinished(); 00066 00067 public slots: 00068 void editCurrentMessage(); 00069 00070 private: 00071 void updateActions(); 00072 template<typename T> void replyCommand(); 00073 void setMessageStatus( KMMsgStatus status, bool toggle = false ); 00074 00075 private slots: 00076 void slotReplyToMsg(); 00077 void slotReplyAuthorToMsg(); 00078 void slotReplyListToMsg(); 00079 void slotReplyAllToMsg(); 00080 void slotNoQuoteReplyToMsg(); 00081 void slotCreateTodo(); 00082 void slotSetMsgStatusNew(); 00083 void slotSetMsgStatusUnread(); 00084 void slotSetMsgStatusRead(); 00085 void slotSetMsgStatusTodo(); 00086 void slotSetMsgStatusFlag(); 00087 00088 private: 00089 TQWidget *mParent; 00090 TDEActionCollection *mActionCollection; 00091 KMMessage* mCurrentMessage; 00092 TQValueList<TQ_UINT32> mSelectedSernums; 00093 TQValueList<TQ_UINT32> mVisibleSernums; 00094 KMReaderWin *mMessageView; 00095 00096 TDEActionMenu *mReplyActionMenu; 00097 TDEAction *mReplyAction, *mReplyAllAction, *mReplyAuthorAction, 00098 *mReplyListAction, *mNoQuoteReplyAction; 00099 TDEAction *mCreateTodoAction; 00100 TDEActionMenu *mStatusMenu; 00101 TDEToggleAction *mToggleFlagAction, *mToggleTodoAction; 00102 TDEAction *mEditAction; 00103 }; 00104 00105 } 00106 00107 #endif 00108