ReactOS 0.4.16-dev-2175-g9420ab7
CFontFolderViewCB Class Reference

#include <CFontFolderViewCB.h>

Inheritance diagram for CFontFolderViewCB:
Collaboration diagram for CFontFolderViewCB:

Public Member Functions

 CFontFolderViewCB ()
 
void Initialize (CFontExt *pFontExt, IShellView *psv, LPCITEMIDLIST pidlParent)
 
STDMETHOD() MessageSFVCB (UINT uMsg, WPARAM wParam, LPARAM lParam) override
 
- 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 ()
 

Private Member Functions

HRESULT TranslatePidl (LPITEMIDLIST *ppidlNew, LPCITEMIDLIST pidl)
 
void TranslateTwoPIDLs (PIDLIST_ABSOLUTE *pidls)
 
BOOL FilterEvent (LONG lEvent) const
 

Private Attributes

CFontExtm_pFontExt = nullptr
 
IShellViewm_pShellView = nullptr
 
HWND m_hwndView = nullptr
 
CComHeapPtr< ITEMIDLISTm_pidlParent
 
CComHeapPtr< ITEMIDLISTm_pidl0
 
CComHeapPtr< ITEMIDLISTm_pidl1
 

Additional Inherited Members

- 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 10 of file CFontFolderViewCB.h.

Constructor & Destructor Documentation

◆ CFontFolderViewCB()

CFontFolderViewCB::CFontFolderViewCB ( )
inline

Definition at line 26 of file CFontFolderViewCB.h.

26{ }

Member Function Documentation

◆ FilterEvent()

BOOL CFontFolderViewCB::FilterEvent ( LONG  lEvent) const
private

Definition at line 73 of file CFontFolderViewCB.cpp.

74{
75 switch (lEvent & ~SHCNE_INTERRUPT)
76 {
77 case SHCNE_CREATE:
78 case SHCNE_DELETE:
80 case SHCNE_UPDATEDIR:
81 return FALSE; // OK
82 default:
83 return TRUE; // We don't want this event
84 }
85}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define SHCNE_DELETE
Definition: shlobj.h:1897
#define SHCNE_RENAMEITEM
Definition: shlobj.h:1895
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1907
#define SHCNE_CREATE
Definition: shlobj.h:1896
#define SHCNE_INTERRUPT
Definition: shlobj.h:1920
HANDLE lEvent
Definition: tftpd.cpp:56

Referenced by MessageSFVCB().

◆ Initialize()

void CFontFolderViewCB::Initialize ( CFontExt pFontExt,
IShellView psv,
LPCITEMIDLIST  pidlParent 
)

Definition at line 12 of file CFontFolderViewCB.cpp.

13{
14 ATLASSERT(pFontExt);
15 ATLASSERT(psv);
16 ATLASSERT(pidlParent);
17 m_pFontExt = pFontExt;
18 m_pShellView = psv;
19 m_pidlParent.Attach(ILClone(pidlParent));
20 if (!m_pidlParent)
21 ERR("!m_pidlParent\n");
22}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define ERR(fmt,...)
Definition: precomp.h:57
CComHeapPtr< ITEMIDLIST > m_pidlParent
IShellView * m_pShellView
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:238

◆ MessageSFVCB()

STDMETHODIMP CFontFolderViewCB::MessageSFVCB ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
override

Definition at line 88 of file CFontFolderViewCB.cpp.

89{
90 switch (uMsg)
91 {
92 case SFVM_QUERYFSNOTIFY: // Registering change notification
93 {
94 // Now, we can get the view window
99 return S_OK;
100 }
101 case SFVM_FSNOTIFY: // Change notification
102 {
103 if (FilterEvent((LONG)lParam))
104 return S_FALSE; // Don't process
105
107 return S_OK;
108 }
109 }
110 return E_NOTIMPL;
111}
void SetViewWindow(HWND hwndView)
Definition: CFontExt.hpp:29
BOOL FilterEvent(LONG lEvent) const
void TranslateTwoPIDLs(PIDLIST_ABSOLUTE *pidls)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT GetWindow([out] HWND *phwnd)
#define S_OK
Definition: intsafe.h:52
long LONG
Definition: pedump.c:60
#define SFVM_FSNOTIFY
Definition: shlobj.h:1312
#define SFVM_QUERYFSNOTIFY
Definition: shlobj.h:1321
#define S_FALSE
Definition: winerror.h:3451

