MCPcopy Create free account
hub / github.com/LegacyUpdate/LegacyUpdate / IViewObjectExImpl

Class IViewObjectExImpl

include/com/IViewObjectExImpl.h:9–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8template<typename TImpl>
9class IViewObjectExImpl : public ComClass<TImpl, IViewObjectEx> {
10public:
11 IViewObjectExImpl(TImpl *pParent) : ComClass<TImpl, IViewObjectEx>(pParent) {}
12
13 // IViewObject
14 STDMETHODIMP Draw(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue) {
15 return this->m_pParent->OnDraw(dwDrawAspect, lindex, pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue);
16 }
17
18 STDMETHODIMP GetColorSet(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet) {
19 if (ppColorSet == NULL) {
20 return E_POINTER;
21 }
22 *ppColorSet = NULL;
23 return S_FALSE;
24 }
25
26 STDMETHODIMP Freeze(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze) {
27 return E_NOTIMPL;
28 }
29
30 STDMETHODIMP Unfreeze(DWORD dwFreeze) {
31 return E_NOTIMPL;
32 }
33
34 STDMETHODIMP SetAdvise(DWORD aspects, DWORD advf, IAdviseSink *pAdvSink) {
35 if (this->m_pParent->m_adviseSink) {
36 this->m_pParent->m_adviseSink->Release();
37 }
38 this->m_pParent->m_adviseSink = pAdvSink;
39 if (this->m_pParent->m_adviseSink) {
40 this->m_pParent->m_adviseSink->AddRef();
41 }
42 return S_OK;
43 }
44
45 STDMETHODIMP GetAdvise(DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink) {
46 if (pAspects) {
47 *pAspects = DVASPECT_CONTENT;
48 }
49 if (pAdvf) {
50 *pAdvf = 0;
51 }
52 if (ppAdvSink) {
53 *ppAdvSink = this->m_pParent->m_adviseSink;
54 }
55 return S_OK;
56 }
57
58 // IViewObject2
59 STDMETHODIMP GetExtent(DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, LPSIZEL lpsizel) {
60 if (lpsizel == NULL) {
61 return E_POINTER;
62 }
63
64 if (dwAspect != DVASPECT_CONTENT) {
65 return DV_E_DVASPECT;
66 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected