ReactOS  0.4.12-dev-18-gf469aca
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:358

◆ 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 WINE_TRACE
Definition: debug.h:358
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define WINE_TRACE
Definition: debug.h:358
#define S_OK
Definition: intsafe.h:59

◆ 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 WINE_TRACE
Definition: debug.h:358
#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 {
174  HMENU hPopupMenu = LoadMenuW(hInstance, MAKEINTRESOURCEW(IDM_POPUP));
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 }
#define WINE_TRACE
Definition: debug.h:358
HINSTANCE hInstance
Definition: charmap.c:20
#define IDM_POPUP
Definition: wordpad.h:180
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define S_OK
Definition: intsafe.h:59
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ 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 }
#define WINE_TRACE
Definition: debug.h:358
#define S_OK
Definition: intsafe.h:59

◆ 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:370

◆ 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 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define STGM_CREATE
Definition: objbase.h:925
#define WINE_TRACE
Definition: debug.h:358
#define STGM_READWRITE
Definition: objbase.h:918
Definition: name.c:36
struct IRichEditOleCallbackImpl olecallback
Definition: olecallback.c:40

◆ 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 }
#define WINE_TRACE
Definition: debug.h:358
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define WINE_TRACE
Definition: debug.h:358
#define S_OK
Definition: intsafe.h:59
POINT cp
Definition: magnifier.c:60

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define WINE_TRACE
Definition: debug.h:358
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
#define WINE_FIXME
Definition: debug.h:370

◆ 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 }
#define WINE_TRACE
Definition: debug.h:358

◆ 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 }
INT BOOL fShow
Definition: msvc.h:54
#define WINE_TRACE
Definition: debug.h:358
#define S_OK
Definition: intsafe.h:59

◆ setup_richedit_olecallback()

HRESULT setup_richedit_olecallback ( HWND  hEditorWnd)

Definition at line 203 of file olecallback.c.

Referenced by OnCreate().

204 {
207  0, &olecallback.stg);
208 
210  return hr;
211 }
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
LONG_PTR LPARAM
Definition: windef.h:208
smooth NULL
Definition: ftsmooth.c:416
#define STGM_DELETEONRELEASE
Definition: objbase.h:924
LONG HRESULT
Definition: typedefs.h:77
#define EM_SETOLECALLBACK
Definition: richedit.h:103
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8637
#define STGM_READWRITE
Definition: objbase.h:918
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct IRichEditOleCallbackImpl olecallback
Definition: olecallback.c:40

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wordpad  )

Variable Documentation

◆ olecallback

Initial value:
= {
}
smooth NULL
Definition: ftsmooth.c:416
struct IRichEditOleCallbackVtbl olecallbackVtbl
Definition: olecallback.c:183

Definition at line 40 of file olecallback.c.

Referenced by RichEditOleCallback_GetNewStorage().

◆ olecallbackVtbl

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

Definition at line 183 of file olecallback.c.