◆ TranslatePidl()

HRESULT CFontFolderViewCB::TranslatePidl ( LPITEMIDLIST ppidlNew,
LPCITEMIDLIST  pidl 
)
private

Definition at line 24 of file CFontFolderViewCB.cpp.

25{
26 ATLASSERT(ppidlNew);
27
28 *ppidlNew = NULL;
29
30 WCHAR szFontFile[MAX_PATH];
31 if (!SHGetPathFromIDListW(pidl, szFontFile))
32 return E_FAIL;
33
34 CStringW strFontName;
35 HRESULT hr = DoGetFontTitle(szFontFile, strFontName);
37 return E_FAIL;
38
39 LPITEMIDLIST pidlChild = _ILCreate(strFontName);
40 if (!pidlChild)
41 {
42 ERR("!pidlChild\n");
43 return E_OUTOFMEMORY;
44 }
45
46 *ppidlNew = ILCombine(m_pidlParent, pidlChild);
47 ILFree(pidlChild);
48
49 return *ppidlNew ? S_OK : E_OUTOFMEMORY;
50}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
HRESULT DoGetFontTitle(_In_ LPCWSTR pszFontPath, _Out_ CStringW &strFontName)
Definition: fontext.cpp:239
LPITEMIDLIST _ILCreate(LPCWSTR lpString)
Definition: fontpidl.cpp:10
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:817
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1496
HRESULT hr
Definition: shlfolder.c:183
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by TranslateTwoPIDLs().

◆ TranslateTwoPIDLs()

void CFontFolderViewCB::TranslateTwoPIDLs ( PIDLIST_ABSOLUTE pidls)
private

Definition at line 52 of file CFontFolderViewCB.cpp.

53{
54 ATLASSERT(pidls);
55
56 HRESULT hr;
57 if (pidls[0])
58 {
59 m_pidl0.Free();
60 hr = TranslatePidl(&m_pidl0, pidls[0]);
62 pidls[0] = m_pidl0;
63 }
64 if (pidls[1])
65 {
66 m_pidl1.Free();
67 hr = TranslatePidl(&m_pidl1, pidls[1]);
69 pidls[1] = m_pidl1;
70 }
71}
HRESULT TranslatePidl(LPITEMIDLIST *ppidlNew, LPCITEMIDLIST pidl)
CComHeapPtr< ITEMIDLIST > m_pidl0
CComHeapPtr< ITEMIDLIST > m_pidl1

Referenced by MessageSFVCB().

Member Data Documentation

◆ m_hwndView

HWND CFontFolderViewCB::m_hwndView = nullptr
private

Definition at line 16 of file CFontFolderViewCB.h.

Referenced by MessageSFVCB().

◆ m_pFontExt

CFontExt* CFontFolderViewCB::m_pFontExt = nullptr
private

Definition at line 14 of file CFontFolderViewCB.h.

Referenced by Initialize(), and MessageSFVCB().

◆ m_pidl0

CComHeapPtr<ITEMIDLIST> CFontFolderViewCB::m_pidl0
private

Definition at line 18 of file CFontFolderViewCB.h.

Referenced by TranslateTwoPIDLs().

◆ m_pidl1

CComHeapPtr<ITEMIDLIST> CFontFolderViewCB::m_pidl1
private

Definition at line 19 of file CFontFolderViewCB.h.

Referenced by TranslateTwoPIDLs().

◆ m_pidlParent

CComHeapPtr<ITEMIDLIST> CFontFolderViewCB::m_pidlParent
private

Definition at line 17 of file CFontFolderViewCB.h.

Referenced by Initialize(), and TranslatePidl().

◆ m_pShellView

IShellView* CFontFolderViewCB::m_pShellView = nullptr
private

Definition at line 15 of file CFontFolderViewCB.h.

Referenced by Initialize(), and MessageSFVCB().


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