ReactOS 0.4.15-dev-5664-g3bf4ef6
olecallback.c File Reference
#include <windows.h>
#include <richedit.h>
#include <richole.h>
#include <wine/debug.h>
#include "wordpad.h"
Include dependency graph for olecallback.c:

Go to the source code of this file.

Classes

struct  IRichEditOleCallbackImpl
 

Macros

#define COBJMACROS
 
#define WIN32_NO_STATUS
 
#define WIN32_LEAN_AND_MEAN
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wordpad)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryInterface (IRichEditOleCallback *This, REFIID riid, void **ppvObject)
 
static ULONG STDMETHODCALLTYPE RichEditOleCallback_AddRef (IRichEditOleCallback *This)
 
static ULONG STDMETHODCALLTYPE RichEditOleCallback_Release (IRichEditOleCallback *This)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetNewStorage (IRichEditOleCallback *This, LPSTORAGE *lplpstg)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetInPlaceContext (IRichEditOleCallback *This, LPOLEINPLACEFRAME *lplpFrame, LPOLEINPLACEUIWINDOW *lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_ShowContainerUI (IRichEditOleCallback *This, BOOL fShow)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryInsertObject (IRichEditOleCallback *This, LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_DeleteObject (IRichEditOleCallback *This, LPOLEOBJECT lpoleobj)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryAcceptData (IRichEditOleCallback *This, LPDATAOBJECT lpdataobj, CLIPFORMAT *lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_ContextSensitiveHelp (IRichEditOleCallback *This, BOOL fEnterMode)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetClipboardData (IRichEditOleCallback *This, CHARRANGE *lpchrg, DWORD reco, LPDATAOBJECT *lplpdataobj)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetDragDropEffect (IRichEditOleCallback *This, BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect)
 
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetContextMenu (IRichEditOleCallback *This, WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE *lpchrg, HMENU *lphmenu)
 
HRESULT setup_richedit_olecallback (HWND hEditorWnd)
 

Variables

struct IRichEditOleCallbackImpl olecallback
 
struct IRichEditOleCallbackVtbl olecallbackVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file olecallback.c.

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 24 of file olecallback.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 23 of file olecallback.c.

Function Documentation

◆ RichEditOleCallback_AddRef()

static ULONG STDMETHODCALLTYPE RichEditOleCallback_AddRef ( IRichEditOleCallback This)
static

Definition at line 57 of file olecallback.c.

59{
60 WINE_TRACE("(%p)\n", This);
61 /* singleton */
62 return 1;
63}
#define WINE_TRACE
Definition: debug.h:354

◆ RichEditOleCallback_ContextSensitiveHelp()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_ContextSensitiveHelp ( IRichEditOleCallback This,
BOOL  fEnterMode 
)
static

Definition at line 136 of file olecallback.c.

139{
140 WINE_TRACE("(%p, %d)\n", This, fEnterMode);
141 return S_OK;
142}
#define S_OK
Definition: intsafe.h:52

◆ RichEditOleCallback_DeleteObject()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_DeleteObject ( IRichEditOleCallback This,
LPOLEOBJECT  lpoleobj 
)
static

Definition at line 115 of file olecallback.c.

118{
119 WINE_TRACE("(%p, %p)\n", This, lpoleobj);
120 return S_OK;
121}

◆ RichEditOleCallback_GetClipboardData()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetClipboardData ( IRichEditOleCallback This,
CHARRANGE lpchrg,
DWORD  reco,
LPDATAOBJECT lplpdataobj 
)
static

Definition at line 144 of file olecallback.c.

149{
150 WINE_TRACE("(%p, %p, %x, %p)\n", This, lpchrg, reco, lplpdataobj);
151 return E_NOTIMPL;
152}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RichEditOleCallback_GetContextMenu()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetContextMenu ( IRichEditOleCallback This,
WORD  seltype,
LPOLEOBJECT  lpoleobj,
CHARRANGE lpchrg,
HMENU lphmenu 
)
static

Definition at line 166 of file olecallback.c.

172{
175
176 WINE_TRACE("(%p, %x, %p, %p, %p)\n",
177 This, seltype, lpoleobj, lpchrg, lphmenu);
178
179 *lphmenu = GetSubMenu(hPopupMenu, 0);
180 return S_OK;
181}
HINSTANCE hInstance
Definition: charmap.c:19
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define IDM_POPUP
Definition: wordpad.h:180

◆ RichEditOleCallback_GetDragDropEffect()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetDragDropEffect ( IRichEditOleCallback This,
BOOL  fDrag,
DWORD  grfKeyState,
LPDWORD  pdwEffect 
)
static

Definition at line 154 of file olecallback.c.

159{
160 WINE_TRACE("(%p, %d, %x, %p)\n", This, fDrag, grfKeyState, pdwEffect);
161 if (pdwEffect)
162 *pdwEffect = DROPEFFECT_COPY;
163 return S_OK;
164}

◆ RichEditOleCallback_GetInPlaceContext()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetInPlaceContext ( IRichEditOleCallback This,
LPOLEINPLACEFRAME *  lplpFrame,
LPOLEINPLACEUIWINDOW *  lplpDoc,
LPOLEINPLACEFRAMEINFO  lpFrameInfo 
)
static

Definition at line 87 of file olecallback.c.

92{
93 WINE_FIXME("(%p, %p, %p, %p) stub\n", This, lplpFrame, lplpDoc, lpFrameInfo);
94 return E_INVALIDARG;
95}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define WINE_FIXME
Definition: debug.h:366

◆ RichEditOleCallback_GetNewStorage()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetNewStorage ( IRichEditOleCallback This,
LPSTORAGE lplpstg 
)
static

Definition at line 73 of file olecallback.c.

76{
77 WCHAR name[32];
78 static const WCHAR template[] = {'R','E','O','L','E','_','%','u','\0'};
79
80 WINE_TRACE("(%p, %p)\n", This, lplpstg);
81 wsprintfW(name, template, olecallback.item_num++);
82 return IStorage_CreateStorage(olecallback.stg, name,
84 0, 0, lplpstg);
85}
#define STGM_CREATE
Definition: objbase.h:926
#define STGM_READWRITE
Definition: objbase.h:919
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
struct IRichEditOleCallbackImpl olecallback
Definition: olecallback.c:40
Definition: name.c:39
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ RichEditOleCallback_QueryAcceptData()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryAcceptData ( IRichEditOleCallback This,
LPDATAOBJECT  lpdataobj,
CLIPFORMAT *  lpcfFormat,
DWORD  reco,
BOOL  fReally,
HGLOBAL  hMetaPict 
)
static

Definition at line 123 of file olecallback.c.

130{
131 WINE_TRACE("(%p, %p, %p, %x, %d, %p)\n",
132 This, lpdataobj, lpcfFormat, reco, fReally, hMetaPict);
133 return S_OK;
134}

◆ RichEditOleCallback_QueryInsertObject()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryInsertObject ( IRichEditOleCallback This,
LPCLSID  lpclsid,
LPSTORAGE  lpstg,
LONG  cp 
)
static

Definition at line 105 of file olecallback.c.

110{
111 WINE_TRACE("(%p, %p, %p, %d)\n", This, lpclsid, lpstg, cp);
112 return S_OK;
113}
POINT cp
Definition: magnifier.c:59

◆ RichEditOleCallback_QueryInterface()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryInterface ( IRichEditOleCallback This,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 42 of file olecallback.c.

46{
47 WINE_TRACE("(%p, %s, %p)\n", This, wine_dbgstr_guid(riid), ppvObject);
48 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IRichEditOleCallback))
49 {
50 *ppvObject = This;
51 return S_OK;
52 }
53 WINE_FIXME("Unknown interface: %s\n", wine_dbgstr_guid(riid));
54 return E_NOINTERFACE;
55}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ RichEditOleCallback_Release()

static ULONG STDMETHODCALLTYPE RichEditOleCallback_Release ( IRichEditOleCallback This)
static

Definition at line 65 of file olecallback.c.

67{
68 WINE_TRACE("(%p)\n", This);
69 return 1;
70}

◆ RichEditOleCallback_ShowContainerUI()

static HRESULT STDMETHODCALLTYPE RichEditOleCallback_ShowContainerUI ( IRichEditOleCallback This,
BOOL  fShow 
)
static

Definition at line 97 of file olecallback.c.

100{
101 WINE_TRACE("(%p, %d)\n", This, fShow);
102 return S_OK;
103}

◆ setup_richedit_olecallback()

HRESULT setup_richedit_olecallback ( HWND  hEditorWnd)

Definition at line 203 of file olecallback.c.

204{
207 0, &olecallback.stg);
208
210 return hr;
211}
static HWND hEditorWnd
Definition: wordpad.c:61
#define NULL
Definition: types.h:112
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8636
#define STGM_DELETEONRELEASE
Definition: objbase.h:925
#define EM_SETOLECALLBACK
Definition: richedit.h:103
HRESULT hr
Definition: shlfolder.c:183
LONG_PTR LPARAM
Definition: windef.h:208
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by OnCreate().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wordpad  )

