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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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
;
141 FIXME("stub %p\n",This
);
145 static LONG WINAPI
IRichEditOle_fnGetLinkCount(IRichEditOle
*me
)
147 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
148 FIXME("stub %p\n",This
);
152 static HRESULT WINAPI
153 IRichEditOle_fnGetObject(IRichEditOle
*me
, LONG iob
,
154 REOBJECT
*lpreobject
, DWORD dwFlags
)
156 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
157 FIXME("stub %p\n",This
);
162 IRichEditOle_fnGetObjectCount(IRichEditOle
*me
)
164 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
165 FIXME("stub %p\n",This
);
169 static HRESULT WINAPI
170 IRichEditOle_fnHandsOffStorage(IRichEditOle
*me
, LONG iob
)
172 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
173 FIXME("stub %p\n",This
);
177 static HRESULT WINAPI
178 IRichEditOle_fnImportDataObject(IRichEditOle
*me
, LPDATAOBJECT lpdataobj
,
179 CLIPFORMAT cf
, HGLOBAL hMetaPict
)
181 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
182 FIXME("stub %p\n",This
);
186 static HRESULT WINAPI
187 IRichEditOle_fnInPlaceDeactivate(IRichEditOle
*me
)
189 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
190 FIXME("stub %p\n",This
);
194 static HRESULT WINAPI
195 IRichEditOle_fnInsertObject(IRichEditOle
*me
, REOBJECT
*lpreobject
)
197 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
198 FIXME("stub %p\n",This
);
202 static HRESULT WINAPI
IRichEditOle_fnSaveCompleted(IRichEditOle
*me
, LONG iob
,
205 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
206 FIXME("stub %p\n",This
);
210 static HRESULT WINAPI
211 IRichEditOle_fnSetDvaspect(IRichEditOle
*me
, LONG iob
, DWORD dvaspect
)
213 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
214 FIXME("stub %p\n",This
);
218 static HRESULT WINAPI
IRichEditOle_fnSetHostNames(IRichEditOle
*me
,
219 LPCSTR lpstrContainerApp
, LPCSTR lpstrContainerObj
)
221 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
222 FIXME("stub %p %s %s\n",This
, lpstrContainerApp
, lpstrContainerObj
);
226 static HRESULT WINAPI
227 IRichEditOle_fnSetLinkAvailable(IRichEditOle
*me
, LONG iob
, BOOL fAvailable
)
229 IRichEditOleImpl
*This
= (IRichEditOleImpl
*)me
;
230 FIXME("stub %p\n",This
);
234 static const IRichEditOleVtbl revt
= {
235 IRichEditOle_fnQueryInterface
,
236 IRichEditOle_fnAddRef
,
237 IRichEditOle_fnRelease
,
238 IRichEditOle_fnGetClientSite
,
239 IRichEditOle_fnGetObjectCount
,
240 IRichEditOle_fnGetLinkCount
,
241 IRichEditOle_fnGetObject
,
242 IRichEditOle_fnInsertObject
,
243 IRichEditOle_fnConvertObject
,
244 IRichEditOle_fnActivateAs
,
245 IRichEditOle_fnSetHostNames
,
246 IRichEditOle_fnSetLinkAvailable
,
247 IRichEditOle_fnSetDvaspect
,
248 IRichEditOle_fnHandsOffStorage
,
249 IRichEditOle_fnSaveCompleted
,
250 IRichEditOle_fnInPlaceDeactivate
,
251 IRichEditOle_fnContextSensitiveHelp
,
252 IRichEditOle_fnGetClipboardData
,
253 IRichEditOle_fnImportDataObject
256 LRESULT
CreateIRichEditOle(ME_TextEditor
*editor
, LPVOID
*ppObj
)
258 IRichEditOleImpl
*reo
;
260 reo
= HeapAlloc(GetProcessHeap(), 0, sizeof(IRichEditOleImpl
));
266 reo
->editor
= editor
;
267 TRACE("Created %p\n",reo
);
268 *ppObj
= (LPVOID
) reo
;