summaryrefslogtreecommitdiff
path: root/Checklist/NightSecWizard.h
blob: 3f2d1f0977c03bddc57c47fc3ed0c9afd2119ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// NightSecWizard.h: interface for the CNightSecWizard class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_NIGHTSECWIZARD_H__E7FC7C13_8F86_11D3_BFBC_0020182B97FC__INCLUDED_)
#define AFX_NIGHTSECWIZARD_H__E7FC7C13_8F86_11D3_BFBC_0020182B97FC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Checklist.h"
#include "../common/Interfaces.h"
#include "../common/proppageholder.h"

#include "contexthelp.h"

#define countof(a) (sizeof(a) / sizeof(a[0]))

#include <map>
using std::multimap;
typedef multimap < CComponentHolder*, CPropPageHolder* > PropertyPageMap;

#include <atlprsht.h>

class ATL_NO_VTABLE CNightSecWizard : 
	public CComObjectRootEx<CComMultiThreadModel>,
	public IDispatchImpl<INightSecSiteInfo, &IID_INightSecSiteInfo, &LIBID_CHECKLISTLib>,
	public CPropertySheet,
	public CContextHelp<CNightSecWizard>
{

// Construction
public:
	CNightSecWizard() 
		: CPropertySheet(_T("Night Security Checklist"), NULL, 0) 
	{ 
		SetWizardMode();
		SetHelp(true);
	}

	virtual ~CNightSecWizard();

// For Base Classes
protected:
	HRESULT LoadPropertyPages(CComponentHolder* pComponent);
	IUnknown* GetIUnknown(bool bAddRef = false);
	void SetSite(IUnknown* pSite = NULL);
	void ClearSite();

// COM Interface support
DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CNightSecWizard)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(INightSecSiteInfo)
END_COM_MAP()

BEGIN_MSG_MAP(CNightSecWizard)
	MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
	CHAIN_MSG_MAP(CContextHelp<CNightSecWizard>)
	CHAIN_MSG_MAP(CPropertySheet)
END_MSG_MAP()

BEGIN_HELP_MAP(NS_HELP_FILE)
	HELP_ID(ID_WIZBACK, 502)
	HELP_ID(ID_WIZNEXT, 501)
	HELP_ID(ID_WIZFINISH, 503)
END_HELP_MAP

	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

// Data
public:
	PropertyPageMap m_mapPages;
};


class CAdvancedWizardT 	: public CNightSecWizard
{
public:
	CAdvancedWizardT()
		{  }
	virtual ~CAdvancedWizardT() {}

// Message Map
BEGIN_MSG_MAP(CAdvancedWizardT)
	MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
	MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
	CHAIN_MSG_MAP(CNightSecWizard)
END_MSG_MAP()

// Message Handlers
protected:
	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

// INightSecSiteInfo
public:
	STDMETHOD(get_Info)(/*[in]*/ NightSecSiteInfo nsItem, /*[out, retval]*/ VARIANT* pvVal);

};

typedef CComObjectMember<CAdvancedWizardT> CAdvancedWizard;



#include "ExtraPage.h"

#include <vector>
using std::vector;
typedef vector<CExtraPage*> ExtraPageArray;


class CNormalWizardT : public CNightSecWizard
{
public:
	CNormalWizardT()
	{ 
		m_bSiteSet = false;
	}
	virtual ~CNormalWizardT();

// Message Map
BEGIN_MSG_MAP(CNormalWizardT)
	MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
	MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
	CHAIN_MSG_MAP(CNightSecWizard)
END_MSG_MAP()

// Message Handlers
protected:
	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	
// Operations
public:
	void AddExtraPages();

// INightSecSiteInfo
public:
	STDMETHOD(get_Info)(/*[in]*/ NightSecSiteInfo nsItem, /*[out, retval]*/ VARIANT* pvVal);

protected:
	ExtraPageArray m_aPages;
	bool m_bSiteSet;
};

typedef CComObjectMember<CNormalWizardT> CNormalWizard;

#endif // !defined(AFX_NIGHTSECWIZARD_H__E7FC7C13_8F86_11D3_BFBC_0020182B97FC__INCLUDED_)