xref: /trunk/main/shell/inc/internal/propsheets.hxx (revision 67e470da)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef PROPSHEETS_HXX_INCLUDED
25 #define PROPSHEETS_HXX_INCLUDED
26 
27 #include "internal/metainforeader.hxx"
28 
29 #if defined _MSC_VER
30 #pragma warning(push, 1)
31 #endif
32 #include <shlobj.h>
33 #if defined _MSC_VER
34 #pragma warning(pop)
35 #endif
36 #include <string>
37 #include <memory>
38 
39 class CPropertySheet : public IShellExtInit, public IShellPropSheetExt
40 {
41 public:
42 	CPropertySheet(long RefCnt = 1);
43 
44 	virtual ~CPropertySheet();
45 
46 	//-----------------------------
47 	// IUnknown methods
48 	//-----------------------------
49 
50 	virtual HRESULT STDMETHODCALLTYPE QueryInterface(
51             REFIID riid,
52             void __RPC_FAR *__RPC_FAR *ppvObject);
53 
54     virtual ULONG STDMETHODCALLTYPE AddRef( void);
55 
56     virtual ULONG STDMETHODCALLTYPE Release( void);
57 
58 	//-----------------------------
59 	// IShellExtInit
60 	//-----------------------------
61 
62     virtual HRESULT STDMETHODCALLTYPE Initialize(
63 		LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID);
64 
65 	//-----------------------------
66 	// IShellPropSheetExt
67 	//-----------------------------
68 
69 	virtual HRESULT STDMETHODCALLTYPE AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
70 
71     virtual HRESULT STDMETHODCALLTYPE ReplacePage(
72 		UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam);
73 
74 private:
75 	// Windows callback functions
76 	static UINT CALLBACK PropPageSummaryCallback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
77 	static BOOL CALLBACK PropPageSummaryProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam);
78 	static BOOL CALLBACK PropPageStatisticsProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam);
79 
80 
81 	// Helper functions
82 	void InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE lppsp);
83 	void InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE lppsp);
84 
85 private:
86 	long m_RefCnt;
87 	char m_szFileName[MAX_PATH];
88 };
89 
90 #endif
91