ReactOS 0.4.16-dev-122-g325d74c
CFolderOptions Class Reference

#include <CFolderOptions.h>

Inheritance diagram for CFolderOptions:
Collaboration diagram for CFolderOptions:

Public Member Functions

 CFolderOptions ()
 
 ~CFolderOptions ()
 
STDMETHOD() AddPages (LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) override
 
STDMETHOD() ReplacePage (EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam) override
 
STDMETHOD() Initialize (PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) override
 
STDMETHOD() SetSite (IUnknown *pUnkSite) override
 
STDMETHOD() GetSite (REFIID riid, void **ppvSite) override
 
bool CanSetDefFolderSettings ()
 
HRESULT ApplyDefFolderSettings (bool ResetToDefault)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT AddPages ([in] LPFNSVADDPROPSHEETPAGE pfnAddPage, [in] LPARAM lParam)
 
HRESULT ReplacePage ([in] EXPPS uPageID, [in] LPFNSVADDPROPSHEETPAGE pfnReplaceWith, [in] LPARAM lParam)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidlFolder, [in] IDataObject *pdtobj, [in] HKEY hkeyProgID)
 
- Public Member Functions inherited from IObjectWithSite
HRESULT SetSite ([in] IUnknown *pUnkSite)
 
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 

Protected Types

enum  DEFFOLDERSETTINGACTION { DFSA_QUERY = -1 , DFSA_RESET , DFSA_APPLY }
 

Protected Member Functions

HRESULT HandleDefFolderSettings (int Action)
 

Private Attributes

CComPtr< IUnknownm_pSite
 

Additional Inherited Members

- Public Types inherited from IShellPropSheetExt
enum  tagSHELLPROPSHEETEXTPAGEID { EXPPS_FILETYPES = 0x1 }
 
typedef UINT EXPPS
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IShellExtInit
typedef IShellExtInitLPSHELLEXTINIT
 
- Public Types inherited from IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 24 of file CFolderOptions.h.

Member Enumeration Documentation

◆ DEFFOLDERSETTINGACTION

Enumerator
DFSA_QUERY 
DFSA_RESET 
DFSA_APPLY 

Definition at line 42 of file CFolderOptions.h.

Constructor & Destructor Documentation

◆ CFolderOptions()

CFolderOptions::CFolderOptions ( )

Definition at line 27 of file CFolderOptions.cpp.

29{
30}
CComPtr< IUnknown > m_pSite
#define NULL
Definition: types.h:112

◆ ~CFolderOptions()

CFolderOptions::~CFolderOptions ( )

Definition at line 32 of file CFolderOptions.cpp.

33{
34}

Member Function Documentation

◆ AddPages()

HRESULT STDMETHODCALLTYPE CFolderOptions::AddPages ( LPFNSVADDPROPSHEETPAGE  pfnAddPage,
LPARAM  lParam 
)
override

Implements IShellPropSheetExt.

Definition at line 44 of file CFolderOptions.cpp.

