2 * RichEdit GUIDs and OLE interface
4 * Copyright 2004 by Krzysztof Foltman
5 * Copyright 2004 Aric Stewart
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(richedit);
39 /* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/
41 /* FIXME: the next 6 lines should be in textserv.h */
43 #define TEXTSERV_GUID(name, l, w1, w2, b1, b2) \
44 DEFINE_GUID(name, l, w1, w2, b1, b2, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5)
46 TEXTSERV_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d);
47 TEXTSERV_GUID(IID_ITextHost, 0xc5bdd8d0, 0xd26e, 0x11ce, 0xa8, 0x9e);
48 TEXTSERV_GUID(IID_ITextHost2, 0xc5bdd8d0, 0xd26e, 0x11ce, 0xa8, 0x9e);
50 typedef struct IRichEditOleImpl {
51 const IRichEditOleVtbl *lpVtbl;
54 ME_TextEditor *editor;
58 IRichEditOle_fnQueryInterface(IRichEditOle *me, REFIID riid, LPVOID *ppvObj)
60 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
62 TRACE("%p %s\n", This, debugstr_guid(riid) );
64 if (IsEqualGUID(riid, &IID_IUnknown) ||
65 IsEqualGUID(riid, &IID_IRichEditOle))
67 IRichEditOle_AddRef(me);
68 *ppvObj = (LPVOID) This;
71 FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid) );
77 IRichEditOle_fnAddRef(IRichEditOle *me)
79 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
80 ULONG ref = InterlockedIncrement( &This->ref );
82 TRACE("%p ref = %lu\n", This, ref);
88 IRichEditOle_fnRelease(IRichEditOle *me)
90 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
91 ULONG ref = InterlockedDecrement(&This->ref);
93 TRACE ("%p ref=%lu\n", This, ref);
97 TRACE ("Destroying %p\n", This);
98 HeapFree(GetProcessHeap(),0,This);
103 static HRESULT WINAPI
104 IRichEditOle_fnActivateAs(IRichEditOle *me, REFCLSID rclsid, REFCLSID rclsidAs)
106 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
107 FIXME("stub %p\n",This);
111 static HRESULT WINAPI
112 IRichEditOle_fnContextSensitiveHelp(IRichEditOle *me, BOOL fEnterMode)
114 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
115 FIXME("stub %p\n",This);
119 static HRESULT WINAPI
120 IRichEditOle_fnConvertObject(IRichEditOle *me, LONG iob,
121 REFCLSID rclsidNew, LPCSTR lpstrUserTypeNew)
123 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
124 FIXME("stub %p\n",This);
128 static HRESULT WINAPI
129 IRichEditOle_fnGetClientSite(IRichEditOle *me,
130 LPOLECLIENTSITE *lplpolesite)
132 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
133 FIXME("stub %p\n",This);
137 static HRESULT WINAPI
138 IRichEditOle_fnGetClipboardData(IRichEditOle *me, CHARRANGE *lpchrg,
139 DWORD reco, LPDATAOBJECT *lplpdataobj)
141 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
144 TRACE("(%p,%p,%ld)\n",This, lpchrg, reco);
148 ME_GetSelection(This->editor, (int*)&tmpchrg.cpMin, (int*)&tmpchrg.cpMax);
151 return ME_GetDataObject(This->editor, lpchrg, lplpdataobj);
154 static LONG WINAPI IRichEditOle_fnGetLinkCount(IRichEditOle *me)
156 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
157 FIXME("stub %p\n",This);
161 static HRESULT WINAPI
162 IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob,
163 REOBJECT *lpreobject, DWORD dwFlags)
165 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
166 FIXME("stub %p\n",This);
171 IRichEditOle_fnGetObjectCount(IRichEditOle *me)
173 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
174 FIXME("stub %p\n",This);
178 static HRESULT WINAPI
179 IRichEditOle_fnHandsOffStorage(IRichEditOle *me, LONG iob)
181 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
182 FIXME("stub %p\n",This);
186 static HRESULT WINAPI
187 IRichEditOle_fnImportDataObject(IRichEditOle *me, LPDATAOBJECT lpdataobj,
188 CLIPFORMAT cf, HGLOBAL hMetaPict)
190 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
191 FIXME("stub %p\n",This);
195 static HRESULT WINAPI
196 IRichEditOle_fnInPlaceDeactivate(IRichEditOle *me)
198 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
199 FIXME("stub %p\n",This);
203 static HRESULT WINAPI
204 IRichEditOle_fnInsertObject(IRichEditOle *me, REOBJECT *lpreobject)
206 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
207 FIXME("stub %p\n",This);
211 static HRESULT WINAPI IRichEditOle_fnSaveCompleted(IRichEditOle *me, LONG iob,
214 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
215 FIXME("stub %p\n",This);
219 static HRESULT WINAPI
220 IRichEditOle_fnSetDvaspect(IRichEditOle *me, LONG iob, DWORD dvaspect)
222 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
223 FIXME("stub %p\n",This);
227 static HRESULT WINAPI IRichEditOle_fnSetHostNames(IRichEditOle *me,
228 LPCSTR lpstrContainerApp, LPCSTR lpstrContainerObj)
230 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
231 FIXME("stub %p %s %s\n",This, lpstrContainerApp, lpstrContainerObj);
235 static HRESULT WINAPI
236 IRichEditOle_fnSetLinkAvailable(IRichEditOle *me, LONG iob, BOOL fAvailable)
238 IRichEditOleImpl *This = (IRichEditOleImpl *)me;
239 FIXME("stub %p\n",This);
243 static const IRichEditOleVtbl revt = {
244 IRichEditOle_fnQueryInterface,
245 IRichEditOle_fnAddRef,
246 IRichEditOle_fnRelease,
247 IRichEditOle_fnGetClientSite,
248 IRichEditOle_fnGetObjectCount,
249 IRichEditOle_fnGetLinkCount,
250 IRichEditOle_fnGetObject,
251 IRichEditOle_fnInsertObject,
252 IRichEditOle_fnConvertObject,
253 IRichEditOle_fnActivateAs,
254 IRichEditOle_fnSetHostNames,
255 IRichEditOle_fnSetLinkAvailable,
256 IRichEditOle_fnSetDvaspect,
257 IRichEditOle_fnHandsOffStorage,
258 IRichEditOle_fnSaveCompleted,
259 IRichEditOle_fnInPlaceDeactivate,
260 IRichEditOle_fnContextSensitiveHelp,
261 IRichEditOle_fnGetClipboardData,
262 IRichEditOle_fnImportDataObject
265 LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj)
267 IRichEditOleImpl *reo;
269 reo = HeapAlloc(GetProcessHeap(), 0, sizeof(IRichEditOleImpl));
275 reo->editor = editor;
276 TRACE("Created %p\n",reo);
277 *ppObj = (LPVOID) reo;