diff options
author | Stef Walter <stef@thewalter.net> | 2003-09-17 19:07:23 +0000 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2003-09-17 19:07:23 +0000 |
commit | 3f95d417d9e623ac0c74df8ef11d7a01846392dd (patch) | |
tree | 45ec73f2dc07eafd7f41a6f62a8cdfbaa279469f /NSCmpts/ProgressDlg.h |
Diffstat (limited to 'NSCmpts/ProgressDlg.h')
-rw-r--r-- | NSCmpts/ProgressDlg.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/NSCmpts/ProgressDlg.h b/NSCmpts/ProgressDlg.h new file mode 100644 index 0000000..b8bc7d6 --- /dev/null +++ b/NSCmpts/ProgressDlg.h @@ -0,0 +1,73 @@ +// ProgressDlg.h : Declaration of the CActionProgressDlg + +#ifndef __ProgressDLG_H_ +#define __ProgressDLG_H_ + +#include "resource.h" // main symbols +#include <atlwin.h> +#include <atlctrls.h> +#include "NSMessages.h" +#include "../common/events.h" +#include "../common/interfaces.h" +#include "NightSecError.h" + +///////////////////////////////////////////////////////////////////////////// +// CActionProgressDlg +// This is the update window the Action Engine +// Handles receiving of the error and update messages +// Also catches events from host program + +class CActionProgressDlg : + public CDialogImplEx, + public IDispEventImpl<0, CActionProgressDlg, &DIID_DShutdownEvents, &LIBID_NightSecShutdown, 2, 5> +{ +public: + // Construction + CActionProgressDlg(IUnknown* pSite, UINT nIDD); + ~CActionProgressDlg(); + +// Catch Cancel Events +BEGIN_SINK_MAP(CActionProgressDlg) + SINK_ENTRY_EX(0, DIID_DShutdownEvents, 1, OnCancelEv) +END_SINK_MAP() + +// Message Map +BEGIN_MSG_MAP(CActionProgressDlg) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + MESSAGE_HANDLER(WM_DESTROY, OnDestroy) + MESSAGE_HANDLER(NSM_UPDATE, OnUpdateFile) + MESSAGE_HANDLER(NSM_ERROR, OnError) + COMMAND_ID_HANDLER(IDCANCEL, OnCancel) +END_MSG_MAP() + +// Handler prototypes: +// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); +// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); +// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + + LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + + // Message from Action Engine + LRESULT OnUpdateFile(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + + // Called in response to the button being pressed, window being closed, or + // event being fired + LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + + // Called when event Fired + STDMETHOD(OnCancelEv)(); + + // Message from CActionEngine + LRESULT OnError(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + bool PlayAmination(UINT nID); + + +protected: + bool m_bCancel; // True when cancelled, but not stopped + CProgressBarCtrl m_ctlProgress; // Progress Bar + IUnknownPtr m_pUnk; // Pointer from IObjectWithSite + INightSecErrorLogPtr m_pErrorLog; // ErrorLog on same object as m_pUnk +}; + +#endif //__ProgressDLG_H_ |