45{
46 HPROPSHEETPAGE hPage;
47 LPARAM sheetparam = (LPARAM)static_cast<CFolderOptions*>(this);
48
50 if (hPage == NULL)
51 {
52 ERR("Failed to create property sheet page FolderOptionsGeneral\n");
53 return E_FAIL;
54 }
55 if (!pfnAddPage(hPage, lParam))
56 return E_FAIL;
57
59 if (hPage == NULL)
60 {
61 ERR("Failed to create property sheet page FolderOptionsView\n");
62 return E_FAIL;
63 }
64 if (!pfnAddPage(hPage, lParam))
65 return E_FAIL;
66
68 if (hPage == NULL)
69 {
70 ERR("Failed to create property sheet page FolderOptionsFileTypes\n");
71 return E_FAIL;
72 }
73 if (!pfnAddPage(hPage, lParam))
74 return E_FAIL;
75
76 return S_OK;
77}
INT_PTR CALLBACK FolderOptionsViewDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: view.cpp:953
INT_PTR CALLBACK FolderOptionsFileTypesDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filetypes.cpp:1691
INT_PTR CALLBACK FolderOptionsGeneralDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: general.cpp:331
#define ERR(fmt,...)
Definition: precomp.h:57
LPARAM lParam
Definition: combotst.c:139
#define E_FAIL
Definition: ddrawi.h:102
HPROPSHEETPAGE SH_CreatePropertySheetPage(LPCSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
#define S_OK
Definition: intsafe.h:52
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define IDD_FOLDER_OPTIONS_FILETYPES
Definition: shresdef.h:413
#define IDD_FOLDER_OPTIONS_GENERAL
Definition: shresdef.h:411
#define IDD_FOLDER_OPTIONS_VIEW
Definition: shresdef.h:412
LONG_PTR LPARAM
Definition: windef.h:208

◆ ApplyDefFolderSettings()

HRESULT CFolderOptions::ApplyDefFolderSettings ( bool  ResetToDefault)
inline

Definition at line 64 of file CFolderOptions.h.

65 {
66 return HandleDefFolderSettings(ResetToDefault ? DFSA_RESET : DFSA_APPLY);
67 }
HRESULT HandleDefFolderSettings(int Action)

◆ CanSetDefFolderSettings()

bool CFolderOptions::CanSetDefFolderSettings ( )
inline

Definition at line 60 of file CFolderOptions.h.

61 {
63 }
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ GetSite()

HRESULT STDMETHODCALLTYPE CFolderOptions::GetSite ( REFIID  riid,
void **  ppvSite 
)
override

Definition at line 104 of file CFolderOptions.cpp.

105{
106 return m_pSite ? m_pSite->QueryInterface(riid, ppvSite) : E_FAIL;
107}
REFIID riid
Definition: atlbase.h:39

◆ HandleDefFolderSettings()

HRESULT CFolderOptions::HandleDefFolderSettings ( int  Action)
protected

Definition at line 112 of file CFolderOptions.cpp.

113{
114 IBrowserService2 *bs2;
116 if (SUCCEEDED(hr))
117 {
118 if (Action == DFSA_APPLY)
119 {
120 hr = bs2->SetAsDefFolderSettings();
121 }
122 else if (Action == DFSA_RESET)
123 {
124 // There does not seem to be a method in IBrowserService2 for this
125 IUnknown_Exec(bs2, CGID_DefView, DVCMDID_RESET_DEFAULTFOLDER_SETTINGS, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
126 }
127 else
128 {
129 // FFSA_QUERY: hr is already correct
130 }
131 bs2->Release();
132 }
133
134 if (Action == DFSA_RESET)
135 {
136 IGlobalFolderSettings *pgfs;
137 HRESULT hr = CoCreateInstance(CLSID_GlobalFolderSettings, NULL, CLSCTX_INPROC_SERVER,
138 IID_IGlobalFolderSettings, (void **)&pgfs);
139 if (SUCCEEDED(hr))
140 {
141 hr = pgfs->Set(NULL, 0, 0);
142 pgfs->Release();
143 }
144 }
145
146 return hr;
147}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1501
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:1087
HRESULT SetAsDefFolderSettings()
ULONG Release()
HRESULT hr
Definition: shlfolder.c:183
#define SID_SShellBrowser
Definition: shlguid.h:128
#define DVCMDID_RESET_DEFAULTFOLDER_SETTINGS
Definition: shlobj_undoc.h:90
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
#define IID_PPV_ARG(Itype, ppType)

Referenced by ApplyDefFolderSettings(), and CanSetDefFolderSettings().

◆ Initialize()

HRESULT STDMETHODCALLTYPE CFolderOptions::Initialize ( PCIDLIST_ABSOLUTE  pidlFolder,
IDataObject pdtobj,
HKEY  hkeyProgID 
)
override

Implements IShellExtInit.

Definition at line 89 of file CFolderOptions.cpp.

90{
91 return S_OK;
92}

◆ ReplacePage()

HRESULT STDMETHODCALLTYPE CFolderOptions::ReplacePage ( EXPPS  uPageID,
LPFNSVADDPROPSHEETPAGE  pfnReplaceWith,
LPARAM  lParam 
)
override

Implements IShellPropSheetExt.

Definition at line 79 of file CFolderOptions.cpp.

80{
81 TRACE("(%p) (uPageID %u, pfnReplaceWith %p lParam %p\n", this, uPageID, pfnReplaceWith, lParam);
82 return E_NOTIMPL;
83}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define TRACE(s)
Definition: solgame.cpp:4

◆ SetSite()

HRESULT STDMETHODCALLTYPE CFolderOptions::SetSite ( IUnknown pUnkSite)
override

Implements IObjectWithSite.

Definition at line 98 of file CFolderOptions.cpp.

99{
100 m_pSite = pUnkSite;
101 return S_OK;
102}

Member Data Documentation

◆ m_pSite

CComPtr<IUnknown> CFolderOptions::m_pSite
private

Definition at line 32 of file CFolderOptions.h.

Referenced by GetSite(), HandleDefFolderSettings(), and SetSite().


The documentation for this class was generated from the following files: