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 typedef struct IRichEditOleImpl
{
40 const IRichEditOleVtbl
*lpVtbl
;
43 ME_TextEditor
*editor
;
46 /* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/
48 /* FIXME: the next 6 lines should be in textserv.h */
49 #define TEXTSERV_GUID(name, l, w1, w2, b1, b2) \
50 GUID name = { l, w1, w2, {b1, b2, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5}}
52 TEXTSERV_GUID(IID_ITextServices
, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d);
53 TEXTSERV_GUID(IID_ITextHost
, 0xc5bdd8d0, 0xd26e, 0x11ce, 0xa8, 0x9e);
54 TEXTSERV_GUID(IID_ITextHost2
, 0xc5bdd8d0, 0xd26e, 0x11ce, 0xa8, 0x9e);
57 IRichEditOle_fnQueryInterface(IRichEditOle
*me
, REFIID riid
, LPVOID
*ppvObj
)
59 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
61 TRACE("%p %s\n", This
, debugstr_guid(riid
) );
63 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
64 IsEqualGUID(riid
, &IID_IRichEditOle
))
66 IRichEditOle_AddRef(me
);
67 *ppvObj
= (LPVOID
) This
;
70 FIXME("%p: unhandled interface %s\n", This
, debugstr_guid(riid
) );
76 IRichEditOle_fnAddRef(IRichEditOle
*me
)
78 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
79 ULONG ref
= InterlockedIncrement( &This
->ref
);
81 TRACE("%p ref = %lu\n", This
, ref
);
87 IRichEditOle_fnRelease(IRichEditOle
*me
)
89 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
90 ULONG ref
= InterlockedDecrement(&This
->ref
);
92 TRACE ("%p ref=%lu\n", This
, ref
);
96 TRACE ("Destroying %p\n", This
);
97 HeapFree(GetProcessHeap(),0,This
);
102 static HRESULT WINAPI
103 IRichEditOle_fnActivateAs(IRichEditOle
*me
, REFCLSID rclsid
, REFCLSID rclsidAs
)
105 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
106 FIXME("stub %p\n",This
);
110 static HRESULT WINAPI
111 IRichEditOle_fnContextSensitiveHelp(IRichEditOle
*me
, BOOL fEnterMode
)
113 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
114 FIXME("stub %p\n",This
);
118 static HRESULT WINAPI
119 IRichEditOle_fnConvertObject(IRichEditOle
*me
, LONG iob
,
120 REFCLSID rclsidNew
, LPCSTR lpstrUserTypeNew
)
122 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
123 FIXME("stub %p\n",This
);
127 static HRESULT WINAPI
128 IRichEditOle_fnGetClientSite(IRichEditOle
*me
,
129 LPOLECLIENTSITE
*lplpolesite
)
131 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
132 FIXME("stub %p\n",This
);
136 static HRESULT WINAPI
137 IRichEditOle_fnGetClipboardData(IRichEditOle
*me
, CHARRANGE
*lpchrg
,
138 DWORD reco
, LPDATAOBJECT
*lplpdataobj
)
140 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
143 TRACE("(%p,%p,%ld)\n",This
, lpchrg
, reco
);
147 ME_GetSelection(This
->editor
, (int*)&tmpchrg
.cpMin
, (int*)&tmpchrg
.cpMax
);
150 return ME_GetDataObject(This
->editor
, lpchrg
, lplpdataobj
);
153 static LONG WINAPI
IRichEditOle_fnGetLinkCount(IRichEditOle
*me
)
155 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
156 FIXME("stub %p\n",This
);
160 static HRESULT WINAPI
161 IRichEditOle_fnGetObject(IRichEditOle
*me
, LONG iob
,
162 REOBJECT
*lpreobject
, DWORD dwFlags
)
164 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
165 FIXME("stub %p\n",This
);
170 IRichEditOle_fnGetObjectCount(IRichEditOle
*me
)
172 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
173 FIXME("stub %p\n",This
);
177 static HRESULT WINAPI
178 IRichEditOle_fnHandsOffStorage(IRichEditOle
*me
, LONG iob
)
180 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
181 FIXME("stub %p\n",This
);
185 static HRESULT WINAPI
186 IRichEditOle_fnImportDataObject(IRichEditOle
*me
, LPDATAOBJECT lpdataobj
,
187 CLIPFORMAT cf
, HGLOBAL hMetaPict
)
189 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
190 FIXME("stub %p\n",This
);
194 static HRESULT WINAPI
195 IRichEditOle_fnInPlaceDeactivate(IRichEditOle
*me
)
197 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
198 FIXME("stub %p\n",This
);
202 static HRESULT WINAPI
203 IRichEditOle_fnInsertObject(IRichEditOle
*me
, REOBJECT
*lpreobject
)
205 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
206 FIXME("stub %p\n",This
);
210 static HRESULT WINAPI
IRichEditOle_fnSaveCompleted(IRichEditOle
*me
, LONG iob
,
213 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
214 FIXME("stub %p\n",This
);
218 static HRESULT WINAPI
219 IRichEditOle_fnSetDvaspect(IRichEditOle
*me
, LONG iob
, DWORD dvaspect
)
221 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
222 FIXME("stub %p\n",This
);
226 static HRESULT WINAPI
IRichEditOle_fnSetHostNames(IRichEditOle
*me
,
227 LPCSTR lpstrContainerApp
, LPCSTR lpstrContainerObj
)
229 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
230 FIXME("stub %p %s %s\n",This
, lpstrContainerApp
, lpstrContainerObj
);
234 static HRESULT WINAPI
235 IRichEditOle_fnSetLinkAvailable(IRichEditOle
*me
, LONG iob
, BOOL fAvailable
)
237 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
238 FIXME("stub %p\n",This
);
242 static const IRichEditOleVtbl revt
= {
243 IRichEditOle_fnQueryInterface
,
244 IRichEditOle_fnAddRef
,
245 IRichEditOle_fnRelease
,
246 IRichEditOle_fnGetClientSite
,
247 IRichEditOle_fnGetObjectCount
,
248 IRichEditOle_fnGetLinkCount
,
249 IRichEditOle_fnGetObject
,
250 IRichEditOle_fnInsertObject
,
251 IRichEditOle_fnConvertObject
,
252 IRichEditOle_fnActivateAs
,
253 IRichEditOle_fnSetHostNames
,
254 IRichEditOle_fnSetLinkAvailable
,
255 IRichEditOle_fnSetDvaspect
,
256 IRichEditOle_fnHandsOffStorage
,
257 IRichEditOle_fnSaveCompleted
,
258 IRichEditOle_fnInPlaceDeactivate
,
259 IRichEditOle_fnContextSensitiveHelp
,
260 IRichEditOle_fnGetClipboardData
,
261 IRichEditOle_fnImportDataObject
264 LRESULT
CreateIRichEditOle(ME_TextEditor
*editor
, LPVOID
*ppObj
)
266 IRichEditOleImpl
*reo
;
268 reo
= HeapAlloc(GetProcessHeap(), 0, sizeof(IRichEditOleImpl
));
274 reo
->editor
= editor
;
275 TRACE("Created %p\n",reo
);
276 *ppObj
= (LPVOID
) reo
;