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
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*/
42 DEFINE_GUID(IID_ITextServices
, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5);
43 DEFINE_GUID(IID_ITextHost
, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
44 DEFINE_GUID(IID_ITextHost2
, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
45 DEFINE_GUID(IID_ITextDocument
, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
46 DEFINE_GUID(IID_ITextRange
, 0x8cc497c2, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
47 DEFINE_GUID(IID_ITextSelection
, 0x8cc497c1, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
48 DEFINE_GUID(IID_ITextFont
, 0x8cc497c3, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
49 DEFINE_GUID(IID_ITextPara
, 0x8cc497c4, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
51 typedef struct ITextSelectionImpl ITextSelectionImpl
;
52 typedef struct IOleClientSiteImpl IOleClientSiteImpl
;
53 typedef struct ITextRangeImpl ITextRangeImpl
;
55 typedef struct IRichEditOleImpl
{
56 IUnknown IUnknown_inner
;
57 IRichEditOle IRichEditOle_iface
;
58 ITextDocument ITextDocument_iface
;
62 ME_TextEditor
*editor
;
63 ITextSelectionImpl
*txtSel
;
64 IOleClientSiteImpl
*clientSite
;
65 struct list rangelist
;
68 struct ITextRangeImpl
{
69 ITextRange ITextRange_iface
;
74 IRichEditOleImpl
*reOle
;
77 struct ITextSelectionImpl
{
78 ITextSelection ITextSelection_iface
;
81 IRichEditOleImpl
*reOle
;
84 typedef struct ITextFontImpl
{
85 ITextFont ITextFont_iface
;
91 typedef struct ITextParaImpl
{
92 ITextPara ITextPara_iface
;
98 struct IOleClientSiteImpl
{
99 IOleClientSite IOleClientSite_iface
;
100 IOleWindow IOleWindow_iface
;
101 IOleInPlaceSite IOleInPlaceSite_iface
;
104 IRichEditOleImpl
*reOle
;
107 static inline IRichEditOleImpl
*impl_from_IRichEditOle(IRichEditOle
*iface
)
109 return CONTAINING_RECORD(iface
, IRichEditOleImpl
, IRichEditOle_iface
);
112 static inline IRichEditOleImpl
*impl_from_ITextDocument(ITextDocument
*iface
)
114 return CONTAINING_RECORD(iface
, IRichEditOleImpl
, ITextDocument_iface
);
117 static inline IRichEditOleImpl
*impl_from_IUnknown(IUnknown
*iface
)
119 return CONTAINING_RECORD(iface
, IRichEditOleImpl
, IUnknown_inner
);
122 static inline IOleClientSiteImpl
*impl_from_IOleWindow(IOleWindow
*iface
)
124 return CONTAINING_RECORD(iface
, IOleClientSiteImpl
, IOleWindow_iface
);
127 static inline IOleClientSiteImpl
*impl_from_IOleInPlaceSite(IOleInPlaceSite
*iface
)
129 return CONTAINING_RECORD(iface
, IOleClientSiteImpl
, IOleInPlaceSite_iface
);
132 static inline ITextSelectionImpl
*impl_from_ITextSelection(ITextSelection
*iface
)
134 return CONTAINING_RECORD(iface
, ITextSelectionImpl
, ITextSelection_iface
);
137 static inline ITextFontImpl
*impl_from_ITextFont(ITextFont
*iface
)
139 return CONTAINING_RECORD(iface
, ITextFontImpl
, ITextFont_iface
);
142 static inline ITextParaImpl
*impl_from_ITextPara(ITextPara
*iface
)
144 return CONTAINING_RECORD(iface
, ITextParaImpl
, ITextPara_iface
);
147 static HRESULT
create_textfont(ITextRange
*, ITextFont
**);
148 static HRESULT
create_textpara(ITextRange
*, ITextPara
**);
150 static HRESULT WINAPI
IRichEditOleImpl_inner_fnQueryInterface(IUnknown
*iface
, REFIID riid
, LPVOID
*ppvObj
)
152 IRichEditOleImpl
*This
= impl_from_IUnknown(iface
);
154 TRACE("%p %s\n", This
, debugstr_guid(riid
));
157 if (IsEqualGUID(riid
, &IID_IUnknown
))
158 *ppvObj
= &This
->IUnknown_inner
;
159 else if (IsEqualGUID(riid
, &IID_IRichEditOle
))
160 *ppvObj
= &This
->IRichEditOle_iface
;
161 else if (IsEqualGUID(riid
, &IID_ITextDocument
))
162 *ppvObj
= &This
->ITextDocument_iface
;
165 IUnknown_AddRef((IUnknown
*)*ppvObj
);
168 FIXME("%p: unhandled interface %s\n", This
, debugstr_guid(riid
));
170 return E_NOINTERFACE
;
173 static ULONG WINAPI
IRichEditOleImpl_inner_fnAddRef(IUnknown
*iface
)
175 IRichEditOleImpl
*This
= impl_from_IUnknown(iface
);
176 ULONG ref
= InterlockedIncrement(&This
->ref
);
178 TRACE("%p ref = %u\n", This
, ref
);
183 static ULONG WINAPI
IRichEditOleImpl_inner_fnRelease(IUnknown
*iface
)
185 IRichEditOleImpl
*This
= impl_from_IUnknown(iface
);
186 ULONG ref
= InterlockedDecrement(&This
->ref
);
188 TRACE ("%p ref=%u\n", This
, ref
);
192 ITextRangeImpl
*txtRge
;
194 TRACE("Destroying %p\n", This
);
195 This
->txtSel
->reOle
= NULL
;
196 This
->editor
->reOle
= NULL
;
197 ITextSelection_Release(&This
->txtSel
->ITextSelection_iface
);
198 IOleClientSite_Release(&This
->clientSite
->IOleClientSite_iface
);
199 LIST_FOR_EACH_ENTRY(txtRge
, &This
->rangelist
, ITextRangeImpl
, entry
)
200 txtRge
->reOle
= NULL
;
206 static const IUnknownVtbl reo_unk_vtbl
=
208 IRichEditOleImpl_inner_fnQueryInterface
,
209 IRichEditOleImpl_inner_fnAddRef
,
210 IRichEditOleImpl_inner_fnRelease
213 static HRESULT WINAPI
214 IRichEditOle_fnQueryInterface(IRichEditOle
*me
, REFIID riid
, LPVOID
*ppvObj
)
216 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
217 return IUnknown_QueryInterface(This
->outer_unk
, riid
, ppvObj
);
221 IRichEditOle_fnAddRef(IRichEditOle
*me
)
223 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
224 return IUnknown_AddRef(This
->outer_unk
);
228 IRichEditOle_fnRelease(IRichEditOle
*me
)
230 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
231 return IUnknown_Release(This
->outer_unk
);
234 static HRESULT WINAPI
235 IRichEditOle_fnActivateAs(IRichEditOle
*me
, REFCLSID rclsid
, REFCLSID rclsidAs
)
237 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
238 FIXME("stub %p\n",This
);
242 static HRESULT WINAPI
243 IRichEditOle_fnContextSensitiveHelp(IRichEditOle
*me
, BOOL fEnterMode
)
245 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
246 FIXME("stub %p\n",This
);
250 static HRESULT WINAPI
251 IRichEditOle_fnConvertObject(IRichEditOle
*me
, LONG iob
,
252 REFCLSID rclsidNew
, LPCSTR lpstrUserTypeNew
)
254 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
255 FIXME("stub %p\n",This
);
259 static inline IOleClientSiteImpl
*impl_from_IOleClientSite(IOleClientSite
*iface
)
261 return CONTAINING_RECORD(iface
, IOleClientSiteImpl
, IOleClientSite_iface
);
264 static HRESULT WINAPI
265 IOleClientSite_fnQueryInterface(IOleClientSite
*me
, REFIID riid
, LPVOID
*ppvObj
)
267 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(me
);
268 TRACE("%p %s\n", me
, debugstr_guid(riid
) );
271 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
272 IsEqualGUID(riid
, &IID_IOleClientSite
))
274 else if (IsEqualGUID(riid
, &IID_IOleWindow
))
275 *ppvObj
= &This
->IOleWindow_iface
;
276 else if (IsEqualGUID(riid
, &IID_IOleInPlaceSite
))
277 *ppvObj
= &This
->IOleInPlaceSite_iface
;
280 IOleClientSite_AddRef(me
);
283 FIXME("%p: unhandled interface %s\n", me
, debugstr_guid(riid
) );
285 return E_NOINTERFACE
;
288 static ULONG WINAPI
IOleClientSite_fnAddRef(IOleClientSite
*iface
)
290 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
291 return InterlockedIncrement(&This
->ref
);
294 static ULONG WINAPI
IOleClientSite_fnRelease(IOleClientSite
*iface
)
296 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
297 ULONG ref
= InterlockedDecrement(&This
->ref
);
303 static HRESULT WINAPI
IOleClientSite_fnSaveObject(IOleClientSite
*iface
)
305 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
307 return CO_E_RELEASED
;
309 FIXME("stub %p\n", iface
);
314 static HRESULT WINAPI
IOleClientSite_fnGetMoniker(IOleClientSite
*iface
, DWORD dwAssign
,
315 DWORD dwWhichMoniker
, IMoniker
**ppmk
)
317 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
319 return CO_E_RELEASED
;
321 FIXME("stub %p\n", iface
);
325 static HRESULT WINAPI
IOleClientSite_fnGetContainer(IOleClientSite
*iface
,
326 IOleContainer
**ppContainer
)
328 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
330 return CO_E_RELEASED
;
332 FIXME("stub %p\n", iface
);
336 static HRESULT WINAPI
IOleClientSite_fnShowObject(IOleClientSite
*iface
)
338 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
340 return CO_E_RELEASED
;
342 FIXME("stub %p\n", iface
);
346 static HRESULT WINAPI
IOleClientSite_fnOnShowWindow(IOleClientSite
*iface
, BOOL fShow
)
348 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
350 return CO_E_RELEASED
;
352 FIXME("stub %p\n", iface
);
356 static HRESULT WINAPI
IOleClientSite_fnRequestNewObjectLayout(IOleClientSite
*iface
)
358 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
360 return CO_E_RELEASED
;
362 FIXME("stub %p\n", iface
);
366 static const IOleClientSiteVtbl ocst
= {
367 IOleClientSite_fnQueryInterface
,
368 IOleClientSite_fnAddRef
,
369 IOleClientSite_fnRelease
,
370 IOleClientSite_fnSaveObject
,
371 IOleClientSite_fnGetMoniker
,
372 IOleClientSite_fnGetContainer
,
373 IOleClientSite_fnShowObject
,
374 IOleClientSite_fnOnShowWindow
,
375 IOleClientSite_fnRequestNewObjectLayout
378 /* IOleWindow interface */
379 static HRESULT WINAPI
IOleWindow_fnQueryInterface(IOleWindow
*iface
, REFIID riid
, void **ppvObj
)
381 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
382 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppvObj
);
385 static ULONG WINAPI
IOleWindow_fnAddRef(IOleWindow
*iface
)
387 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
388 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
391 static ULONG WINAPI
IOleWindow_fnRelease(IOleWindow
*iface
)
393 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
394 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
397 static HRESULT WINAPI
IOleWindow_fnContextSensitiveHelp(IOleWindow
*iface
, BOOL fEnterMode
)
399 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
400 FIXME("not implemented: (%p)->(%d)\n", This
, fEnterMode
);
404 static HRESULT WINAPI
IOleWindow_fnGetWindow(IOleWindow
*iface
, HWND
*phwnd
)
406 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
407 TRACE("(%p)->(%p)\n", This
, phwnd
);
412 *phwnd
= This
->reOle
->editor
->hWnd
;
416 static const IOleWindowVtbl olewinvt
= {
417 IOleWindow_fnQueryInterface
,
419 IOleWindow_fnRelease
,
420 IOleWindow_fnGetWindow
,
421 IOleWindow_fnContextSensitiveHelp
424 /* IOleInPlaceSite interface */
425 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite
*iface
, REFIID riid
, void **ppvObj
)
427 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
428 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppvObj
);
431 static ULONG STDMETHODCALLTYPE
IOleInPlaceSite_fnAddRef(IOleInPlaceSite
*iface
)
433 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
434 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
437 static ULONG STDMETHODCALLTYPE
IOleInPlaceSite_fnRelease(IOleInPlaceSite
*iface
)
439 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
440 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
443 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnGetWindow(IOleInPlaceSite
*iface
, HWND
*phwnd
)
445 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
446 return IOleWindow_GetWindow(&This
->IOleWindow_iface
, phwnd
);
449 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite
*iface
, BOOL fEnterMode
)
451 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
452 return IOleWindow_ContextSensitiveHelp(&This
->IOleWindow_iface
, fEnterMode
);
455 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnCanInPlaceActivate(IOleInPlaceSite
*iface
)
457 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
458 FIXME("not implemented: (%p)\n", This
);
462 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnInPlaceActivate(IOleInPlaceSite
*iface
)
464 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
465 FIXME("not implemented: (%p)\n", This
);
469 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnUIActivate(IOleInPlaceSite
*iface
)
471 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
472 FIXME("not implemented: (%p)\n", This
);
476 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnGetWindowContext(IOleInPlaceSite
*iface
, IOleInPlaceFrame
**ppFrame
,
477 IOleInPlaceUIWindow
**ppDoc
, LPRECT lprcPosRect
,
478 LPRECT lprcClipRect
, LPOLEINPLACEFRAMEINFO lpFrameInfo
)
480 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
481 FIXME("not implemented: (%p)->(%p %p %p %p %p)\n", This
, ppFrame
, ppDoc
, lprcPosRect
, lprcClipRect
, lpFrameInfo
);
485 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnScroll(IOleInPlaceSite
*iface
, SIZE scrollExtent
)
487 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
488 FIXME("not implemented: (%p)\n", This
);
492 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnUIDeactivate(IOleInPlaceSite
*iface
, BOOL fUndoable
)
494 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
495 FIXME("not implemented: (%p)->(%d)\n", This
, fUndoable
);
499 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnInPlaceDeactivate(IOleInPlaceSite
*iface
)
501 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
502 FIXME("not implemented: (%p)\n", This
);
506 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnDiscardUndoState(IOleInPlaceSite
*iface
)
508 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
509 FIXME("not implemented: (%p)\n", This
);
513 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnDeactivateAndUndo(IOleInPlaceSite
*iface
)
515 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
516 FIXME("not implemented: (%p)\n", This
);
520 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnPosRectChange(IOleInPlaceSite
*iface
, LPCRECT lprcPosRect
)
522 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
523 FIXME("not implemented: (%p)->(%p)\n", This
, lprcPosRect
);
527 static const IOleInPlaceSiteVtbl olestvt
=
529 IOleInPlaceSite_fnQueryInterface
,
530 IOleInPlaceSite_fnAddRef
,
531 IOleInPlaceSite_fnRelease
,
532 IOleInPlaceSite_fnGetWindow
,
533 IOleInPlaceSite_fnContextSensitiveHelp
,
534 IOleInPlaceSite_fnCanInPlaceActivate
,
535 IOleInPlaceSite_fnOnInPlaceActivate
,
536 IOleInPlaceSite_fnOnUIActivate
,
537 IOleInPlaceSite_fnGetWindowContext
,
538 IOleInPlaceSite_fnScroll
,
539 IOleInPlaceSite_fnOnUIDeactivate
,
540 IOleInPlaceSite_fnOnInPlaceDeactivate
,
541 IOleInPlaceSite_fnDiscardUndoState
,
542 IOleInPlaceSite_fnDeactivateAndUndo
,
543 IOleInPlaceSite_fnOnPosRectChange
546 static IOleClientSiteImpl
*
547 CreateOleClientSite(IRichEditOleImpl
*reOle
)
549 IOleClientSiteImpl
*clientSite
= heap_alloc(sizeof *clientSite
);
553 clientSite
->IOleClientSite_iface
.lpVtbl
= &ocst
;
554 clientSite
->IOleWindow_iface
.lpVtbl
= &olewinvt
;
555 clientSite
->IOleInPlaceSite_iface
.lpVtbl
= &olestvt
;
557 clientSite
->reOle
= reOle
;
561 static HRESULT WINAPI
562 IRichEditOle_fnGetClientSite(IRichEditOle
*me
,
563 LPOLECLIENTSITE
*lplpolesite
)
565 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
567 TRACE("%p,%p\n",This
, lplpolesite
);
571 *lplpolesite
= &This
->clientSite
->IOleClientSite_iface
;
572 IOleClientSite_AddRef(*lplpolesite
);
576 static HRESULT WINAPI
577 IRichEditOle_fnGetClipboardData(IRichEditOle
*me
, CHARRANGE
*lpchrg
,
578 DWORD reco
, LPDATAOBJECT
*lplpdataobj
)
580 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
584 TRACE("(%p,%p,%d)\n",This
, lpchrg
, reco
);
588 int nFrom
, nTo
, nStartCur
= ME_GetSelectionOfs(This
->editor
, &nFrom
, &nTo
);
589 start
= This
->editor
->pCursors
[nStartCur
];
590 nChars
= nTo
- nFrom
;
592 ME_CursorFromCharOfs(This
->editor
, lpchrg
->cpMin
, &start
);
593 nChars
= lpchrg
->cpMax
- lpchrg
->cpMin
;
595 return ME_GetDataObject(This
->editor
, &start
, nChars
, lplpdataobj
);
598 static LONG WINAPI
IRichEditOle_fnGetLinkCount(IRichEditOle
*me
)
600 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
601 FIXME("stub %p\n",This
);
605 static HRESULT WINAPI
606 IRichEditOle_fnGetObject(IRichEditOle
*me
, LONG iob
,
607 REOBJECT
*lpreobject
, DWORD dwFlags
)
609 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
610 FIXME("stub %p\n",This
);
615 IRichEditOle_fnGetObjectCount(IRichEditOle
*me
)
617 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
618 FIXME("stub %p\n",This
);
622 static HRESULT WINAPI
623 IRichEditOle_fnHandsOffStorage(IRichEditOle
*me
, LONG iob
)
625 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
626 FIXME("stub %p\n",This
);
630 static HRESULT WINAPI
631 IRichEditOle_fnImportDataObject(IRichEditOle
*me
, LPDATAOBJECT lpdataobj
,
632 CLIPFORMAT cf
, HGLOBAL hMetaPict
)
634 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
635 FIXME("stub %p\n",This
);
639 static HRESULT WINAPI
640 IRichEditOle_fnInPlaceDeactivate(IRichEditOle
*me
)
642 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
643 FIXME("stub %p\n",This
);
647 static HRESULT WINAPI
648 IRichEditOle_fnInsertObject(IRichEditOle
*me
, REOBJECT
*reo
)
650 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
651 TRACE("(%p,%p)\n", This
, reo
);
653 if (reo
->cbStruct
< sizeof(*reo
)) return STG_E_INVALIDPARAMETER
;
655 ME_InsertOLEFromCursor(This
->editor
, reo
, 0);
656 ME_CommitUndo(This
->editor
);
657 ME_UpdateRepaint(This
->editor
, FALSE
);
661 static HRESULT WINAPI
IRichEditOle_fnSaveCompleted(IRichEditOle
*me
, LONG iob
,
664 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
665 FIXME("stub %p\n",This
);
669 static HRESULT WINAPI
670 IRichEditOle_fnSetDvaspect(IRichEditOle
*me
, LONG iob
, DWORD dvaspect
)
672 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
673 FIXME("stub %p\n",This
);
677 static HRESULT WINAPI
IRichEditOle_fnSetHostNames(IRichEditOle
*me
,
678 LPCSTR lpstrContainerApp
, LPCSTR lpstrContainerObj
)
680 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
681 FIXME("stub %p %s %s\n",This
, lpstrContainerApp
, lpstrContainerObj
);
685 static HRESULT WINAPI
686 IRichEditOle_fnSetLinkAvailable(IRichEditOle
*me
, LONG iob
, BOOL fAvailable
)
688 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
689 FIXME("stub %p\n",This
);
693 static const IRichEditOleVtbl revt
= {
694 IRichEditOle_fnQueryInterface
,
695 IRichEditOle_fnAddRef
,
696 IRichEditOle_fnRelease
,
697 IRichEditOle_fnGetClientSite
,
698 IRichEditOle_fnGetObjectCount
,
699 IRichEditOle_fnGetLinkCount
,
700 IRichEditOle_fnGetObject
,
701 IRichEditOle_fnInsertObject
,
702 IRichEditOle_fnConvertObject
,
703 IRichEditOle_fnActivateAs
,
704 IRichEditOle_fnSetHostNames
,
705 IRichEditOle_fnSetLinkAvailable
,
706 IRichEditOle_fnSetDvaspect
,
707 IRichEditOle_fnHandsOffStorage
,
708 IRichEditOle_fnSaveCompleted
,
709 IRichEditOle_fnInPlaceDeactivate
,
710 IRichEditOle_fnContextSensitiveHelp
,
711 IRichEditOle_fnGetClipboardData
,
712 IRichEditOle_fnImportDataObject
715 /* ITextRange interface */
716 static inline ITextRangeImpl
*impl_from_ITextRange(ITextRange
*iface
)
718 return CONTAINING_RECORD(iface
, ITextRangeImpl
, ITextRange_iface
);
721 static HRESULT WINAPI
ITextRange_fnQueryInterface(ITextRange
*me
, REFIID riid
, void **ppvObj
)
724 if (IsEqualGUID(riid
, &IID_IUnknown
)
725 || IsEqualGUID(riid
, &IID_IDispatch
)
726 || IsEqualGUID(riid
, &IID_ITextRange
))
729 ITextRange_AddRef(me
);
733 return E_NOINTERFACE
;
736 static ULONG WINAPI
ITextRange_fnAddRef(ITextRange
*me
)
738 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
739 return InterlockedIncrement(&This
->ref
);
742 static ULONG WINAPI
ITextRange_fnRelease(ITextRange
*me
)
744 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
745 ULONG ref
= InterlockedDecrement(&This
->ref
);
747 TRACE ("%p ref=%u\n", This
, ref
);
752 list_remove(&This
->entry
);
760 static HRESULT WINAPI
ITextRange_fnGetTypeInfoCount(ITextRange
*me
, UINT
*pctinfo
)
762 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
764 return CO_E_RELEASED
;
766 FIXME("not implemented %p\n", This
);
770 static HRESULT WINAPI
ITextRange_fnGetTypeInfo(ITextRange
*me
, UINT iTInfo
, LCID lcid
,
773 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
775 return CO_E_RELEASED
;
777 FIXME("not implemented %p\n", This
);
781 static HRESULT WINAPI
ITextRange_fnGetIDsOfNames(ITextRange
*me
, REFIID riid
, LPOLESTR
*rgszNames
,
782 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
784 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
786 return CO_E_RELEASED
;
788 FIXME("not implemented %p\n", This
);
792 static HRESULT WINAPI
ITextRange_fnInvoke(ITextRange
*me
, DISPID dispIdMember
, REFIID riid
,
793 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
794 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
,
797 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
799 return CO_E_RELEASED
;
801 FIXME("not implemented %p\n", This
);
805 static HRESULT WINAPI
ITextRange_fnGetText(ITextRange
*me
, BSTR
*pbstr
)
807 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
809 return CO_E_RELEASED
;
811 FIXME("not implemented %p\n", This
);
815 static HRESULT WINAPI
ITextRange_fnSetText(ITextRange
*me
, BSTR bstr
)
817 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
819 return CO_E_RELEASED
;
821 FIXME("not implemented %p\n", This
);
825 static HRESULT
range_GetChar(ME_TextEditor
*editor
, ME_Cursor
*cursor
, LONG
*pch
)
829 ME_GetTextW(editor
, wch
, 1, cursor
, 1, FALSE
, cursor
->pRun
->next
->type
== diTextEnd
);
835 static HRESULT WINAPI
ITextRange_fnGetChar(ITextRange
*me
, LONG
*pch
)
837 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
841 return CO_E_RELEASED
;
846 ME_CursorFromCharOfs(This
->reOle
->editor
, This
->start
, &cursor
);
847 return range_GetChar(This
->reOle
->editor
, &cursor
, pch
);
850 static HRESULT WINAPI
ITextRange_fnSetChar(ITextRange
*me
, LONG ch
)
852 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
854 return CO_E_RELEASED
;
856 FIXME("not implemented %p\n", This
);
860 static HRESULT
CreateITextRange(IRichEditOleImpl
*reOle
, LONG start
, LONG end
, ITextRange
** ppRange
);
862 static HRESULT WINAPI
ITextRange_fnGetDuplicate(ITextRange
*me
, ITextRange
**ppRange
)
864 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
866 return CO_E_RELEASED
;
868 TRACE("%p %p\n", This
, ppRange
);
872 return CreateITextRange(This
->reOle
, This
->start
, This
->end
, ppRange
);
875 static HRESULT WINAPI
ITextRange_fnGetFormattedText(ITextRange
*me
, ITextRange
**ppRange
)
877 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
879 return CO_E_RELEASED
;
881 FIXME("not implemented %p\n", This
);
885 static HRESULT WINAPI
ITextRange_fnSetFormattedText(ITextRange
*me
, ITextRange
*pRange
)
887 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
889 return CO_E_RELEASED
;
891 FIXME("not implemented %p\n", This
);
895 static HRESULT WINAPI
ITextRange_fnGetStart(ITextRange
*me
, LONG
*pcpFirst
)
897 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
899 return CO_E_RELEASED
;
903 *pcpFirst
= This
->start
;
904 TRACE("%d\n", *pcpFirst
);
908 static HRESULT WINAPI
ITextRange_fnSetStart(ITextRange
*me
, LONG start
)
910 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
913 TRACE("(%p)->(%d)\n", This
, start
);
916 return CO_E_RELEASED
;
918 if (start
== This
->start
)
926 len
= ME_GetTextLength(This
->reOle
->editor
);
927 if (start
> This
->end
)
938 static HRESULT WINAPI
ITextRange_fnGetEnd(ITextRange
*me
, LONG
*pcpLim
)
940 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
942 return CO_E_RELEASED
;
947 TRACE("%d\n", *pcpLim
);
951 static HRESULT WINAPI
ITextRange_fnSetEnd(ITextRange
*me
, LONG end
)
953 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
956 TRACE("(%p)->(%d)\n", This
, end
);
959 return CO_E_RELEASED
;
961 if (end
== This
->end
)
964 if (end
< This
->start
) {
965 This
->start
= This
->end
= max(0, end
);
969 len
= ME_GetTextLength(This
->reOle
->editor
);
978 static HRESULT WINAPI
ITextRange_fnGetFont(ITextRange
*me
, ITextFont
**font
)
980 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
982 TRACE("(%p)->(%p)\n", This
, font
);
985 return CO_E_RELEASED
;
990 return create_textfont(me
, font
);
993 static HRESULT WINAPI
ITextRange_fnSetFont(ITextRange
*me
, ITextFont
*pFont
)
995 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
997 return CO_E_RELEASED
;
999 FIXME("not implemented %p\n", This
);
1003 static HRESULT WINAPI
ITextRange_fnGetPara(ITextRange
*me
, ITextPara
**para
)
1005 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1007 TRACE("(%p)->(%p)\n", This
, para
);
1010 return CO_E_RELEASED
;
1013 return E_INVALIDARG
;
1015 return create_textpara(me
, para
);
1018 static HRESULT WINAPI
ITextRange_fnSetPara(ITextRange
*me
, ITextPara
*pPara
)
1020 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1022 return CO_E_RELEASED
;
1024 FIXME("not implemented %p\n", This
);
1028 static HRESULT WINAPI
ITextRange_fnGetStoryLength(ITextRange
*me
, LONG
*pcch
)
1030 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1032 return CO_E_RELEASED
;
1034 FIXME("not implemented %p\n", This
);
1038 static HRESULT WINAPI
ITextRange_fnGetStoryType(ITextRange
*me
, LONG
*pValue
)
1040 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1042 return CO_E_RELEASED
;
1044 FIXME("not implemented %p\n", This
);
1048 static HRESULT
range_Collapse(LONG bStart
, LONG
*start
, LONG
*end
)
1053 if (bStart
== tomEnd
|| bStart
== tomFalse
)
1060 static HRESULT WINAPI
ITextRange_fnCollapse(ITextRange
*me
, LONG bStart
)
1062 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1064 return CO_E_RELEASED
;
1066 return range_Collapse(bStart
, &This
->start
, &This
->end
);
1069 static HRESULT WINAPI
ITextRange_fnExpand(ITextRange
*me
, LONG Unit
, LONG
*pDelta
)
1071 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1073 return CO_E_RELEASED
;
1075 FIXME("not implemented %p\n", This
);
1079 static HRESULT WINAPI
ITextRange_fnGetIndex(ITextRange
*me
, LONG Unit
, LONG
*pIndex
)
1081 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1083 return CO_E_RELEASED
;
1085 FIXME("not implemented %p\n", This
);
1089 static HRESULT WINAPI
ITextRange_fnSetIndex(ITextRange
*me
, LONG Unit
, LONG Index
,
1092 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1094 return CO_E_RELEASED
;
1096 FIXME("not implemented %p\n", This
);
1100 static HRESULT WINAPI
ITextRange_fnSetRange(ITextRange
*me
, LONG cpActive
, LONG cpOther
)
1102 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1104 return CO_E_RELEASED
;
1106 FIXME("not implemented %p\n", This
);
1110 static HRESULT WINAPI
ITextRange_fnInRange(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1112 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1114 return CO_E_RELEASED
;
1116 FIXME("not implemented %p\n", This
);
1120 static HRESULT WINAPI
ITextRange_fnInStory(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1122 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1124 return CO_E_RELEASED
;
1126 FIXME("not implemented %p\n", This
);
1130 static HRESULT WINAPI
ITextRange_fnIsEqual(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1132 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1134 return CO_E_RELEASED
;
1136 FIXME("not implemented %p\n", This
);
1140 static HRESULT WINAPI
ITextRange_fnSelect(ITextRange
*me
)
1142 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1144 return CO_E_RELEASED
;
1146 FIXME("not implemented %p\n", This
);
1150 static HRESULT WINAPI
ITextRange_fnStartOf(ITextRange
*me
, LONG Unit
, LONG Extend
,
1153 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1155 return CO_E_RELEASED
;
1157 FIXME("not implemented %p\n", This
);
1161 static HRESULT WINAPI
ITextRange_fnEndOf(ITextRange
*me
, LONG Unit
, LONG Extend
,
1164 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1166 return CO_E_RELEASED
;
1168 FIXME("not implemented %p\n", This
);
1172 static HRESULT WINAPI
ITextRange_fnMove(ITextRange
*me
, LONG Unit
, LONG Count
, LONG
*pDelta
)
1174 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1176 return CO_E_RELEASED
;
1178 FIXME("not implemented %p\n", This
);
1182 static HRESULT WINAPI
ITextRange_fnMoveStart(ITextRange
*me
, LONG Unit
, LONG Count
,
1185 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1187 return CO_E_RELEASED
;
1189 FIXME("not implemented %p\n", This
);
1193 static HRESULT WINAPI
ITextRange_fnMoveEnd(ITextRange
*me
, LONG Unit
, LONG Count
,
1196 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1198 return CO_E_RELEASED
;
1200 FIXME("not implemented %p\n", This
);
1204 static HRESULT WINAPI
ITextRange_fnMoveWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1207 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1209 return CO_E_RELEASED
;
1211 FIXME("not implemented %p\n", This
);
1215 static HRESULT WINAPI
ITextRange_fnMoveStartWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1218 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1220 return CO_E_RELEASED
;
1222 FIXME("not implemented %p\n", This
);
1226 static HRESULT WINAPI
ITextRange_fnMoveEndWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1229 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1231 return CO_E_RELEASED
;
1233 FIXME("not implemented %p\n", This
);
1237 static HRESULT WINAPI
ITextRange_fnMoveUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1240 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1242 return CO_E_RELEASED
;
1244 FIXME("not implemented %p\n", This
);
1248 static HRESULT WINAPI
ITextRange_fnMoveStartUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1251 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1253 return CO_E_RELEASED
;
1255 FIXME("not implemented %p\n", This
);
1259 static HRESULT WINAPI
ITextRange_fnMoveEndUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1262 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1264 return CO_E_RELEASED
;
1266 FIXME("not implemented %p\n", This
);
1270 static HRESULT WINAPI
ITextRange_fnFindText(ITextRange
*me
, BSTR bstr
, LONG cch
, LONG Flags
,
1273 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1275 return CO_E_RELEASED
;
1277 FIXME("not implemented %p\n", This
);
1281 static HRESULT WINAPI
ITextRange_fnFindTextStart(ITextRange
*me
, BSTR bstr
, LONG cch
,
1282 LONG Flags
, LONG
*pLength
)
1284 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1286 return CO_E_RELEASED
;
1288 FIXME("not implemented %p\n", This
);
1292 static HRESULT WINAPI
ITextRange_fnFindTextEnd(ITextRange
*me
, BSTR bstr
, LONG cch
,
1293 LONG Flags
, LONG
*pLength
)
1295 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1297 return CO_E_RELEASED
;
1299 FIXME("not implemented %p\n", This
);
1303 static HRESULT WINAPI
ITextRange_fnDelete(ITextRange
*me
, LONG Unit
, LONG Count
,
1306 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1308 return CO_E_RELEASED
;
1310 FIXME("not implemented %p\n", This
);
1314 static HRESULT WINAPI
ITextRange_fnCut(ITextRange
*me
, VARIANT
*pVar
)
1316 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1318 return CO_E_RELEASED
;
1320 FIXME("not implemented %p\n", This
);
1324 static HRESULT WINAPI
ITextRange_fnCopy(ITextRange
*me
, VARIANT
*pVar
)
1326 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1328 return CO_E_RELEASED
;
1330 FIXME("not implemented %p\n", This
);
1334 static HRESULT WINAPI
ITextRange_fnPaste(ITextRange
*me
, VARIANT
*pVar
, LONG Format
)
1336 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1338 return CO_E_RELEASED
;
1340 FIXME("not implemented %p\n", This
);
1344 static HRESULT WINAPI
ITextRange_fnCanPaste(ITextRange
*me
, VARIANT
*pVar
, LONG Format
,
1347 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1349 return CO_E_RELEASED
;
1351 FIXME("not implemented %p\n", This
);
1355 static HRESULT WINAPI
ITextRange_fnCanEdit(ITextRange
*me
, LONG
*pb
)
1357 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1359 return CO_E_RELEASED
;
1361 FIXME("not implemented %p\n", This
);
1365 static HRESULT WINAPI
ITextRange_fnChangeCase(ITextRange
*me
, LONG Type
)
1367 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1369 return CO_E_RELEASED
;
1371 FIXME("not implemented %p\n", This
);
1375 static HRESULT WINAPI
ITextRange_fnGetPoint(ITextRange
*me
, LONG Type
, LONG
*cx
, LONG
*cy
)
1377 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1379 return CO_E_RELEASED
;
1381 FIXME("not implemented %p\n", This
);
1385 static HRESULT WINAPI
ITextRange_fnSetPoint(ITextRange
*me
, LONG x
, LONG y
, LONG Type
,
1388 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1390 return CO_E_RELEASED
;
1392 FIXME("not implemented %p\n", This
);
1396 static HRESULT WINAPI
ITextRange_fnScrollIntoView(ITextRange
*me
, LONG Value
)
1398 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1400 return CO_E_RELEASED
;
1402 FIXME("not implemented %p\n", This
);
1406 static HRESULT WINAPI
ITextRange_fnGetEmbeddedObject(ITextRange
*me
, IUnknown
**ppv
)
1408 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1410 return CO_E_RELEASED
;
1412 FIXME("not implemented %p\n", This
);
1416 static const ITextRangeVtbl trvt
= {
1417 ITextRange_fnQueryInterface
,
1418 ITextRange_fnAddRef
,
1419 ITextRange_fnRelease
,
1420 ITextRange_fnGetTypeInfoCount
,
1421 ITextRange_fnGetTypeInfo
,
1422 ITextRange_fnGetIDsOfNames
,
1423 ITextRange_fnInvoke
,
1424 ITextRange_fnGetText
,
1425 ITextRange_fnSetText
,
1426 ITextRange_fnGetChar
,
1427 ITextRange_fnSetChar
,
1428 ITextRange_fnGetDuplicate
,
1429 ITextRange_fnGetFormattedText
,
1430 ITextRange_fnSetFormattedText
,
1431 ITextRange_fnGetStart
,
1432 ITextRange_fnSetStart
,
1433 ITextRange_fnGetEnd
,
1434 ITextRange_fnSetEnd
,
1435 ITextRange_fnGetFont
,
1436 ITextRange_fnSetFont
,
1437 ITextRange_fnGetPara
,
1438 ITextRange_fnSetPara
,
1439 ITextRange_fnGetStoryLength
,
1440 ITextRange_fnGetStoryType
,
1441 ITextRange_fnCollapse
,
1442 ITextRange_fnExpand
,
1443 ITextRange_fnGetIndex
,
1444 ITextRange_fnSetIndex
,
1445 ITextRange_fnSetRange
,
1446 ITextRange_fnInRange
,
1447 ITextRange_fnInStory
,
1448 ITextRange_fnIsEqual
,
1449 ITextRange_fnSelect
,
1450 ITextRange_fnStartOf
,
1453 ITextRange_fnMoveStart
,
1454 ITextRange_fnMoveEnd
,
1455 ITextRange_fnMoveWhile
,
1456 ITextRange_fnMoveStartWhile
,
1457 ITextRange_fnMoveEndWhile
,
1458 ITextRange_fnMoveUntil
,
1459 ITextRange_fnMoveStartUntil
,
1460 ITextRange_fnMoveEndUntil
,
1461 ITextRange_fnFindText
,
1462 ITextRange_fnFindTextStart
,
1463 ITextRange_fnFindTextEnd
,
1464 ITextRange_fnDelete
,
1468 ITextRange_fnCanPaste
,
1469 ITextRange_fnCanEdit
,
1470 ITextRange_fnChangeCase
,
1471 ITextRange_fnGetPoint
,
1472 ITextRange_fnSetPoint
,
1473 ITextRange_fnScrollIntoView
,
1474 ITextRange_fnGetEmbeddedObject
1478 static HRESULT WINAPI
TextFont_QueryInterface(ITextFont
*iface
, REFIID riid
, void **ppv
)
1480 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1482 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
1484 if (IsEqualIID(riid
, &IID_ITextFont
) ||
1485 IsEqualIID(riid
, &IID_IDispatch
) ||
1486 IsEqualIID(riid
, &IID_IUnknown
))
1489 ITextFont_AddRef(iface
);
1494 return E_NOINTERFACE
;
1497 static ULONG WINAPI
TextFont_AddRef(ITextFont
*iface
)
1499 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1500 ULONG ref
= InterlockedIncrement(&This
->ref
);
1501 TRACE("(%p)->(%u)\n", This
, ref
);
1505 static ULONG WINAPI
TextFont_Release(ITextFont
*iface
)
1507 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1508 ULONG ref
= InterlockedDecrement(&This
->ref
);
1510 TRACE("(%p)->(%u)\n", This
, ref
);
1514 ITextRange_Release(This
->range
);
1521 static HRESULT WINAPI
TextFont_GetTypeInfoCount(ITextFont
*iface
, UINT
*pctinfo
)
1528 static HRESULT WINAPI
TextFont_GetTypeInfo(ITextFont
*iface
, UINT iTInfo
, LCID lcid
,
1529 ITypeInfo
**ppTInfo
)
1535 static HRESULT WINAPI
TextFont_GetIDsOfNames(ITextFont
*iface
, REFIID riid
,
1536 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1542 static HRESULT WINAPI
TextFont_Invoke(
1544 DISPID dispIdMember
,
1548 DISPPARAMS
*pDispParams
,
1549 VARIANT
*pVarResult
,
1550 EXCEPINFO
*pExcepInfo
,
1557 static HRESULT WINAPI
TextFont_GetDuplicate(ITextFont
*iface
, ITextFont
**ret
)
1559 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1560 FIXME("(%p)->(%p): stub\n", This
, ret
);
1564 static HRESULT WINAPI
TextFont_SetDuplicate(ITextFont
*iface
, ITextFont
*pFont
)
1566 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1567 FIXME("(%p)->(%p): stub\n", This
, pFont
);
1571 static HRESULT WINAPI
TextFont_CanChange(ITextFont
*iface
, LONG
*ret
)
1573 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1574 FIXME("(%p)->(%p): stub\n", This
, ret
);
1578 static HRESULT WINAPI
TextFont_IsEqual(ITextFont
*iface
, ITextFont
*font
, LONG
*ret
)
1580 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1581 FIXME("(%p)->(%p): stub\n", This
, ret
);
1585 static HRESULT WINAPI
TextFont_Reset(ITextFont
*iface
, LONG value
)
1587 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1588 FIXME("(%p): stub\n", This
);
1592 static HRESULT WINAPI
TextFont_GetStyle(ITextFont
*iface
, LONG
*value
)
1594 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1595 FIXME("(%p)->(%p): stub\n", This
, value
);
1599 static HRESULT WINAPI
TextFont_SetStyle(ITextFont
*iface
, LONG value
)
1601 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1602 FIXME("(%p)->(%d): stub\n", This
, value
);
1606 static HRESULT WINAPI
TextFont_GetAllCaps(ITextFont
*iface
, LONG
*value
)
1608 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1609 FIXME("(%p)->(%p): stub\n", This
, value
);
1613 static HRESULT WINAPI
TextFont_SetAllCaps(ITextFont
*iface
, LONG value
)
1615 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1616 FIXME("(%p)->(%d): stub\n", This
, value
);
1620 static HRESULT WINAPI
TextFont_GetAnimation(ITextFont
*iface
, LONG
*value
)
1622 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1623 FIXME("(%p)->(%p): stub\n", This
, value
);
1627 static HRESULT WINAPI
TextFont_SetAnimation(ITextFont
*iface
, LONG value
)
1629 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1630 FIXME("(%p)->(%d): stub\n", This
, value
);
1634 static HRESULT WINAPI
TextFont_GetBackColor(ITextFont
*iface
, LONG
*value
)
1636 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1637 FIXME("(%p)->(%p): stub\n", This
, value
);
1641 static HRESULT WINAPI
TextFont_SetBackColor(ITextFont
*iface
, LONG value
)
1643 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1644 FIXME("(%p)->(%d): stub\n", This
, value
);
1648 static HRESULT WINAPI
TextFont_GetBold(ITextFont
*iface
, LONG
*value
)
1650 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1651 FIXME("(%p)->(%p): stub\n", This
, value
);
1655 static HRESULT WINAPI
TextFont_SetBold(ITextFont
*iface
, LONG value
)
1657 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1658 FIXME("(%p)->(%d): stub\n", This
, value
);
1662 static HRESULT WINAPI
TextFont_GetEmboss(ITextFont
*iface
, LONG
*value
)
1664 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1665 FIXME("(%p)->(%p): stub\n", This
, value
);
1669 static HRESULT WINAPI
TextFont_SetEmboss(ITextFont
*iface
, LONG value
)
1671 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1672 FIXME("(%p)->(%d): stub\n", This
, value
);
1676 static HRESULT WINAPI
TextFont_GetForeColor(ITextFont
*iface
, LONG
*value
)
1678 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1679 FIXME("(%p)->(%p): stub\n", This
, value
);
1683 static HRESULT WINAPI
TextFont_SetForeColor(ITextFont
*iface
, LONG value
)
1685 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1686 FIXME("(%p)->(%d): stub\n", This
, value
);
1690 static HRESULT WINAPI
TextFont_GetHidden(ITextFont
*iface
, LONG
*value
)
1692 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1693 FIXME("(%p)->(%p): stub\n", This
, value
);
1697 static HRESULT WINAPI
TextFont_SetHidden(ITextFont
*iface
, LONG value
)
1699 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1700 FIXME("(%p)->(%d): stub\n", This
, value
);
1704 static HRESULT WINAPI
TextFont_GetEngrave(ITextFont
*iface
, LONG
*value
)
1706 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1707 FIXME("(%p)->(%p): stub\n", This
, value
);
1711 static HRESULT WINAPI
TextFont_SetEngrave(ITextFont
*iface
, LONG value
)
1713 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1714 FIXME("(%p)->(%d): stub\n", This
, value
);
1718 static HRESULT WINAPI
TextFont_GetItalic(ITextFont
*iface
, LONG
*value
)
1720 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1721 FIXME("(%p)->(%p): stub\n", This
, value
);
1725 static HRESULT WINAPI
TextFont_SetItalic(ITextFont
*iface
, LONG value
)
1727 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1728 FIXME("(%p)->(%d): stub\n", This
, value
);
1732 static HRESULT WINAPI
TextFont_GetKerning(ITextFont
*iface
, FLOAT
*value
)
1734 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1735 FIXME("(%p)->(%p): stub\n", This
, value
);
1739 static HRESULT WINAPI
TextFont_SetKerning(ITextFont
*iface
, FLOAT value
)
1741 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1742 FIXME("(%p)->(%.2f): stub\n", This
, value
);
1746 static HRESULT WINAPI
TextFont_GetLanguageID(ITextFont
*iface
, LONG
*value
)
1748 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1749 FIXME("(%p)->(%p): stub\n", This
, value
);
1753 static HRESULT WINAPI
TextFont_SetLanguageID(ITextFont
*iface
, LONG value
)
1755 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1756 FIXME("(%p)->(%d): stub\n", This
, value
);
1760 static HRESULT WINAPI
TextFont_GetName(ITextFont
*iface
, BSTR
*value
)
1762 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1763 FIXME("(%p)->(%p): stub\n", This
, value
);
1767 static HRESULT WINAPI
TextFont_SetName(ITextFont
*iface
, BSTR value
)
1769 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1770 FIXME("(%p)->(%s): stub\n", This
, debugstr_w(value
));
1774 static HRESULT WINAPI
TextFont_GetOutline(ITextFont
*iface
, LONG
*value
)
1776 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1777 FIXME("(%p)->(%p): stub\n", This
, value
);
1781 static HRESULT WINAPI
TextFont_SetOutline(ITextFont
*iface
, LONG value
)
1783 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1784 FIXME("(%p)->(%d): stub\n", This
, value
);
1788 static HRESULT WINAPI
TextFont_GetPosition(ITextFont
*iface
, FLOAT
*value
)
1790 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1791 FIXME("(%p)->(%p): stub\n", This
, value
);
1795 static HRESULT WINAPI
TextFont_SetPosition(ITextFont
*iface
, FLOAT value
)
1797 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1798 FIXME("(%p)->(%.2f): stub\n", This
, value
);
1802 static HRESULT WINAPI
TextFont_GetProtected(ITextFont
*iface
, LONG
*value
)
1804 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1805 FIXME("(%p)->(%p): stub\n", This
, value
);
1809 static HRESULT WINAPI
TextFont_SetProtected(ITextFont
*iface
, LONG value
)
1811 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1812 FIXME("(%p)->(%d): stub\n", This
, value
);
1816 static HRESULT WINAPI
TextFont_GetShadow(ITextFont
*iface
, LONG
*value
)
1818 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1819 FIXME("(%p)->(%p): stub\n", This
, value
);
1823 static HRESULT WINAPI
TextFont_SetShadow(ITextFont
*iface
, LONG value
)
1825 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1826 FIXME("(%p)->(%d): stub\n", This
, value
);
1830 static HRESULT WINAPI
TextFont_GetSize(ITextFont
*iface
, FLOAT
*value
)
1832 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1833 FIXME("(%p)->(%p): stub\n", This
, value
);
1837 static HRESULT WINAPI
TextFont_SetSize(ITextFont
*iface
, FLOAT value
)
1839 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1840 FIXME("(%p)->(%.2f): stub\n", This
, value
);
1844 static HRESULT WINAPI
TextFont_GetSmallCaps(ITextFont
*iface
, LONG
*value
)
1846 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1847 FIXME("(%p)->(%p): stub\n", This
, value
);
1851 static HRESULT WINAPI
TextFont_SetSmallCaps(ITextFont
*iface
, LONG value
)
1853 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1854 FIXME("(%p)->(%d): stub\n", This
, value
);
1858 static HRESULT WINAPI
TextFont_GetSpacing(ITextFont
*iface
, FLOAT
*value
)
1860 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1861 FIXME("(%p)->(%p): stub\n", This
, value
);
1865 static HRESULT WINAPI
TextFont_SetSpacing(ITextFont
*iface
, FLOAT value
)
1867 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1868 FIXME("(%p)->(%.2f): stub\n", This
, value
);
1872 static HRESULT WINAPI
TextFont_GetStrikeThrough(ITextFont
*iface
, LONG
*value
)
1874 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1875 FIXME("(%p)->(%p): stub\n", This
, value
);
1879 static HRESULT WINAPI
TextFont_SetStrikeThrough(ITextFont
*iface
, LONG value
)
1881 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1882 FIXME("(%p)->(%d): stub\n", This
, value
);
1886 static HRESULT WINAPI
TextFont_GetSubscript(ITextFont
*iface
, LONG
*value
)
1888 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1889 FIXME("(%p)->(%p): stub\n", This
, value
);
1893 static HRESULT WINAPI
TextFont_SetSubscript(ITextFont
*iface
, LONG value
)
1895 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1896 FIXME("(%p)->(%d): stub\n", This
, value
);
1900 static HRESULT WINAPI
TextFont_GetSuperscript(ITextFont
*iface
, LONG
*value
)
1902 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1903 FIXME("(%p)->(%p): stub\n", This
, value
);
1907 static HRESULT WINAPI
TextFont_SetSuperscript(ITextFont
*iface
, LONG value
)
1909 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1910 FIXME("(%p)->(%d): stub\n", This
, value
);
1914 static HRESULT WINAPI
TextFont_GetUnderline(ITextFont
*iface
, LONG
*value
)
1916 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1917 FIXME("(%p)->(%p): stub\n", This
, value
);
1921 static HRESULT WINAPI
TextFont_SetUnderline(ITextFont
*iface
, LONG value
)
1923 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1924 FIXME("(%p)->(%d): stub\n", This
, value
);
1928 static HRESULT WINAPI
TextFont_GetWeight(ITextFont
*iface
, LONG
*value
)
1930 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1931 FIXME("(%p)->(%p): stub\n", This
, value
);
1935 static HRESULT WINAPI
TextFont_SetWeight(ITextFont
*iface
, LONG value
)
1937 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1938 FIXME("(%p)->(%d): stub\n", This
, value
);
1942 static ITextFontVtbl textfontvtbl
= {
1943 TextFont_QueryInterface
,
1946 TextFont_GetTypeInfoCount
,
1947 TextFont_GetTypeInfo
,
1948 TextFont_GetIDsOfNames
,
1950 TextFont_GetDuplicate
,
1951 TextFont_SetDuplicate
,
1957 TextFont_GetAllCaps
,
1958 TextFont_SetAllCaps
,
1959 TextFont_GetAnimation
,
1960 TextFont_SetAnimation
,
1961 TextFont_GetBackColor
,
1962 TextFont_SetBackColor
,
1967 TextFont_GetForeColor
,
1968 TextFont_SetForeColor
,
1971 TextFont_GetEngrave
,
1972 TextFont_SetEngrave
,
1975 TextFont_GetKerning
,
1976 TextFont_SetKerning
,
1977 TextFont_GetLanguageID
,
1978 TextFont_SetLanguageID
,
1981 TextFont_GetOutline
,
1982 TextFont_SetOutline
,
1983 TextFont_GetPosition
,
1984 TextFont_SetPosition
,
1985 TextFont_GetProtected
,
1986 TextFont_SetProtected
,
1991 TextFont_GetSmallCaps
,
1992 TextFont_SetSmallCaps
,
1993 TextFont_GetSpacing
,
1994 TextFont_SetSpacing
,
1995 TextFont_GetStrikeThrough
,
1996 TextFont_SetStrikeThrough
,
1997 TextFont_GetSubscript
,
1998 TextFont_SetSubscript
,
1999 TextFont_GetSuperscript
,
2000 TextFont_SetSuperscript
,
2001 TextFont_GetUnderline
,
2002 TextFont_SetUnderline
,
2007 static HRESULT
create_textfont(ITextRange
*range
, ITextFont
**ret
)
2009 ITextFontImpl
*font
;
2012 font
= heap_alloc(sizeof(*font
));
2014 return E_OUTOFMEMORY
;
2016 font
->ITextFont_iface
.lpVtbl
= &textfontvtbl
;
2018 font
->range
= range
;
2019 ITextRange_AddRef(range
);
2021 *ret
= &font
->ITextFont_iface
;
2026 static HRESULT WINAPI
TextPara_QueryInterface(ITextPara
*iface
, REFIID riid
, void **ppv
)
2028 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2030 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
2032 if (IsEqualIID(riid
, &IID_ITextPara
) ||
2033 IsEqualIID(riid
, &IID_IDispatch
) ||
2034 IsEqualIID(riid
, &IID_IUnknown
))
2037 ITextPara_AddRef(iface
);
2042 return E_NOINTERFACE
;
2045 static ULONG WINAPI
TextPara_AddRef(ITextPara
*iface
)
2047 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2048 ULONG ref
= InterlockedIncrement(&This
->ref
);
2049 TRACE("(%p)->(%u)\n", This
, ref
);
2053 static ULONG WINAPI
TextPara_Release(ITextPara
*iface
)
2055 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2056 ULONG ref
= InterlockedDecrement(&This
->ref
);
2058 TRACE("(%p)->(%u)\n", This
, ref
);
2062 ITextRange_Release(This
->range
);
2069 static HRESULT WINAPI
TextPara_GetTypeInfoCount(ITextPara
*iface
, UINT
*pctinfo
)
2076 static HRESULT WINAPI
TextPara_GetTypeInfo(ITextPara
*iface
, UINT iTInfo
, LCID lcid
,
2077 ITypeInfo
**ppTInfo
)
2083 static HRESULT WINAPI
TextPara_GetIDsOfNames(ITextPara
*iface
, REFIID riid
,
2084 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2090 static HRESULT WINAPI
TextPara_Invoke(
2092 DISPID dispIdMember
,
2096 DISPPARAMS
*pDispParams
,
2097 VARIANT
*pVarResult
,
2098 EXCEPINFO
*pExcepInfo
,
2105 static HRESULT WINAPI
TextPara_GetDuplicate(ITextPara
*iface
, ITextPara
**ret
)
2107 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2108 FIXME("(%p)->(%p)\n", This
, ret
);
2112 static HRESULT WINAPI
TextPara_SetDuplicate(ITextPara
*iface
, ITextPara
*para
)
2114 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2115 FIXME("(%p)->(%p)\n", This
, para
);
2119 static HRESULT WINAPI
TextPara_CanChange(ITextPara
*iface
, LONG
*ret
)
2121 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2122 FIXME("(%p)->(%p)\n", This
, ret
);
2126 static HRESULT WINAPI
TextPara_IsEqual(ITextPara
*iface
, ITextPara
*para
, LONG
*ret
)
2128 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2129 FIXME("(%p)->(%p %p)\n", This
, para
, ret
);
2133 static HRESULT WINAPI
TextPara_Reset(ITextPara
*iface
, LONG value
)
2135 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2136 FIXME("(%p)->(%d)\n", This
, value
);
2140 static HRESULT WINAPI
TextPara_GetStyle(ITextPara
*iface
, LONG
*value
)
2142 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2143 FIXME("(%p)->(%p)\n", This
, value
);
2147 static HRESULT WINAPI
TextPara_SetStyle(ITextPara
*iface
, LONG value
)
2149 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2150 FIXME("(%p)->(%d)\n", This
, value
);
2154 static HRESULT WINAPI
TextPara_GetAlignment(ITextPara
*iface
, LONG
*value
)
2156 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2157 FIXME("(%p)->(%p)\n", This
, value
);
2161 static HRESULT WINAPI
TextPara_SetAlignment(ITextPara
*iface
, LONG value
)
2163 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2164 FIXME("(%p)->(%d)\n", This
, value
);
2168 static HRESULT WINAPI
TextPara_GetHyphenation(ITextPara
*iface
, LONG
*value
)
2170 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2171 FIXME("(%p)->(%p)\n", This
, value
);
2175 static HRESULT WINAPI
TextPara_SetHyphenation(ITextPara
*iface
, LONG value
)
2177 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2178 FIXME("(%p)->(%d)\n", This
, value
);
2182 static HRESULT WINAPI
TextPara_GetFirstLineIndent(ITextPara
*iface
, FLOAT
*value
)
2184 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2185 FIXME("(%p)->(%p)\n", This
, value
);
2189 static HRESULT WINAPI
TextPara_GetKeepTogether(ITextPara
*iface
, LONG
*value
)
2191 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2192 FIXME("(%p)->(%p)\n", This
, value
);
2196 static HRESULT WINAPI
TextPara_SetKeepTogether(ITextPara
*iface
, LONG value
)
2198 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2199 FIXME("(%p)->(%d)\n", This
, value
);
2203 static HRESULT WINAPI
TextPara_GetKeepWithNext(ITextPara
*iface
, LONG
*value
)
2205 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2206 FIXME("(%p)->(%p)\n", This
, value
);
2210 static HRESULT WINAPI
TextPara_SetKeepWithNext(ITextPara
*iface
, LONG value
)
2212 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2213 FIXME("(%p)->(%d)\n", This
, value
);
2217 static HRESULT WINAPI
TextPara_GetLeftIndent(ITextPara
*iface
, FLOAT
*value
)
2219 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2220 FIXME("(%p)->(%p)\n", This
, value
);
2224 static HRESULT WINAPI
TextPara_GetLineSpacing(ITextPara
*iface
, FLOAT
*value
)
2226 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2227 FIXME("(%p)->(%p)\n", This
, value
);
2231 static HRESULT WINAPI
TextPara_GetLineSpacingRule(ITextPara
*iface
, LONG
*value
)
2233 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2234 FIXME("(%p)->(%p)\n", This
, value
);
2238 static HRESULT WINAPI
TextPara_GetListAlignment(ITextPara
*iface
, LONG
*value
)
2240 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2241 FIXME("(%p)->(%p)\n", This
, value
);
2245 static HRESULT WINAPI
TextPara_SetListAlignment(ITextPara
*iface
, LONG value
)
2247 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2248 FIXME("(%p)->(%d)\n", This
, value
);
2252 static HRESULT WINAPI
TextPara_GetListLevelIndex(ITextPara
*iface
, LONG
*value
)
2254 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2255 FIXME("(%p)->(%p)\n", This
, value
);
2259 static HRESULT WINAPI
TextPara_SetListLevelIndex(ITextPara
*iface
, LONG value
)
2261 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2262 FIXME("(%p)->(%d)\n", This
, value
);
2266 static HRESULT WINAPI
TextPara_GetListStart(ITextPara
*iface
, LONG
*value
)
2268 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2269 FIXME("(%p)->(%p)\n", This
, value
);
2273 static HRESULT WINAPI
TextPara_SetListStart(ITextPara
*iface
, LONG value
)
2275 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2276 FIXME("(%p)->(%d)\n", This
, value
);
2280 static HRESULT WINAPI
TextPara_GetListTab(ITextPara
*iface
, FLOAT
*value
)
2282 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2283 FIXME("(%p)->(%p)\n", This
, value
);
2287 static HRESULT WINAPI
TextPara_SetListTab(ITextPara
*iface
, FLOAT value
)
2289 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2290 FIXME("(%p)->(%.2f)\n", This
, value
);
2294 static HRESULT WINAPI
TextPara_GetListType(ITextPara
*iface
, LONG
*value
)
2296 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2297 FIXME("(%p)->(%p)\n", This
, value
);
2301 static HRESULT WINAPI
TextPara_SetListType(ITextPara
*iface
, LONG value
)
2303 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2304 FIXME("(%p)->(%d)\n", This
, value
);
2308 static HRESULT WINAPI
TextPara_GetNoLineNumber(ITextPara
*iface
, LONG
*value
)
2310 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2311 FIXME("(%p)->(%p)\n", This
, value
);
2315 static HRESULT WINAPI
TextPara_SetNoLineNumber(ITextPara
*iface
, LONG value
)
2317 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2318 FIXME("(%p)->(%d)\n", This
, value
);
2322 static HRESULT WINAPI
TextPara_GetPageBreakBefore(ITextPara
*iface
, LONG
*value
)
2324 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2325 FIXME("(%p)->(%p)\n", This
, value
);
2329 static HRESULT WINAPI
TextPara_SetPageBreakBefore(ITextPara
*iface
, LONG value
)
2331 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2332 FIXME("(%p)->(%d)\n", This
, value
);
2336 static HRESULT WINAPI
TextPara_GetRightIndent(ITextPara
*iface
, FLOAT
*value
)
2338 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2339 FIXME("(%p)->(%p)\n", This
, value
);
2343 static HRESULT WINAPI
TextPara_SetRightIndent(ITextPara
*iface
, FLOAT value
)
2345 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2346 FIXME("(%p)->(%.2f)\n", This
, value
);
2350 static HRESULT WINAPI
TextPara_SetIndents(ITextPara
*iface
, FLOAT StartIndent
, FLOAT LeftIndent
, FLOAT RightIndent
)
2352 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2353 FIXME("(%p)->(%.2f %.2f %.2f)\n", This
, StartIndent
, LeftIndent
, RightIndent
);
2357 static HRESULT WINAPI
TextPara_SetLineSpacing(ITextPara
*iface
, LONG LineSpacingRule
, FLOAT LineSpacing
)
2359 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2360 FIXME("(%p)->(%d %.2f)\n", This
, LineSpacingRule
, LineSpacing
);
2364 static HRESULT WINAPI
TextPara_GetSpaceAfter(ITextPara
*iface
, FLOAT
*value
)
2366 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2367 FIXME("(%p)->(%p)\n", This
, value
);
2371 static HRESULT WINAPI
TextPara_SetSpaceAfter(ITextPara
*iface
, FLOAT value
)
2373 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2374 FIXME("(%p)->(%.2f)\n", This
, value
);
2378 static HRESULT WINAPI
TextPara_GetSpaceBefore(ITextPara
*iface
, FLOAT
*value
)
2380 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2381 FIXME("(%p)->(%p)\n", This
, value
);
2385 static HRESULT WINAPI
TextPara_SetSpaceBefore(ITextPara
*iface
, FLOAT value
)
2387 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2388 FIXME("(%p)->(%.2f)\n", This
, value
);
2392 static HRESULT WINAPI
TextPara_GetWidowControl(ITextPara
*iface
, LONG
*value
)
2394 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2395 FIXME("(%p)->(%p)\n", This
, value
);
2399 static HRESULT WINAPI
TextPara_SetWidowControl(ITextPara
*iface
, LONG value
)
2401 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2402 FIXME("(%p)->(%d)\n", This
, value
);
2406 static HRESULT WINAPI
TextPara_GetTabCount(ITextPara
*iface
, LONG
*value
)
2408 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2409 FIXME("(%p)->(%p)\n", This
, value
);
2413 static HRESULT WINAPI
TextPara_AddTab(ITextPara
*iface
, FLOAT tbPos
, LONG tbAlign
, LONG tbLeader
)
2415 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2416 FIXME("(%p)->(%.2f %d %d)\n", This
, tbPos
, tbAlign
, tbLeader
);
2420 static HRESULT WINAPI
TextPara_ClearAllTabs(ITextPara
*iface
)
2422 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2423 FIXME("(%p)\n", This
);
2427 static HRESULT WINAPI
TextPara_DeleteTab(ITextPara
*iface
, FLOAT pos
)
2429 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2430 FIXME("(%p)->(%.2f)\n", This
, pos
);
2434 static HRESULT WINAPI
TextPara_GetTab(ITextPara
*iface
, LONG iTab
, FLOAT
*ptbPos
, LONG
*ptbAlign
, LONG
*ptbLeader
)
2436 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2437 FIXME("(%p)->(%d %p %p %p)\n", This
, iTab
, ptbPos
, ptbAlign
, ptbLeader
);
2441 static ITextParaVtbl textparavtbl
= {
2442 TextPara_QueryInterface
,
2445 TextPara_GetTypeInfoCount
,
2446 TextPara_GetTypeInfo
,
2447 TextPara_GetIDsOfNames
,
2449 TextPara_GetDuplicate
,
2450 TextPara_SetDuplicate
,
2456 TextPara_GetAlignment
,
2457 TextPara_SetAlignment
,
2458 TextPara_GetHyphenation
,
2459 TextPara_SetHyphenation
,
2460 TextPara_GetFirstLineIndent
,
2461 TextPara_GetKeepTogether
,
2462 TextPara_SetKeepTogether
,
2463 TextPara_GetKeepWithNext
,
2464 TextPara_SetKeepWithNext
,
2465 TextPara_GetLeftIndent
,
2466 TextPara_GetLineSpacing
,
2467 TextPara_GetLineSpacingRule
,
2468 TextPara_GetListAlignment
,
2469 TextPara_SetListAlignment
,
2470 TextPara_GetListLevelIndex
,
2471 TextPara_SetListLevelIndex
,
2472 TextPara_GetListStart
,
2473 TextPara_SetListStart
,
2474 TextPara_GetListTab
,
2475 TextPara_SetListTab
,
2476 TextPara_GetListType
,
2477 TextPara_SetListType
,
2478 TextPara_GetNoLineNumber
,
2479 TextPara_SetNoLineNumber
,
2480 TextPara_GetPageBreakBefore
,
2481 TextPara_SetPageBreakBefore
,
2482 TextPara_GetRightIndent
,
2483 TextPara_SetRightIndent
,
2484 TextPara_SetIndents
,
2485 TextPara_SetLineSpacing
,
2486 TextPara_GetSpaceAfter
,
2487 TextPara_SetSpaceAfter
,
2488 TextPara_GetSpaceBefore
,
2489 TextPara_SetSpaceBefore
,
2490 TextPara_GetWidowControl
,
2491 TextPara_SetWidowControl
,
2492 TextPara_GetTabCount
,
2494 TextPara_ClearAllTabs
,
2499 static HRESULT
create_textpara(ITextRange
*range
, ITextPara
**ret
)
2501 ITextParaImpl
*para
;
2504 para
= heap_alloc(sizeof(*para
));
2506 return E_OUTOFMEMORY
;
2508 para
->ITextPara_iface
.lpVtbl
= &textparavtbl
;
2510 para
->range
= range
;
2511 ITextRange_AddRef(range
);
2513 *ret
= ¶
->ITextPara_iface
;
2518 static HRESULT WINAPI
2519 ITextDocument_fnQueryInterface(ITextDocument
* me
, REFIID riid
,
2522 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2523 return IRichEditOle_QueryInterface(&This
->IRichEditOle_iface
, riid
, ppvObject
);
2527 ITextDocument_fnAddRef(ITextDocument
* me
)
2529 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2530 return IRichEditOle_AddRef(&This
->IRichEditOle_iface
);
2534 ITextDocument_fnRelease(ITextDocument
* me
)
2536 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2537 return IRichEditOle_Release(&This
->IRichEditOle_iface
);
2540 static HRESULT WINAPI
2541 ITextDocument_fnGetTypeInfoCount(ITextDocument
* me
,
2544 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2545 FIXME("stub %p\n",This
);
2549 static HRESULT WINAPI
2550 ITextDocument_fnGetTypeInfo(ITextDocument
* me
, UINT iTInfo
, LCID lcid
,
2551 ITypeInfo
** ppTInfo
)
2553 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2554 FIXME("stub %p\n",This
);
2558 static HRESULT WINAPI
2559 ITextDocument_fnGetIDsOfNames(ITextDocument
* me
, REFIID riid
,
2560 LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
)
2562 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2563 FIXME("stub %p\n",This
);
2567 static HRESULT WINAPI
2568 ITextDocument_fnInvoke(ITextDocument
* me
, DISPID dispIdMember
,
2569 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
,
2570 VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
)
2572 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2573 FIXME("stub %p\n",This
);
2577 static HRESULT WINAPI
2578 ITextDocument_fnGetName(ITextDocument
* me
, BSTR
* pName
)
2580 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2581 FIXME("stub %p\n",This
);
2585 static HRESULT WINAPI
2586 ITextDocument_fnGetSelection(ITextDocument
* me
, ITextSelection
** ppSel
)
2588 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2589 TRACE("(%p)\n", me
);
2592 return E_INVALIDARG
;
2593 *ppSel
= &This
->txtSel
->ITextSelection_iface
;
2594 ITextSelection_AddRef(*ppSel
);
2598 static HRESULT WINAPI
2599 ITextDocument_fnGetStoryCount(ITextDocument
* me
, LONG
* pCount
)
2601 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2602 FIXME("stub %p\n",This
);
2606 static HRESULT WINAPI
2607 ITextDocument_fnGetStoryRanges(ITextDocument
* me
,
2608 ITextStoryRanges
** ppStories
)
2610 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2611 FIXME("stub %p\n",This
);
2615 static HRESULT WINAPI
2616 ITextDocument_fnGetSaved(ITextDocument
* me
, LONG
* pValue
)
2618 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2619 FIXME("stub %p\n",This
);
2623 static HRESULT WINAPI
2624 ITextDocument_fnSetSaved(ITextDocument
* me
, LONG Value
)
2626 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2627 FIXME("stub %p\n",This
);
2631 static HRESULT WINAPI
2632 ITextDocument_fnGetDefaultTabStop(ITextDocument
* me
, float* pValue
)
2634 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2635 FIXME("stub %p\n",This
);
2639 static HRESULT WINAPI
2640 ITextDocument_fnSetDefaultTabStop(ITextDocument
* me
, float Value
)
2642 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2643 FIXME("stub %p\n",This
);
2647 static HRESULT WINAPI
2648 ITextDocument_fnNew(ITextDocument
* me
)
2650 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2651 FIXME("stub %p\n",This
);
2655 static HRESULT WINAPI
2656 ITextDocument_fnOpen(ITextDocument
* me
, VARIANT
* pVar
, LONG Flags
,
2659 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2660 FIXME("stub %p\n",This
);
2664 static HRESULT WINAPI
2665 ITextDocument_fnSave(ITextDocument
* me
, VARIANT
* pVar
, LONG Flags
,
2668 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2669 FIXME("stub %p\n",This
);
2673 static HRESULT WINAPI
2674 ITextDocument_fnFreeze(ITextDocument
* me
, LONG
* pCount
)
2676 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2677 FIXME("stub %p\n",This
);
2681 static HRESULT WINAPI
2682 ITextDocument_fnUnfreeze(ITextDocument
* me
, LONG
* pCount
)
2684 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2685 FIXME("stub %p\n",This
);
2689 static HRESULT WINAPI
2690 ITextDocument_fnBeginEditCollection(ITextDocument
* me
)
2692 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2693 FIXME("stub %p\n",This
);
2697 static HRESULT WINAPI
2698 ITextDocument_fnEndEditCollection(ITextDocument
* me
)
2700 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2701 FIXME("stub %p\n",This
);
2705 static HRESULT WINAPI
2706 ITextDocument_fnUndo(ITextDocument
* me
, LONG Count
, LONG
* prop
)
2708 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2709 FIXME("stub %p\n",This
);
2713 static HRESULT WINAPI
2714 ITextDocument_fnRedo(ITextDocument
* me
, LONG Count
, LONG
* prop
)
2716 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2717 FIXME("stub %p\n",This
);
2721 static HRESULT
CreateITextRange(IRichEditOleImpl
*reOle
, LONG start
, LONG end
, ITextRange
** ppRange
)
2723 ITextRangeImpl
*txtRge
= heap_alloc(sizeof(ITextRangeImpl
));
2726 return E_OUTOFMEMORY
;
2727 txtRge
->ITextRange_iface
.lpVtbl
= &trvt
;
2729 txtRge
->reOle
= reOle
;
2730 txtRge
->start
= start
;
2732 list_add_head(&reOle
->rangelist
, &txtRge
->entry
);
2733 *ppRange
= &txtRge
->ITextRange_iface
;
2737 static HRESULT WINAPI
2738 ITextDocument_fnRange(ITextDocument
* me
, LONG cp1
, LONG cp2
,
2739 ITextRange
** ppRange
)
2741 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2742 const int len
= ME_GetTextLength(This
->editor
) + 1;
2744 TRACE("%p %p %d %d\n", This
, ppRange
, cp1
, cp2
);
2746 return E_INVALIDARG
;
2750 cp1
= min(cp1
, len
);
2751 cp2
= min(cp2
, len
);
2760 cp1
= cp2
= len
- 1;
2762 return CreateITextRange(This
, cp1
, cp2
, ppRange
);
2765 static HRESULT WINAPI
2766 ITextDocument_fnRangeFromPoint(ITextDocument
* me
, LONG x
, LONG y
,
2767 ITextRange
** ppRange
)
2769 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2770 FIXME("stub %p\n",This
);
2774 static const ITextDocumentVtbl tdvt
= {
2775 ITextDocument_fnQueryInterface
,
2776 ITextDocument_fnAddRef
,
2777 ITextDocument_fnRelease
,
2778 ITextDocument_fnGetTypeInfoCount
,
2779 ITextDocument_fnGetTypeInfo
,
2780 ITextDocument_fnGetIDsOfNames
,
2781 ITextDocument_fnInvoke
,
2782 ITextDocument_fnGetName
,
2783 ITextDocument_fnGetSelection
,
2784 ITextDocument_fnGetStoryCount
,
2785 ITextDocument_fnGetStoryRanges
,
2786 ITextDocument_fnGetSaved
,
2787 ITextDocument_fnSetSaved
,
2788 ITextDocument_fnGetDefaultTabStop
,
2789 ITextDocument_fnSetDefaultTabStop
,
2790 ITextDocument_fnNew
,
2791 ITextDocument_fnOpen
,
2792 ITextDocument_fnSave
,
2793 ITextDocument_fnFreeze
,
2794 ITextDocument_fnUnfreeze
,
2795 ITextDocument_fnBeginEditCollection
,
2796 ITextDocument_fnEndEditCollection
,
2797 ITextDocument_fnUndo
,
2798 ITextDocument_fnRedo
,
2799 ITextDocument_fnRange
,
2800 ITextDocument_fnRangeFromPoint
2803 /* ITextSelection */
2804 static HRESULT WINAPI
ITextSelection_fnQueryInterface(
2810 if (IsEqualGUID(riid
, &IID_IUnknown
)
2811 || IsEqualGUID(riid
, &IID_IDispatch
)
2812 || IsEqualGUID(riid
, &IID_ITextRange
)
2813 || IsEqualGUID(riid
, &IID_ITextSelection
))
2816 ITextSelection_AddRef(me
);
2820 return E_NOINTERFACE
;
2823 static ULONG WINAPI
ITextSelection_fnAddRef(ITextSelection
*me
)
2825 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2826 return InterlockedIncrement(&This
->ref
);
2829 static ULONG WINAPI
ITextSelection_fnRelease(ITextSelection
*me
)
2831 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2832 ULONG ref
= InterlockedDecrement(&This
->ref
);
2838 static HRESULT WINAPI
ITextSelection_fnGetTypeInfoCount(ITextSelection
*me
, UINT
*pctinfo
)
2840 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2842 return CO_E_RELEASED
;
2844 FIXME("not implemented\n");
2848 static HRESULT WINAPI
ITextSelection_fnGetTypeInfo(ITextSelection
*me
, UINT iTInfo
, LCID lcid
,
2849 ITypeInfo
**ppTInfo
)
2851 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2853 return CO_E_RELEASED
;
2855 FIXME("not implemented\n");
2859 static HRESULT WINAPI
ITextSelection_fnGetIDsOfNames(ITextSelection
*me
, REFIID riid
,
2860 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2862 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2864 return CO_E_RELEASED
;
2866 FIXME("not implemented\n");
2870 static HRESULT WINAPI
ITextSelection_fnInvoke(
2872 DISPID dispIdMember
,
2876 DISPPARAMS
*pDispParams
,
2877 VARIANT
*pVarResult
,
2878 EXCEPINFO
*pExcepInfo
,
2881 FIXME("not implemented\n");
2885 /*** ITextRange methods ***/
2886 static HRESULT WINAPI
ITextSelection_fnGetText(ITextSelection
*me
, BSTR
*pbstr
)
2888 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2889 ME_Cursor
*start
= NULL
, *end
= NULL
;
2894 return CO_E_RELEASED
;
2895 TRACE("%p\n", pbstr
);
2897 return E_INVALIDARG
;
2899 ME_GetSelection(This
->reOle
->editor
, &start
, &end
);
2900 endOfs
= ME_GetCursorOfs(end
);
2901 nChars
= endOfs
- ME_GetCursorOfs(start
);
2908 *pbstr
= SysAllocStringLen(NULL
, nChars
);
2910 return E_OUTOFMEMORY
;
2912 bEOP
= (end
->pRun
->next
->type
== diTextEnd
&& endOfs
> ME_GetTextLength(This
->reOle
->editor
));
2913 ME_GetTextW(This
->reOle
->editor
, *pbstr
, nChars
, start
, nChars
, FALSE
, bEOP
);
2914 TRACE("%s\n", wine_dbgstr_w(*pbstr
));
2919 static HRESULT WINAPI
ITextSelection_fnSetText(ITextSelection
*me
, BSTR bstr
)
2921 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2923 return CO_E_RELEASED
;
2925 FIXME("not implemented\n");
2929 static HRESULT WINAPI
ITextSelection_fnGetChar(ITextSelection
*me
, LONG
*pch
)
2931 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2932 ME_Cursor
*start
= NULL
, *end
= NULL
;
2935 return CO_E_RELEASED
;
2938 return E_INVALIDARG
;
2940 ME_GetSelection(This
->reOle
->editor
, &start
, &end
);
2941 return range_GetChar(This
->reOle
->editor
, start
, pch
);
2944 static HRESULT WINAPI
ITextSelection_fnSetChar(ITextSelection
*me
, LONG ch
)
2946 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2948 return CO_E_RELEASED
;
2950 FIXME("not implemented\n");
2954 static HRESULT WINAPI
ITextSelection_fnGetDuplicate(ITextSelection
*me
, ITextRange
**ppRange
)
2956 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2958 return CO_E_RELEASED
;
2960 FIXME("not implemented\n");
2964 static HRESULT WINAPI
ITextSelection_fnGetFormattedText(ITextSelection
*me
, ITextRange
**ppRange
)
2966 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2968 return CO_E_RELEASED
;
2970 FIXME("not implemented\n");
2974 static HRESULT WINAPI
ITextSelection_fnSetFormattedText(ITextSelection
*me
, ITextRange
*pRange
)
2976 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2978 return CO_E_RELEASED
;
2980 FIXME("not implemented\n");
2984 static HRESULT WINAPI
ITextSelection_fnGetStart(ITextSelection
*me
, LONG
*pcpFirst
)
2986 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2989 return CO_E_RELEASED
;
2992 return E_INVALIDARG
;
2993 ME_GetSelectionOfs(This
->reOle
->editor
, pcpFirst
, &lim
);
2994 TRACE("%d\n", *pcpFirst
);
2998 static HRESULT WINAPI
ITextSelection_fnSetStart(ITextSelection
*me
, LONG cpFirst
)
3000 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3002 return CO_E_RELEASED
;
3004 FIXME("not implemented\n");
3008 static HRESULT WINAPI
ITextSelection_fnGetEnd(ITextSelection
*me
, LONG
*pcpLim
)
3010 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3013 return CO_E_RELEASED
;
3016 return E_INVALIDARG
;
3017 ME_GetSelectionOfs(This
->reOle
->editor
, &first
, pcpLim
);
3018 TRACE("%d\n", *pcpLim
);
3022 static HRESULT WINAPI
ITextSelection_fnSetEnd(ITextSelection
*me
, LONG cpLim
)
3024 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3026 return CO_E_RELEASED
;
3028 FIXME("not implemented\n");
3032 static HRESULT WINAPI
ITextSelection_fnGetFont(ITextSelection
*me
, ITextFont
**pFont
)
3034 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3036 return CO_E_RELEASED
;
3038 FIXME("not implemented\n");
3042 static HRESULT WINAPI
ITextSelection_fnSetFont(ITextSelection
*me
, ITextFont
*pFont
)
3044 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3046 return CO_E_RELEASED
;
3048 FIXME("not implemented\n");
3052 static HRESULT WINAPI
ITextSelection_fnGetPara(ITextSelection
*me
, ITextPara
**para
)
3054 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3056 return CO_E_RELEASED
;
3058 FIXME("not implemented\n");
3062 static HRESULT WINAPI
ITextSelection_fnSetPara(ITextSelection
*me
, ITextPara
*pPara
)
3064 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3066 return CO_E_RELEASED
;
3068 FIXME("not implemented\n");
3072 static HRESULT WINAPI
ITextSelection_fnGetStoryLength(ITextSelection
*me
, LONG
*pcch
)
3074 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3076 return CO_E_RELEASED
;
3078 FIXME("not implemented\n");
3082 static HRESULT WINAPI
ITextSelection_fnGetStoryType(ITextSelection
*me
, LONG
*pValue
)
3084 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3086 return CO_E_RELEASED
;
3088 FIXME("not implemented\n");
3092 static HRESULT WINAPI
ITextSelection_fnCollapse(ITextSelection
*me
, LONG bStart
)
3094 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3098 return CO_E_RELEASED
;
3100 ME_GetSelectionOfs(This
->reOle
->editor
, &start
, &end
);
3101 hres
= range_Collapse(bStart
, &start
, &end
);
3102 if (SUCCEEDED(hres
))
3103 ME_SetSelection(This
->reOle
->editor
, start
, end
);
3107 static HRESULT WINAPI
ITextSelection_fnExpand(ITextSelection
*me
, LONG Unit
, LONG
*pDelta
)
3109 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3111 return CO_E_RELEASED
;
3113 FIXME("not implemented\n");
3117 static HRESULT WINAPI
ITextSelection_fnGetIndex(ITextSelection
*me
, LONG Unit
, LONG
*pIndex
)
3119 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3121 return CO_E_RELEASED
;
3123 FIXME("not implemented\n");
3127 static HRESULT WINAPI
ITextSelection_fnSetIndex(ITextSelection
*me
, LONG Unit
, LONG Index
,
3130 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3132 return CO_E_RELEASED
;
3134 FIXME("not implemented\n");
3138 static HRESULT WINAPI
ITextSelection_fnSetRange(ITextSelection
*me
, LONG cpActive
, LONG cpOther
)
3140 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3142 return CO_E_RELEASED
;
3144 FIXME("not implemented\n");
3148 static HRESULT WINAPI
ITextSelection_fnInRange(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3150 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3152 return CO_E_RELEASED
;
3154 FIXME("not implemented\n");
3158 static HRESULT WINAPI
ITextSelection_fnInStory(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3160 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3162 return CO_E_RELEASED
;
3164 FIXME("not implemented\n");
3168 static HRESULT WINAPI
ITextSelection_fnIsEqual(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3170 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3172 return CO_E_RELEASED
;
3174 FIXME("not implemented\n");
3178 static HRESULT WINAPI
ITextSelection_fnSelect(ITextSelection
*me
)
3180 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3182 return CO_E_RELEASED
;
3184 FIXME("not implemented\n");
3188 static HRESULT WINAPI
ITextSelection_fnStartOf(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3191 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3193 return CO_E_RELEASED
;
3195 FIXME("not implemented\n");
3199 static HRESULT WINAPI
ITextSelection_fnEndOf(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3202 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3204 return CO_E_RELEASED
;
3206 FIXME("not implemented\n");
3210 static HRESULT WINAPI
ITextSelection_fnMove(ITextSelection
*me
, LONG Unit
, LONG Count
, LONG
*pDelta
)
3212 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3214 return CO_E_RELEASED
;
3216 FIXME("not implemented\n");
3220 static HRESULT WINAPI
ITextSelection_fnMoveStart(ITextSelection
*me
, LONG Unit
, LONG Count
,
3223 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3225 return CO_E_RELEASED
;
3227 FIXME("not implemented\n");
3231 static HRESULT WINAPI
ITextSelection_fnMoveEnd(ITextSelection
*me
, LONG Unit
, LONG Count
,
3234 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3236 return CO_E_RELEASED
;
3238 FIXME("not implemented\n");
3242 static HRESULT WINAPI
ITextSelection_fnMoveWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3245 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3247 return CO_E_RELEASED
;
3249 FIXME("not implemented\n");
3253 static HRESULT WINAPI
ITextSelection_fnMoveStartWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3256 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3258 return CO_E_RELEASED
;
3260 FIXME("not implemented\n");
3264 static HRESULT WINAPI
ITextSelection_fnMoveEndWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3267 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3269 return CO_E_RELEASED
;
3271 FIXME("not implemented\n");
3275 static HRESULT WINAPI
ITextSelection_fnMoveUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3278 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3280 return CO_E_RELEASED
;
3282 FIXME("not implemented\n");
3286 static HRESULT WINAPI
ITextSelection_fnMoveStartUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3289 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3291 return CO_E_RELEASED
;
3293 FIXME("not implemented\n");
3297 static HRESULT WINAPI
ITextSelection_fnMoveEndUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3300 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3302 return CO_E_RELEASED
;
3304 FIXME("not implemented\n");
3308 static HRESULT WINAPI
ITextSelection_fnFindText(ITextSelection
*me
, BSTR bstr
, LONG cch
, LONG Flags
,
3311 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3313 return CO_E_RELEASED
;
3315 FIXME("not implemented\n");
3319 static HRESULT WINAPI
ITextSelection_fnFindTextStart(ITextSelection
*me
, BSTR bstr
, LONG cch
,
3320 LONG Flags
, LONG
*pLength
)
3322 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3324 return CO_E_RELEASED
;
3326 FIXME("not implemented\n");
3330 static HRESULT WINAPI
ITextSelection_fnFindTextEnd(ITextSelection
*me
, BSTR bstr
, LONG cch
,
3331 LONG Flags
, LONG
*pLength
)
3333 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3335 return CO_E_RELEASED
;
3337 FIXME("not implemented\n");
3341 static HRESULT WINAPI
ITextSelection_fnDelete(ITextSelection
*me
, LONG Unit
, LONG Count
,
3344 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3346 return CO_E_RELEASED
;
3348 FIXME("not implemented\n");
3352 static HRESULT WINAPI
ITextSelection_fnCut(ITextSelection
*me
, VARIANT
*pVar
)
3354 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3356 return CO_E_RELEASED
;
3358 FIXME("not implemented\n");
3362 static HRESULT WINAPI
ITextSelection_fnCopy(ITextSelection
*me
, VARIANT
*pVar
)
3364 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3366 return CO_E_RELEASED
;
3368 FIXME("not implemented\n");
3372 static HRESULT WINAPI
ITextSelection_fnPaste(ITextSelection
*me
, VARIANT
*pVar
, LONG Format
)
3374 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3376 return CO_E_RELEASED
;
3378 FIXME("not implemented\n");
3382 static HRESULT WINAPI
ITextSelection_fnCanPaste(ITextSelection
*me
, VARIANT
*pVar
, LONG Format
,
3385 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3387 return CO_E_RELEASED
;
3389 FIXME("not implemented\n");
3393 static HRESULT WINAPI
ITextSelection_fnCanEdit(ITextSelection
*me
, LONG
*pb
)
3395 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3397 return CO_E_RELEASED
;
3399 FIXME("not implemented\n");
3403 static HRESULT WINAPI
ITextSelection_fnChangeCase(ITextSelection
*me
, LONG Type
)
3405 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3407 return CO_E_RELEASED
;
3409 FIXME("not implemented\n");
3413 static HRESULT WINAPI
ITextSelection_fnGetPoint(ITextSelection
*me
, LONG Type
, LONG
*cx
, LONG
*cy
)
3415 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3417 return CO_E_RELEASED
;
3419 FIXME("not implemented\n");
3423 static HRESULT WINAPI
ITextSelection_fnSetPoint(ITextSelection
*me
, LONG x
, LONG y
, LONG Type
,
3426 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3428 return CO_E_RELEASED
;
3430 FIXME("not implemented\n");
3434 static HRESULT WINAPI
ITextSelection_fnScrollIntoView(ITextSelection
*me
, LONG Value
)
3436 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3438 return CO_E_RELEASED
;
3440 FIXME("not implemented\n");
3444 static HRESULT WINAPI
ITextSelection_fnGetEmbeddedObject(ITextSelection
*me
, IUnknown
**ppv
)
3446 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3448 return CO_E_RELEASED
;
3450 FIXME("not implemented\n");
3454 /*** ITextSelection methods ***/
3455 static HRESULT WINAPI
ITextSelection_fnGetFlags(ITextSelection
*me
, LONG
*pFlags
)
3457 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3459 return CO_E_RELEASED
;
3461 FIXME("not implemented\n");
3465 static HRESULT WINAPI
ITextSelection_fnSetFlags(ITextSelection
*me
, LONG Flags
)
3467 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3469 return CO_E_RELEASED
;
3471 FIXME("not implemented\n");
3475 static HRESULT WINAPI
ITextSelection_fnGetType(ITextSelection
*me
, LONG
*pType
)
3477 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3479 return CO_E_RELEASED
;
3481 FIXME("not implemented\n");
3485 static HRESULT WINAPI
ITextSelection_fnMoveLeft(ITextSelection
*me
, LONG Unit
, LONG Count
,
3486 LONG Extend
, LONG
*pDelta
)
3488 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3490 return CO_E_RELEASED
;
3492 FIXME("not implemented\n");
3496 static HRESULT WINAPI
ITextSelection_fnMoveRight(ITextSelection
*me
, LONG Unit
, LONG Count
,
3497 LONG Extend
, LONG
*pDelta
)
3499 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3501 return CO_E_RELEASED
;
3503 FIXME("not implemented\n");
3507 static HRESULT WINAPI
ITextSelection_fnMoveUp(ITextSelection
*me
, LONG Unit
, LONG Count
,
3508 LONG Extend
, LONG
*pDelta
)
3510 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3512 return CO_E_RELEASED
;
3514 FIXME("not implemented\n");
3518 static HRESULT WINAPI
ITextSelection_fnMoveDown(ITextSelection
*me
, LONG Unit
, LONG Count
,
3519 LONG Extend
, LONG
*pDelta
)
3521 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3523 return CO_E_RELEASED
;
3525 FIXME("not implemented\n");
3529 static HRESULT WINAPI
ITextSelection_fnHomeKey(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3532 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3534 return CO_E_RELEASED
;
3536 FIXME("not implemented\n");
3540 static HRESULT WINAPI
ITextSelection_fnEndKey(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3543 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3545 return CO_E_RELEASED
;
3547 FIXME("not implemented\n");
3551 static HRESULT WINAPI
ITextSelection_fnTypeText(ITextSelection
*me
, BSTR bstr
)
3553 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3555 return CO_E_RELEASED
;
3557 FIXME("not implemented\n");
3561 static const ITextSelectionVtbl tsvt
= {
3562 ITextSelection_fnQueryInterface
,
3563 ITextSelection_fnAddRef
,
3564 ITextSelection_fnRelease
,
3565 ITextSelection_fnGetTypeInfoCount
,
3566 ITextSelection_fnGetTypeInfo
,
3567 ITextSelection_fnGetIDsOfNames
,
3568 ITextSelection_fnInvoke
,
3569 ITextSelection_fnGetText
,
3570 ITextSelection_fnSetText
,
3571 ITextSelection_fnGetChar
,
3572 ITextSelection_fnSetChar
,
3573 ITextSelection_fnGetDuplicate
,
3574 ITextSelection_fnGetFormattedText
,
3575 ITextSelection_fnSetFormattedText
,
3576 ITextSelection_fnGetStart
,
3577 ITextSelection_fnSetStart
,
3578 ITextSelection_fnGetEnd
,
3579 ITextSelection_fnSetEnd
,
3580 ITextSelection_fnGetFont
,
3581 ITextSelection_fnSetFont
,
3582 ITextSelection_fnGetPara
,
3583 ITextSelection_fnSetPara
,
3584 ITextSelection_fnGetStoryLength
,
3585 ITextSelection_fnGetStoryType
,
3586 ITextSelection_fnCollapse
,
3587 ITextSelection_fnExpand
,
3588 ITextSelection_fnGetIndex
,
3589 ITextSelection_fnSetIndex
,
3590 ITextSelection_fnSetRange
,
3591 ITextSelection_fnInRange
,
3592 ITextSelection_fnInStory
,
3593 ITextSelection_fnIsEqual
,
3594 ITextSelection_fnSelect
,
3595 ITextSelection_fnStartOf
,
3596 ITextSelection_fnEndOf
,
3597 ITextSelection_fnMove
,
3598 ITextSelection_fnMoveStart
,
3599 ITextSelection_fnMoveEnd
,
3600 ITextSelection_fnMoveWhile
,
3601 ITextSelection_fnMoveStartWhile
,
3602 ITextSelection_fnMoveEndWhile
,
3603 ITextSelection_fnMoveUntil
,
3604 ITextSelection_fnMoveStartUntil
,
3605 ITextSelection_fnMoveEndUntil
,
3606 ITextSelection_fnFindText
,
3607 ITextSelection_fnFindTextStart
,
3608 ITextSelection_fnFindTextEnd
,
3609 ITextSelection_fnDelete
,
3610 ITextSelection_fnCut
,
3611 ITextSelection_fnCopy
,
3612 ITextSelection_fnPaste
,
3613 ITextSelection_fnCanPaste
,
3614 ITextSelection_fnCanEdit
,
3615 ITextSelection_fnChangeCase
,
3616 ITextSelection_fnGetPoint
,
3617 ITextSelection_fnSetPoint
,
3618 ITextSelection_fnScrollIntoView
,
3619 ITextSelection_fnGetEmbeddedObject
,
3620 ITextSelection_fnGetFlags
,
3621 ITextSelection_fnSetFlags
,
3622 ITextSelection_fnGetType
,
3623 ITextSelection_fnMoveLeft
,
3624 ITextSelection_fnMoveRight
,
3625 ITextSelection_fnMoveUp
,
3626 ITextSelection_fnMoveDown
,
3627 ITextSelection_fnHomeKey
,
3628 ITextSelection_fnEndKey
,
3629 ITextSelection_fnTypeText
3632 static ITextSelectionImpl
*
3633 CreateTextSelection(IRichEditOleImpl
*reOle
)
3635 ITextSelectionImpl
*txtSel
= heap_alloc(sizeof *txtSel
);
3639 txtSel
->ITextSelection_iface
.lpVtbl
= &tsvt
;
3641 txtSel
->reOle
= reOle
;
3645 LRESULT
CreateIRichEditOle(IUnknown
*outer_unk
, ME_TextEditor
*editor
, LPVOID
*ppvObj
)
3647 IRichEditOleImpl
*reo
;
3649 reo
= heap_alloc(sizeof(IRichEditOleImpl
));
3653 reo
->IUnknown_inner
.lpVtbl
= &reo_unk_vtbl
;
3654 reo
->IRichEditOle_iface
.lpVtbl
= &revt
;
3655 reo
->ITextDocument_iface
.lpVtbl
= &tdvt
;
3657 reo
->editor
= editor
;
3658 reo
->txtSel
= CreateTextSelection(reo
);
3664 reo
->clientSite
= CreateOleClientSite(reo
);
3665 if (!reo
->clientSite
)
3667 ITextSelection_Release(&reo
->txtSel
->ITextSelection_iface
);
3671 TRACE("Created %p\n",reo
);
3672 list_init(&reo
->rangelist
);
3674 reo
->outer_unk
= outer_unk
;
3676 reo
->outer_unk
= &reo
->IUnknown_inner
;
3677 *ppvObj
= &reo
->IRichEditOle_iface
;
3682 static void convert_sizel(const ME_Context
*c
, const SIZEL
* szl
, SIZE
* sz
)
3684 /* sizel is in .01 millimeters, sz in pixels */
3685 sz
->cx
= MulDiv(szl
->cx
, c
->dpi
.cx
, 2540);
3686 sz
->cy
= MulDiv(szl
->cy
, c
->dpi
.cy
, 2540);
3689 /******************************************************************************
3690 * ME_GetOLEObjectSize
3692 * Sets run extent for OLE objects.
3694 void ME_GetOLEObjectSize(const ME_Context
*c
, ME_Run
*run
, SIZE
*pSize
)
3702 assert(run
->nFlags
& MERF_GRAPHICS
);
3703 assert(run
->ole_obj
);
3705 if (run
->ole_obj
->sizel
.cx
!= 0 || run
->ole_obj
->sizel
.cy
!= 0)
3707 convert_sizel(c
, &run
->ole_obj
->sizel
, pSize
);
3708 if (c
->editor
->nZoomNumerator
!= 0)
3710 pSize
->cx
= MulDiv(pSize
->cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3711 pSize
->cy
= MulDiv(pSize
->cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3716 if (IOleObject_QueryInterface(run
->ole_obj
->poleobj
, &IID_IDataObject
, (void**)&ido
) != S_OK
)
3718 FIXME("Query Interface IID_IDataObject failed!\n");
3719 pSize
->cx
= pSize
->cy
= 0;
3722 fmt
.cfFormat
= CF_BITMAP
;
3724 fmt
.dwAspect
= DVASPECT_CONTENT
;
3726 fmt
.tymed
= TYMED_GDI
;
3727 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
3729 fmt
.cfFormat
= CF_ENHMETAFILE
;
3730 fmt
.tymed
= TYMED_ENHMF
;
3731 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
3733 FIXME("unsupported format\n");
3734 pSize
->cx
= pSize
->cy
= 0;
3735 IDataObject_Release(ido
);
3743 GetObjectW(stgm
.u
.hBitmap
, sizeof(dibsect
), &dibsect
);
3744 pSize
->cx
= dibsect
.dsBm
.bmWidth
;
3745 pSize
->cy
= dibsect
.dsBm
.bmHeight
;
3746 if (!stgm
.pUnkForRelease
) DeleteObject(stgm
.u
.hBitmap
);
3749 GetEnhMetaFileHeader(stgm
.u
.hEnhMetaFile
, sizeof(emh
), &emh
);
3750 pSize
->cx
= emh
.rclBounds
.right
- emh
.rclBounds
.left
;
3751 pSize
->cy
= emh
.rclBounds
.bottom
- emh
.rclBounds
.top
;
3752 if (!stgm
.pUnkForRelease
) DeleteEnhMetaFile(stgm
.u
.hEnhMetaFile
);
3755 FIXME("Unsupported tymed %d\n", stgm
.tymed
);
3758 IDataObject_Release(ido
);
3759 if (c
->editor
->nZoomNumerator
!= 0)
3761 pSize
->cx
= MulDiv(pSize
->cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3762 pSize
->cy
= MulDiv(pSize
->cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3766 void ME_DrawOLE(ME_Context
*c
, int x
, int y
, ME_Run
*run
,
3767 ME_Paragraph
*para
, BOOL selected
)
3778 assert(run
->nFlags
& MERF_GRAPHICS
);
3779 assert(run
->ole_obj
);
3780 if (IOleObject_QueryInterface(run
->ole_obj
->poleobj
, &IID_IDataObject
, (void**)&ido
) != S_OK
)
3782 FIXME("Couldn't get interface\n");
3785 has_size
= run
->ole_obj
->sizel
.cx
!= 0 || run
->ole_obj
->sizel
.cy
!= 0;
3786 fmt
.cfFormat
= CF_BITMAP
;
3788 fmt
.dwAspect
= DVASPECT_CONTENT
;
3790 fmt
.tymed
= TYMED_GDI
;
3791 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
3793 fmt
.cfFormat
= CF_ENHMETAFILE
;
3794 fmt
.tymed
= TYMED_ENHMF
;
3795 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
3797 FIXME("Couldn't get storage medium\n");
3798 IDataObject_Release(ido
);
3805 GetObjectW(stgm
.u
.hBitmap
, sizeof(dibsect
), &dibsect
);
3806 hMemDC
= CreateCompatibleDC(c
->hDC
);
3807 SelectObject(hMemDC
, stgm
.u
.hBitmap
);
3810 convert_sizel(c
, &run
->ole_obj
->sizel
, &sz
);
3812 sz
.cx
= MulDiv(dibsect
.dsBm
.bmWidth
, c
->dpi
.cx
, 96);
3813 sz
.cy
= MulDiv(dibsect
.dsBm
.bmHeight
, c
->dpi
.cy
, 96);
3815 if (c
->editor
->nZoomNumerator
!= 0)
3817 sz
.cx
= MulDiv(sz
.cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3818 sz
.cy
= MulDiv(sz
.cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3820 if (sz
.cx
== dibsect
.dsBm
.bmWidth
&& sz
.cy
== dibsect
.dsBm
.bmHeight
)
3822 BitBlt(c
->hDC
, x
, y
- sz
.cy
,
3823 dibsect
.dsBm
.bmWidth
, dibsect
.dsBm
.bmHeight
,
3824 hMemDC
, 0, 0, SRCCOPY
);
3826 StretchBlt(c
->hDC
, x
, y
- sz
.cy
, sz
.cx
, sz
.cy
,
3827 hMemDC
, 0, 0, dibsect
.dsBm
.bmWidth
,
3828 dibsect
.dsBm
.bmHeight
, SRCCOPY
);
3831 if (!stgm
.pUnkForRelease
) DeleteObject(stgm
.u
.hBitmap
);
3834 GetEnhMetaFileHeader(stgm
.u
.hEnhMetaFile
, sizeof(emh
), &emh
);
3837 convert_sizel(c
, &run
->ole_obj
->sizel
, &sz
);
3839 sz
.cy
= MulDiv(emh
.rclBounds
.bottom
- emh
.rclBounds
.top
, c
->dpi
.cx
, 96);
3840 sz
.cx
= MulDiv(emh
.rclBounds
.right
- emh
.rclBounds
.left
, c
->dpi
.cy
, 96);
3842 if (c
->editor
->nZoomNumerator
!= 0)
3844 sz
.cx
= MulDiv(sz
.cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3845 sz
.cy
= MulDiv(sz
.cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3853 rc
.right
= x
+ sz
.cx
;
3855 PlayEnhMetaFile(c
->hDC
, stgm
.u
.hEnhMetaFile
, &rc
);
3857 if (!stgm
.pUnkForRelease
) DeleteEnhMetaFile(stgm
.u
.hEnhMetaFile
);
3860 FIXME("Unsupported tymed %d\n", stgm
.tymed
);
3864 if (selected
&& !c
->editor
->bHideSelection
)
3865 PatBlt(c
->hDC
, x
, y
- sz
.cy
, sz
.cx
, sz
.cy
, DSTINVERT
);
3866 IDataObject_Release(ido
);
3869 void ME_DeleteReObject(REOBJECT
* reo
)
3871 if (reo
->poleobj
) IOleObject_Release(reo
->poleobj
);
3872 if (reo
->pstg
) IStorage_Release(reo
->pstg
);
3873 if (reo
->polesite
) IOleClientSite_Release(reo
->polesite
);
3877 void ME_CopyReObject(REOBJECT
* dst
, const REOBJECT
* src
)
3881 if (dst
->poleobj
) IOleObject_AddRef(dst
->poleobj
);
3882 if (dst
->pstg
) IStorage_AddRef(dst
->pstg
);
3883 if (dst
->polesite
) IOleClientSite_AddRef(dst
->polesite
);
3886 void ME_GetITextDocumentInterface(IRichEditOle
*iface
, LPVOID
*ppvObj
)
3888 IRichEditOleImpl
*This
= impl_from_IRichEditOle(iface
);
3889 *ppvObj
= &This
->ITextDocument_iface
;