summaryrefslogtreecommitdiff
path: root/NSCmpts/ProgressDlg.h
diff options
context:
space:
mode:
Diffstat (limited to 'NSCmpts/ProgressDlg.h')
-rw-r--r--NSCmpts/ProgressDlg.h73
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_