Variable Documentation

◆ olecallback

Initial value:
= {
}
struct IRichEditOleCallbackVtbl olecallbackVtbl
Definition: olecallback.c:183

Definition at line 40 of file olecallback.c.

Referenced by RichEditOleCallback_GetNewStorage(), and setup_richedit_olecallback().

◆ olecallbackVtbl

struct IRichEditOleCallbackVtbl olecallbackVtbl
Initial value:
= {
}
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_ContextSensitiveHelp(IRichEditOleCallback *This, BOOL fEnterMode)
Definition: olecallback.c:136
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryInterface(IRichEditOleCallback *This, REFIID riid, void **ppvObject)
Definition: olecallback.c:42
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetDragDropEffect(IRichEditOleCallback *This, BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect)
Definition: olecallback.c:154
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetInPlaceContext(IRichEditOleCallback *This, LPOLEINPLACEFRAME *lplpFrame, LPOLEINPLACEUIWINDOW *lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo)
Definition: olecallback.c:87
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetNewStorage(IRichEditOleCallback *This, LPSTORAGE *lplpstg)
Definition: olecallback.c:73
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_DeleteObject(IRichEditOleCallback *This, LPOLEOBJECT lpoleobj)
Definition: olecallback.c:115
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_ShowContainerUI(IRichEditOleCallback *This, BOOL fShow)
Definition: olecallback.c:97
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetContextMenu(IRichEditOleCallback *This, WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE *lpchrg, HMENU *lphmenu)
Definition: olecallback.c:166
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryAcceptData(IRichEditOleCallback *This, LPDATAOBJECT lpdataobj, CLIPFORMAT *lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict)
Definition: olecallback.c:123
static ULONG STDMETHODCALLTYPE RichEditOleCallback_Release(IRichEditOleCallback *This)
Definition: olecallback.c:65
static ULONG STDMETHODCALLTYPE RichEditOleCallback_AddRef(IRichEditOleCallback *This)
Definition: olecallback.c:57
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_GetClipboardData(IRichEditOleCallback *This, CHARRANGE *lpchrg, DWORD reco, LPDATAOBJECT *lplpdataobj)
Definition: olecallback.c:144
static HRESULT STDMETHODCALLTYPE RichEditOleCallback_QueryInsertObject(IRichEditOleCallback *This, LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp)
Definition: olecallback.c:105

Definition at line 183 of file olecallback.c.