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 cpLim
)
953 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
955 return CO_E_RELEASED
;
957 FIXME("not implemented %p\n", This
);
961 static HRESULT WINAPI
ITextRange_fnGetFont(ITextRange
*me
, ITextFont
**font
)
963 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
965 TRACE("(%p)->(%p)\n", This
, font
);
968 return CO_E_RELEASED
;
973 return create_textfont(me
, font
);
976 static HRESULT WINAPI
ITextRange_fnSetFont(ITextRange
*me
, ITextFont
*pFont
)
978 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
980 return CO_E_RELEASED
;
982 FIXME("not implemented %p\n", This
);
986 static HRESULT WINAPI
ITextRange_fnGetPara(ITextRange
*me
, ITextPara
**para
)
988 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
990 TRACE("(%p)->(%p)\n", This
, para
);
993 return CO_E_RELEASED
;
998 return create_textpara(me
, para
);
1001 static HRESULT WINAPI
ITextRange_fnSetPara(ITextRange
*me
, ITextPara
*pPara
)
1003 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1005 return CO_E_RELEASED
;
1007 FIXME("not implemented %p\n", This
);
1011 static HRESULT WINAPI
ITextRange_fnGetStoryLength(ITextRange
*me
, LONG
*pcch
)
1013 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1015 return CO_E_RELEASED
;
1017 FIXME("not implemented %p\n", This
);
1021 static HRESULT WINAPI
ITextRange_fnGetStoryType(ITextRange
*me
, LONG
*pValue
)
1023 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1025 return CO_E_RELEASED
;
1027 FIXME("not implemented %p\n", This
);
1031 static HRESULT
range_Collapse(LONG bStart
, LONG
*start
, LONG
*end
)
1036 if (bStart
== tomEnd
|| bStart
== tomFalse
)
1043 static HRESULT WINAPI
ITextRange_fnCollapse(ITextRange
*me
, LONG bStart
)
1045 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1047 return CO_E_RELEASED
;
1049 return range_Collapse(bStart
, &This
->start
, &This
->end
);
1052 static HRESULT WINAPI
ITextRange_fnExpand(ITextRange
*me
, LONG Unit
, LONG
*pDelta
)
1054 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1056 return CO_E_RELEASED
;
1058 FIXME("not implemented %p\n", This
);
1062 static HRESULT WINAPI
ITextRange_fnGetIndex(ITextRange
*me
, LONG Unit
, LONG
*pIndex
)
1064 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1066 return CO_E_RELEASED
;
1068 FIXME("not implemented %p\n", This
);
1072 static HRESULT WINAPI
ITextRange_fnSetIndex(ITextRange
*me
, LONG Unit
, LONG Index
,
1075 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1077 return CO_E_RELEASED
;
1079 FIXME("not implemented %p\n", This
);
1083 static HRESULT WINAPI
ITextRange_fnSetRange(ITextRange
*me
, LONG cpActive
, LONG cpOther
)
1085 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1087 return CO_E_RELEASED
;
1089 FIXME("not implemented %p\n", This
);
1093 static HRESULT WINAPI
ITextRange_fnInRange(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1095 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1097 return CO_E_RELEASED
;
1099 FIXME("not implemented %p\n", This
);
1103 static HRESULT WINAPI
ITextRange_fnInStory(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1105 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1107 return CO_E_RELEASED
;
1109 FIXME("not implemented %p\n", This
);
1113 static HRESULT WINAPI
ITextRange_fnIsEqual(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1115 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1117 return CO_E_RELEASED
;
1119 FIXME("not implemented %p\n", This
);
1123 static HRESULT WINAPI
ITextRange_fnSelect(ITextRange
*me
)
1125 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1127 return CO_E_RELEASED
;
1129 FIXME("not implemented %p\n", This
);
1133 static HRESULT WINAPI
ITextRange_fnStartOf(ITextRange
*me
, LONG Unit
, LONG Extend
,
1136 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1138 return CO_E_RELEASED
;
1140 FIXME("not implemented %p\n", This
);
1144 static HRESULT WINAPI
ITextRange_fnEndOf(ITextRange
*me
, LONG Unit
, LONG Extend
,
1147 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1149 return CO_E_RELEASED
;
1151 FIXME("not implemented %p\n", This
);
1155 static HRESULT WINAPI
ITextRange_fnMove(ITextRange
*me
, LONG Unit
, LONG Count
, LONG
*pDelta
)
1157 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1159 return CO_E_RELEASED
;
1161 FIXME("not implemented %p\n", This
);
1165 static HRESULT WINAPI
ITextRange_fnMoveStart(ITextRange
*me
, LONG Unit
, LONG Count
,
1168 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1170 return CO_E_RELEASED
;
1172 FIXME("not implemented %p\n", This
);
1176 static HRESULT WINAPI
ITextRange_fnMoveEnd(ITextRange
*me
, LONG Unit
, LONG Count
,
1179 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1181 return CO_E_RELEASED
;
1183 FIXME("not implemented %p\n", This
);
1187 static HRESULT WINAPI
ITextRange_fnMoveWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1190 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1192 return CO_E_RELEASED
;
1194 FIXME("not implemented %p\n", This
);
1198 static HRESULT WINAPI
ITextRange_fnMoveStartWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1201 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1203 return CO_E_RELEASED
;
1205 FIXME("not implemented %p\n", This
);
1209 static HRESULT WINAPI
ITextRange_fnMoveEndWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1212 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1214 return CO_E_RELEASED
;
1216 FIXME("not implemented %p\n", This
);
1220 static HRESULT WINAPI
ITextRange_fnMoveUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1223 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1225 return CO_E_RELEASED
;
1227 FIXME("not implemented %p\n", This
);
1231 static HRESULT WINAPI
ITextRange_fnMoveStartUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1234 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1236 return CO_E_RELEASED
;
1238 FIXME("not implemented %p\n", This
);
1242 static HRESULT WINAPI
ITextRange_fnMoveEndUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1245 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1247 return CO_E_RELEASED
;
1249 FIXME("not implemented %p\n", This
);
1253 static HRESULT WINAPI
ITextRange_fnFindText(ITextRange
*me
, BSTR bstr
, LONG cch
, LONG Flags
,
1256 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1258 return CO_E_RELEASED
;
1260 FIXME("not implemented %p\n", This
);
1264 static HRESULT WINAPI
ITextRange_fnFindTextStart(ITextRange
*me
, BSTR bstr
, LONG cch
,
1265 LONG Flags
, LONG
*pLength
)
1267 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1269 return CO_E_RELEASED
;
1271 FIXME("not implemented %p\n", This
);
1275 static HRESULT WINAPI
ITextRange_fnFindTextEnd(ITextRange
*me
, BSTR bstr
, LONG cch
,
1276 LONG Flags
, LONG
*pLength
)
1278 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1280 return CO_E_RELEASED
;
1282 FIXME("not implemented %p\n", This
);
1286 static HRESULT WINAPI
ITextRange_fnDelete(ITextRange
*me
, LONG Unit
, LONG Count
,
1289 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1291 return CO_E_RELEASED
;
1293 FIXME("not implemented %p\n", This
);
1297 static HRESULT WINAPI
ITextRange_fnCut(ITextRange
*me
, VARIANT
*pVar
)
1299 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1301 return CO_E_RELEASED
;
1303 FIXME("not implemented %p\n", This
);
1307 static HRESULT WINAPI
ITextRange_fnCopy(ITextRange
*me
, VARIANT
*pVar
)
1309 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1311 return CO_E_RELEASED
;
1313 FIXME("not implemented %p\n", This
);
1317 static HRESULT WINAPI
ITextRange_fnPaste(ITextRange
*me
, VARIANT
*pVar
, LONG Format
)
1319 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1321 return CO_E_RELEASED
;
1323 FIXME("not implemented %p\n", This
);
1327 static HRESULT WINAPI
ITextRange_fnCanPaste(ITextRange
*me
, VARIANT
*pVar
, LONG Format
,
1330 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1332 return CO_E_RELEASED
;
1334 FIXME("not implemented %p\n", This
);
1338 static HRESULT WINAPI
ITextRange_fnCanEdit(ITextRange
*me
, LONG
*pb
)
1340 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1342 return CO_E_RELEASED
;
1344 FIXME("not implemented %p\n", This
);
1348 static HRESULT WINAPI
ITextRange_fnChangeCase(ITextRange
*me
, LONG Type
)
1350 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1352 return CO_E_RELEASED
;
1354 FIXME("not implemented %p\n", This
);
1358 static HRESULT WINAPI
ITextRange_fnGetPoint(ITextRange
*me
, LONG Type
, LONG
*cx
, LONG
*cy
)
1360 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1362 return CO_E_RELEASED
;
1364 FIXME("not implemented %p\n", This
);
1368 static HRESULT WINAPI
ITextRange_fnSetPoint(ITextRange
*me
, LONG x
, LONG y
, LONG Type
,
1371 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1373 return CO_E_RELEASED
;
1375 FIXME("not implemented %p\n", This
);
1379 static HRESULT WINAPI
ITextRange_fnScrollIntoView(ITextRange
*me
, LONG Value
)
1381 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1383 return CO_E_RELEASED
;
1385 FIXME("not implemented %p\n", This
);
1389 static HRESULT WINAPI
ITextRange_fnGetEmbeddedObject(ITextRange
*me
, IUnknown
**ppv
)
1391 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1393 return CO_E_RELEASED
;
1395 FIXME("not implemented %p\n", This
);
1399 static const ITextRangeVtbl trvt
= {
1400 ITextRange_fnQueryInterface
,
1401 ITextRange_fnAddRef
,
1402 ITextRange_fnRelease
,
1403 ITextRange_fnGetTypeInfoCount
,
1404 ITextRange_fnGetTypeInfo
,
1405 ITextRange_fnGetIDsOfNames
,
1406 ITextRange_fnInvoke
,
1407 ITextRange_fnGetText
,
1408 ITextRange_fnSetText
,
1409 ITextRange_fnGetChar
,
1410 ITextRange_fnSetChar
,
1411 ITextRange_fnGetDuplicate
,
1412 ITextRange_fnGetFormattedText
,
1413 ITextRange_fnSetFormattedText
,
1414 ITextRange_fnGetStart
,
1415 ITextRange_fnSetStart
,
1416 ITextRange_fnGetEnd
,
1417 ITextRange_fnSetEnd
,
1418 ITextRange_fnGetFont
,
1419 ITextRange_fnSetFont
,
1420 ITextRange_fnGetPara
,
1421 ITextRange_fnSetPara
,
1422 ITextRange_fnGetStoryLength
,
1423 ITextRange_fnGetStoryType
,
1424 ITextRange_fnCollapse
,
1425 ITextRange_fnExpand
,
1426 ITextRange_fnGetIndex
,
1427 ITextRange_fnSetIndex
,
1428 ITextRange_fnSetRange
,
1429 ITextRange_fnInRange
,
1430 ITextRange_fnInStory
,
1431 ITextRange_fnIsEqual
,
1432 ITextRange_fnSelect
,
1433 ITextRange_fnStartOf
,
1436 ITextRange_fnMoveStart
,
1437 ITextRange_fnMoveEnd
,
1438 ITextRange_fnMoveWhile
,
1439 ITextRange_fnMoveStartWhile
,
1440 ITextRange_fnMoveEndWhile
,
1441 ITextRange_fnMoveUntil
,
1442 ITextRange_fnMoveStartUntil
,
1443 ITextRange_fnMoveEndUntil
,
1444 ITextRange_fnFindText
,
1445 ITextRange_fnFindTextStart
,
1446 ITextRange_fnFindTextEnd
,
1447 ITextRange_fnDelete
,
1451 ITextRange_fnCanPaste
,
1452 ITextRange_fnCanEdit
,
1453 ITextRange_fnChangeCase
,
1454 ITextRange_fnGetPoint
,
1455 ITextRange_fnSetPoint
,
1456 ITextRange_fnScrollIntoView
,
1457 ITextRange_fnGetEmbeddedObject
1461 static HRESULT WINAPI
TextFont_QueryInterface(ITextFont
*iface
, REFIID riid
, void **ppv
)
1463 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1465 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
1467 if (IsEqualIID(riid
, &IID_ITextFont
) ||
1468 IsEqualIID(riid
, &IID_IDispatch
) ||
1469 IsEqualIID(riid
, &IID_IUnknown
))
1472 ITextFont_AddRef(iface
);
1477 return E_NOINTERFACE
;
1480 static ULONG WINAPI
TextFont_AddRef(ITextFont
*iface
)
1482 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1483 ULONG ref
= InterlockedIncrement(&This
->ref
);
1484 TRACE("(%p)->(%u)\n", This
, ref
);
1488 static ULONG WINAPI
TextFont_Release(ITextFont
*iface
)
1490 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1491 ULONG ref
= InterlockedDecrement(&This
->ref
);
1493 TRACE("(%p)->(%u)\n", This
, ref
);
1497 ITextRange_Release(This
->range
);
1504 static HRESULT WINAPI
TextFont_GetTypeInfoCount(ITextFont
*iface
, UINT
*pctinfo
)
1511 static HRESULT WINAPI
TextFont_GetTypeInfo(ITextFont
*iface
, UINT iTInfo
, LCID lcid
,
1512 ITypeInfo
**ppTInfo
)
1518 static HRESULT WINAPI
TextFont_GetIDsOfNames(ITextFont
*iface
, REFIID riid
,
1519 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1525 static HRESULT WINAPI
TextFont_Invoke(
1527 DISPID dispIdMember
,
1531 DISPPARAMS
*pDispParams
,
1532 VARIANT
*pVarResult
,
1533 EXCEPINFO
*pExcepInfo
,
1540 static HRESULT WINAPI
TextFont_GetDuplicate(ITextFont
*iface
, ITextFont
**ret
)
1542 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1543 FIXME("(%p)->(%p): stub\n", This
, ret
);
1547 static HRESULT WINAPI
TextFont_SetDuplicate(ITextFont
*iface
, ITextFont
*pFont
)
1549 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1550 FIXME("(%p)->(%p): stub\n", This
, pFont
);
1554 static HRESULT WINAPI
TextFont_CanChange(ITextFont
*iface
, LONG
*ret
)
1556 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1557 FIXME("(%p)->(%p): stub\n", This
, ret
);
1561 static HRESULT WINAPI
TextFont_IsEqual(ITextFont
*iface
, ITextFont
*font
, LONG
*ret
)
1563 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1564 FIXME("(%p)->(%p): stub\n", This
, ret
);
1568 static HRESULT WINAPI
TextFont_Reset(ITextFont
*iface
, LONG value
)
1570 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1571 FIXME("(%p): stub\n", This
);
1575 static HRESULT WINAPI
TextFont_GetStyle(ITextFont
*iface
, LONG
*value
)
1577 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1578 FIXME("(%p)->(%p): stub\n", This
, value
);
1582 static HRESULT WINAPI
TextFont_SetStyle(ITextFont
*iface
, LONG value
)
1584 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1585 FIXME("(%p)->(%d): stub\n", This
, value
);
1589 static HRESULT WINAPI
TextFont_GetAllCaps(ITextFont
*iface
, LONG
*value
)
1591 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1592 FIXME("(%p)->(%p): stub\n", This
, value
);
1596 static HRESULT WINAPI
TextFont_SetAllCaps(ITextFont
*iface
, LONG value
)
1598 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1599 FIXME("(%p)->(%d): stub\n", This
, value
);
1603 static HRESULT WINAPI
TextFont_GetAnimation(ITextFont
*iface
, LONG
*value
)
1605 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1606 FIXME("(%p)->(%p): stub\n", This
, value
);
1610 static HRESULT WINAPI
TextFont_SetAnimation(ITextFont
*iface
, LONG value
)
1612 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1613 FIXME("(%p)->(%d): stub\n", This
, value
);
1617 static HRESULT WINAPI
TextFont_GetBackColor(ITextFont
*iface
, LONG
*value
)
1619 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1620 FIXME("(%p)->(%p): stub\n", This
, value
);
1624 static HRESULT WINAPI
TextFont_SetBackColor(ITextFont
*iface
, LONG value
)
1626 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1627 FIXME("(%p)->(%d): stub\n", This
, value
);
1631 static HRESULT WINAPI
TextFont_GetBold(ITextFont
*iface
, LONG
*value
)
1633 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1634 FIXME("(%p)->(%p): stub\n", This
, value
);
1638 static HRESULT WINAPI
TextFont_SetBold(ITextFont
*iface
, LONG value
)
1640 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1641 FIXME("(%p)->(%d): stub\n", This
, value
);
1645 static HRESULT WINAPI
TextFont_GetEmboss(ITextFont
*iface
, LONG
*value
)
1647 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1648 FIXME("(%p)->(%p): stub\n", This
, value
);
1652 static HRESULT WINAPI
TextFont_SetEmboss(ITextFont
*iface
, LONG value
)
1654 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1655 FIXME("(%p)->(%d): stub\n", This
, value
);
1659 static HRESULT WINAPI
TextFont_GetForeColor(ITextFont
*iface
, LONG
*value
)
1661 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1662 FIXME("(%p)->(%p): stub\n", This
, value
);
1666 static HRESULT WINAPI
TextFont_SetForeColor(ITextFont
*iface
, LONG value
)
1668 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1669 FIXME("(%p)->(%d): stub\n", This
, value
);
1673 static HRESULT WINAPI
TextFont_GetHidden(ITextFont
*iface
, LONG
*value
)
1675 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1676 FIXME("(%p)->(%p): stub\n", This
, value
);
1680 static HRESULT WINAPI
TextFont_SetHidden(ITextFont
*iface
, LONG value
)
1682 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1683 FIXME("(%p)->(%d): stub\n", This
, value
);
1687 static HRESULT WINAPI
TextFont_GetEngrave(ITextFont
*iface
, LONG
*value
)
1689 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1690 FIXME("(%p)->(%p): stub\n", This
, value
);
1694 static HRESULT WINAPI
TextFont_SetEngrave(ITextFont
*iface
, LONG value
)
1696 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1697 FIXME("(%p)->(%d): stub\n", This
, value
);
1701 static HRESULT WINAPI
TextFont_GetItalic(ITextFont
*iface
, LONG
*value
)
1703 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1704 FIXME("(%p)->(%p): stub\n", This
, value
);
1708 static HRESULT WINAPI
TextFont_SetItalic(ITextFont
*iface
, LONG value
)
1710 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1711 FIXME("(%p)->(%d): stub\n", This
, value
);
1715 static HRESULT WINAPI
TextFont_GetKerning(ITextFont
*iface
, FLOAT
*value
)
1717 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1718 FIXME("(%p)->(%p): stub\n", This
, value
);
1722 static HRESULT WINAPI
TextFont_SetKerning(ITextFont
*iface
, FLOAT value
)
1724 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1725 FIXME("(%p)->(%.2f): stub\n", This
, value
);
1729 static HRESULT WINAPI
TextFont_GetLanguageID(ITextFont
*iface
, LONG
*value
)
1731 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1732 FIXME("(%p)->(%p): stub\n", This
, value
);
1736 static HRESULT WINAPI
TextFont_SetLanguageID(ITextFont
*iface
, LONG value
)
1738 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1739 FIXME("(%p)->(%d): stub\n", This
, value
);
1743 static HRESULT WINAPI
TextFont_GetName(ITextFont
*iface
, BSTR
*value
)
1745 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1746 FIXME("(%p)->(%p): stub\n", This
, value
);
1750 static HRESULT WINAPI
TextFont_SetName(ITextFont
*iface
, BSTR value
)
1752 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1753 FIXME("(%p)->(%s): stub\n", This
, debugstr_w(value
));
1757 static HRESULT WINAPI
TextFont_GetOutline(ITextFont
*iface
, LONG
*value
)
1759 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1760 FIXME("(%p)->(%p): stub\n", This
, value
);
1764 static HRESULT WINAPI
TextFont_SetOutline(ITextFont
*iface
, LONG value
)
1766 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1767 FIXME("(%p)->(%d): stub\n", This
, value
);
1771 static HRESULT WINAPI
TextFont_GetPosition(ITextFont
*iface
, FLOAT
*value
)
1773 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1774 FIXME("(%p)->(%p): stub\n", This
, value
);
1778 static HRESULT WINAPI
TextFont_SetPosition(ITextFont
*iface
, FLOAT value
)
1780 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1781 FIXME("(%p)->(%.2f): stub\n", This
, value
);
1785 static HRESULT WINAPI
TextFont_GetProtected(ITextFont
*iface
, LONG
*value
)
1787 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1788 FIXME("(%p)->(%p): stub\n", This
, value
);
1792 static HRESULT WINAPI
TextFont_SetProtected(ITextFont
*iface
, LONG value
)
1794 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1795 FIXME("(%p)->(%d): stub\n", This
, value
);
1799 static HRESULT WINAPI
TextFont_GetShadow(ITextFont
*iface
, LONG
*value
)
1801 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1802 FIXME("(%p)->(%p): stub\n", This
, value
);
1806 static HRESULT WINAPI
TextFont_SetShadow(ITextFont
*iface
, LONG value
)
1808 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1809 FIXME("(%p)->(%d): stub\n", This
, value
);
1813 static HRESULT WINAPI
TextFont_GetSize(ITextFont
*iface
, FLOAT
*value
)
1815 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1816 FIXME("(%p)->(%p): stub\n", This
, value
);
1820 static HRESULT WINAPI
TextFont_SetSize(ITextFont
*iface
, FLOAT value
)
1822 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1823 FIXME("(%p)->(%.2f): stub\n", This
, value
);
1827 static HRESULT WINAPI
TextFont_GetSmallCaps(ITextFont
*iface
, LONG
*value
)
1829 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1830 FIXME("(%p)->(%p): stub\n", This
, value
);
1834 static HRESULT WINAPI
TextFont_SetSmallCaps(ITextFont
*iface
, LONG value
)
1836 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1837 FIXME("(%p)->(%d): stub\n", This
, value
);
1841 static HRESULT WINAPI
TextFont_GetSpacing(ITextFont
*iface
, FLOAT
*value
)
1843 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1844 FIXME("(%p)->(%p): stub\n", This
, value
);
1848 static HRESULT WINAPI
TextFont_SetSpacing(ITextFont
*iface
, FLOAT value
)
1850 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1851 FIXME("(%p)->(%.2f): stub\n", This
, value
);
1855 static HRESULT WINAPI
TextFont_GetStrikeThrough(ITextFont
*iface
, LONG
*value
)
1857 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1858 FIXME("(%p)->(%p): stub\n", This
, value
);
1862 static HRESULT WINAPI
TextFont_SetStrikeThrough(ITextFont
*iface
, LONG value
)
1864 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1865 FIXME("(%p)->(%d): stub\n", This
, value
);
1869 static HRESULT WINAPI
TextFont_GetSubscript(ITextFont
*iface
, LONG
*value
)
1871 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1872 FIXME("(%p)->(%p): stub\n", This
, value
);
1876 static HRESULT WINAPI
TextFont_SetSubscript(ITextFont
*iface
, LONG value
)
1878 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1879 FIXME("(%p)->(%d): stub\n", This
, value
);
1883 static HRESULT WINAPI
TextFont_GetSuperscript(ITextFont
*iface
, LONG
*value
)
1885 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1886 FIXME("(%p)->(%p): stub\n", This
, value
);
1890 static HRESULT WINAPI
TextFont_SetSuperscript(ITextFont
*iface
, LONG value
)
1892 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1893 FIXME("(%p)->(%d): stub\n", This
, value
);
1897 static HRESULT WINAPI
TextFont_GetUnderline(ITextFont
*iface
, LONG
*value
)
1899 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1900 FIXME("(%p)->(%p): stub\n", This
, value
);
1904 static HRESULT WINAPI
TextFont_SetUnderline(ITextFont
*iface
, LONG value
)
1906 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1907 FIXME("(%p)->(%d): stub\n", This
, value
);
1911 static HRESULT WINAPI
TextFont_GetWeight(ITextFont
*iface
, LONG
*value
)
1913 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1914 FIXME("(%p)->(%p): stub\n", This
, value
);
1918 static HRESULT WINAPI
TextFont_SetWeight(ITextFont
*iface
, LONG value
)
1920 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1921 FIXME("(%p)->(%d): stub\n", This
, value
);
1925 static ITextFontVtbl textfontvtbl
= {
1926 TextFont_QueryInterface
,
1929 TextFont_GetTypeInfoCount
,
1930 TextFont_GetTypeInfo
,
1931 TextFont_GetIDsOfNames
,
1933 TextFont_GetDuplicate
,
1934 TextFont_SetDuplicate
,
1940 TextFont_GetAllCaps
,
1941 TextFont_SetAllCaps
,
1942 TextFont_GetAnimation
,
1943 TextFont_SetAnimation
,
1944 TextFont_GetBackColor
,
1945 TextFont_SetBackColor
,
1950 TextFont_GetForeColor
,
1951 TextFont_SetForeColor
,
1954 TextFont_GetEngrave
,
1955 TextFont_SetEngrave
,
1958 TextFont_GetKerning
,
1959 TextFont_SetKerning
,
1960 TextFont_GetLanguageID
,
1961 TextFont_SetLanguageID
,
1964 TextFont_GetOutline
,
1965 TextFont_SetOutline
,
1966 TextFont_GetPosition
,
1967 TextFont_SetPosition
,
1968 TextFont_GetProtected
,
1969 TextFont_SetProtected
,
1974 TextFont_GetSmallCaps
,
1975 TextFont_SetSmallCaps
,
1976 TextFont_GetSpacing
,
1977 TextFont_SetSpacing
,
1978 TextFont_GetStrikeThrough
,
1979 TextFont_SetStrikeThrough
,
1980 TextFont_GetSubscript
,
1981 TextFont_SetSubscript
,
1982 TextFont_GetSuperscript
,
1983 TextFont_SetSuperscript
,
1984 TextFont_GetUnderline
,
1985 TextFont_SetUnderline
,
1990 static HRESULT
create_textfont(ITextRange
*range
, ITextFont
**ret
)
1992 ITextFontImpl
*font
;
1995 font
= heap_alloc(sizeof(*font
));
1997 return E_OUTOFMEMORY
;
1999 font
->ITextFont_iface
.lpVtbl
= &textfontvtbl
;
2001 font
->range
= range
;
2002 ITextRange_AddRef(range
);
2004 *ret
= &font
->ITextFont_iface
;
2009 static HRESULT WINAPI
TextPara_QueryInterface(ITextPara
*iface
, REFIID riid
, void **ppv
)
2011 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2013 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
2015 if (IsEqualIID(riid
, &IID_ITextPara
) ||
2016 IsEqualIID(riid
, &IID_IDispatch
) ||
2017 IsEqualIID(riid
, &IID_IUnknown
))
2020 ITextPara_AddRef(iface
);
2025 return E_NOINTERFACE
;
2028 static ULONG WINAPI
TextPara_AddRef(ITextPara
*iface
)
2030 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2031 ULONG ref
= InterlockedIncrement(&This
->ref
);
2032 TRACE("(%p)->(%u)\n", This
, ref
);
2036 static ULONG WINAPI
TextPara_Release(ITextPara
*iface
)
2038 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2039 ULONG ref
= InterlockedDecrement(&This
->ref
);
2041 TRACE("(%p)->(%u)\n", This
, ref
);
2045 ITextRange_Release(This
->range
);
2052 static HRESULT WINAPI
TextPara_GetTypeInfoCount(ITextPara
*iface
, UINT
*pctinfo
)
2059 static HRESULT WINAPI
TextPara_GetTypeInfo(ITextPara
*iface
, UINT iTInfo
, LCID lcid
,
2060 ITypeInfo
**ppTInfo
)
2066 static HRESULT WINAPI
TextPara_GetIDsOfNames(ITextPara
*iface
, REFIID riid
,
2067 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2073 static HRESULT WINAPI
TextPara_Invoke(
2075 DISPID dispIdMember
,
2079 DISPPARAMS
*pDispParams
,
2080 VARIANT
*pVarResult
,
2081 EXCEPINFO
*pExcepInfo
,
2088 static HRESULT WINAPI
TextPara_GetDuplicate(ITextPara
*iface
, ITextPara
**ret
)
2090 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2091 FIXME("(%p)->(%p)\n", This
, ret
);
2095 static HRESULT WINAPI
TextPara_SetDuplicate(ITextPara
*iface
, ITextPara
*para
)
2097 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2098 FIXME("(%p)->(%p)\n", This
, para
);
2102 static HRESULT WINAPI
TextPara_CanChange(ITextPara
*iface
, LONG
*ret
)
2104 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2105 FIXME("(%p)->(%p)\n", This
, ret
);
2109 static HRESULT WINAPI
TextPara_IsEqual(ITextPara
*iface
, ITextPara
*para
, LONG
*ret
)
2111 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2112 FIXME("(%p)->(%p %p)\n", This
, para
, ret
);
2116 static HRESULT WINAPI
TextPara_Reset(ITextPara
*iface
, LONG value
)
2118 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2119 FIXME("(%p)->(%d)\n", This
, value
);
2123 static HRESULT WINAPI
TextPara_GetStyle(ITextPara
*iface
, LONG
*value
)
2125 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2126 FIXME("(%p)->(%p)\n", This
, value
);
2130 static HRESULT WINAPI
TextPara_SetStyle(ITextPara
*iface
, LONG value
)
2132 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2133 FIXME("(%p)->(%d)\n", This
, value
);
2137 static HRESULT WINAPI
TextPara_GetAlignment(ITextPara
*iface
, LONG
*value
)
2139 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2140 FIXME("(%p)->(%p)\n", This
, value
);
2144 static HRESULT WINAPI
TextPara_SetAlignment(ITextPara
*iface
, LONG value
)
2146 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2147 FIXME("(%p)->(%d)\n", This
, value
);
2151 static HRESULT WINAPI
TextPara_GetHyphenation(ITextPara
*iface
, LONG
*value
)
2153 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2154 FIXME("(%p)->(%p)\n", This
, value
);
2158 static HRESULT WINAPI
TextPara_SetHyphenation(ITextPara
*iface
, LONG value
)
2160 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2161 FIXME("(%p)->(%d)\n", This
, value
);
2165 static HRESULT WINAPI
TextPara_GetFirstLineIndent(ITextPara
*iface
, FLOAT
*value
)
2167 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2168 FIXME("(%p)->(%p)\n", This
, value
);
2172 static HRESULT WINAPI
TextPara_GetKeepTogether(ITextPara
*iface
, LONG
*value
)
2174 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2175 FIXME("(%p)->(%p)\n", This
, value
);
2179 static HRESULT WINAPI
TextPara_SetKeepTogether(ITextPara
*iface
, LONG value
)
2181 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2182 FIXME("(%p)->(%d)\n", This
, value
);
2186 static HRESULT WINAPI
TextPara_GetKeepWithNext(ITextPara
*iface
, LONG
*value
)
2188 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2189 FIXME("(%p)->(%p)\n", This
, value
);
2193 static HRESULT WINAPI
TextPara_SetKeepWithNext(ITextPara
*iface
, LONG value
)
2195 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2196 FIXME("(%p)->(%d)\n", This
, value
);
2200 static HRESULT WINAPI
TextPara_GetLeftIndent(ITextPara
*iface
, FLOAT
*value
)
2202 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2203 FIXME("(%p)->(%p)\n", This
, value
);
2207 static HRESULT WINAPI
TextPara_GetLineSpacing(ITextPara
*iface
, FLOAT
*value
)
2209 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2210 FIXME("(%p)->(%p)\n", This
, value
);
2214 static HRESULT WINAPI
TextPara_GetLineSpacingRule(ITextPara
*iface
, LONG
*value
)
2216 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2217 FIXME("(%p)->(%p)\n", This
, value
);
2221 static HRESULT WINAPI
TextPara_GetListAlignment(ITextPara
*iface
, LONG
*value
)
2223 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2224 FIXME("(%p)->(%p)\n", This
, value
);
2228 static HRESULT WINAPI
TextPara_SetListAlignment(ITextPara
*iface
, LONG value
)
2230 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2231 FIXME("(%p)->(%d)\n", This
, value
);
2235 static HRESULT WINAPI
TextPara_GetListLevelIndex(ITextPara
*iface
, LONG
*value
)
2237 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2238 FIXME("(%p)->(%p)\n", This
, value
);
2242 static HRESULT WINAPI
TextPara_SetListLevelIndex(ITextPara
*iface
, LONG value
)
2244 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2245 FIXME("(%p)->(%d)\n", This
, value
);
2249 static HRESULT WINAPI
TextPara_GetListStart(ITextPara
*iface
, LONG
*value
)
2251 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2252 FIXME("(%p)->(%p)\n", This
, value
);
2256 static HRESULT WINAPI
TextPara_SetListStart(ITextPara
*iface
, LONG value
)
2258 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2259 FIXME("(%p)->(%d)\n", This
, value
);
2263 static HRESULT WINAPI
TextPara_GetListTab(ITextPara
*iface
, FLOAT
*value
)
2265 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2266 FIXME("(%p)->(%p)\n", This
, value
);
2270 static HRESULT WINAPI
TextPara_SetListTab(ITextPara
*iface
, FLOAT value
)
2272 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2273 FIXME("(%p)->(%.2f)\n", This
, value
);
2277 static HRESULT WINAPI
TextPara_GetListType(ITextPara
*iface
, LONG
*value
)
2279 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2280 FIXME("(%p)->(%p)\n", This
, value
);
2284 static HRESULT WINAPI
TextPara_SetListType(ITextPara
*iface
, LONG value
)
2286 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2287 FIXME("(%p)->(%d)\n", This
, value
);
2291 static HRESULT WINAPI
TextPara_GetNoLineNumber(ITextPara
*iface
, LONG
*value
)
2293 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2294 FIXME("(%p)->(%p)\n", This
, value
);
2298 static HRESULT WINAPI
TextPara_SetNoLineNumber(ITextPara
*iface
, LONG value
)
2300 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2301 FIXME("(%p)->(%d)\n", This
, value
);
2305 static HRESULT WINAPI
TextPara_GetPageBreakBefore(ITextPara
*iface
, LONG
*value
)
2307 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2308 FIXME("(%p)->(%p)\n", This
, value
);
2312 static HRESULT WINAPI
TextPara_SetPageBreakBefore(ITextPara
*iface
, LONG value
)
2314 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2315 FIXME("(%p)->(%d)\n", This
, value
);
2319 static HRESULT WINAPI
TextPara_GetRightIndent(ITextPara
*iface
, FLOAT
*value
)
2321 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2322 FIXME("(%p)->(%p)\n", This
, value
);
2326 static HRESULT WINAPI
TextPara_SetRightIndent(ITextPara
*iface
, FLOAT value
)
2328 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2329 FIXME("(%p)->(%.2f)\n", This
, value
);
2333 static HRESULT WINAPI
TextPara_SetIndents(ITextPara
*iface
, FLOAT StartIndent
, FLOAT LeftIndent
, FLOAT RightIndent
)
2335 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2336 FIXME("(%p)->(%.2f %.2f %.2f)\n", This
, StartIndent
, LeftIndent
, RightIndent
);
2340 static HRESULT WINAPI
TextPara_SetLineSpacing(ITextPara
*iface
, LONG LineSpacingRule
, FLOAT LineSpacing
)
2342 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2343 FIXME("(%p)->(%d %.2f)\n", This
, LineSpacingRule
, LineSpacing
);
2347 static HRESULT WINAPI
TextPara_GetSpaceAfter(ITextPara
*iface
, FLOAT
*value
)
2349 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2350 FIXME("(%p)->(%p)\n", This
, value
);
2354 static HRESULT WINAPI
TextPara_SetSpaceAfter(ITextPara
*iface
, FLOAT value
)
2356 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2357 FIXME("(%p)->(%.2f)\n", This
, value
);
2361 static HRESULT WINAPI
TextPara_GetSpaceBefore(ITextPara
*iface
, FLOAT
*value
)
2363 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2364 FIXME("(%p)->(%p)\n", This
, value
);
2368 static HRESULT WINAPI
TextPara_SetSpaceBefore(ITextPara
*iface
, FLOAT value
)
2370 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2371 FIXME("(%p)->(%.2f)\n", This
, value
);
2375 static HRESULT WINAPI
TextPara_GetWidowControl(ITextPara
*iface
, LONG
*value
)
2377 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2378 FIXME("(%p)->(%p)\n", This
, value
);
2382 static HRESULT WINAPI
TextPara_SetWidowControl(ITextPara
*iface
, LONG value
)
2384 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2385 FIXME("(%p)->(%d)\n", This
, value
);
2389 static HRESULT WINAPI
TextPara_GetTabCount(ITextPara
*iface
, LONG
*value
)
2391 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2392 FIXME("(%p)->(%p)\n", This
, value
);
2396 static HRESULT WINAPI
TextPara_AddTab(ITextPara
*iface
, FLOAT tbPos
, LONG tbAlign
, LONG tbLeader
)
2398 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2399 FIXME("(%p)->(%.2f %d %d)\n", This
, tbPos
, tbAlign
, tbLeader
);
2403 static HRESULT WINAPI
TextPara_ClearAllTabs(ITextPara
*iface
)
2405 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2406 FIXME("(%p)\n", This
);
2410 static HRESULT WINAPI
TextPara_DeleteTab(ITextPara
*iface
, FLOAT pos
)
2412 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2413 FIXME("(%p)->(%.2f)\n", This
, pos
);
2417 static HRESULT WINAPI
TextPara_GetTab(ITextPara
*iface
, LONG iTab
, FLOAT
*ptbPos
, LONG
*ptbAlign
, LONG
*ptbLeader
)
2419 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2420 FIXME("(%p)->(%d %p %p %p)\n", This
, iTab
, ptbPos
, ptbAlign
, ptbLeader
);
2424 static ITextParaVtbl textparavtbl
= {
2425 TextPara_QueryInterface
,
2428 TextPara_GetTypeInfoCount
,
2429 TextPara_GetTypeInfo
,
2430 TextPara_GetIDsOfNames
,
2432 TextPara_GetDuplicate
,
2433 TextPara_SetDuplicate
,
2439 TextPara_GetAlignment
,
2440 TextPara_SetAlignment
,
2441 TextPara_GetHyphenation
,
2442 TextPara_SetHyphenation
,
2443 TextPara_GetFirstLineIndent
,
2444 TextPara_GetKeepTogether
,
2445 TextPara_SetKeepTogether
,
2446 TextPara_GetKeepWithNext
,
2447 TextPara_SetKeepWithNext
,
2448 TextPara_GetLeftIndent
,
2449 TextPara_GetLineSpacing
,
2450 TextPara_GetLineSpacingRule
,
2451 TextPara_GetListAlignment
,
2452 TextPara_SetListAlignment
,
2453 TextPara_GetListLevelIndex
,
2454 TextPara_SetListLevelIndex
,
2455 TextPara_GetListStart
,
2456 TextPara_SetListStart
,
2457 TextPara_GetListTab
,
2458 TextPara_SetListTab
,
2459 TextPara_GetListType
,
2460 TextPara_SetListType
,
2461 TextPara_GetNoLineNumber
,
2462 TextPara_SetNoLineNumber
,
2463 TextPara_GetPageBreakBefore
,
2464 TextPara_SetPageBreakBefore
,
2465 TextPara_GetRightIndent
,
2466 TextPara_SetRightIndent
,
2467 TextPara_SetIndents
,
2468 TextPara_SetLineSpacing
,
2469 TextPara_GetSpaceAfter
,
2470 TextPara_SetSpaceAfter
,
2471 TextPara_GetSpaceBefore
,
2472 TextPara_SetSpaceBefore
,
2473 TextPara_GetWidowControl
,
2474 TextPara_SetWidowControl
,
2475 TextPara_GetTabCount
,
2477 TextPara_ClearAllTabs
,
2482 static HRESULT
create_textpara(ITextRange
*range
, ITextPara
**ret
)
2484 ITextParaImpl
*para
;
2487 para
= heap_alloc(sizeof(*para
));
2489 return E_OUTOFMEMORY
;
2491 para
->ITextPara_iface
.lpVtbl
= &textparavtbl
;
2493 para
->range
= range
;
2494 ITextRange_AddRef(range
);
2496 *ret
= ¶
->ITextPara_iface
;
2501 static HRESULT WINAPI
2502 ITextDocument_fnQueryInterface(ITextDocument
* me
, REFIID riid
,
2505 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2506 return IRichEditOle_QueryInterface(&This
->IRichEditOle_iface
, riid
, ppvObject
);
2510 ITextDocument_fnAddRef(ITextDocument
* me
)
2512 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2513 return IRichEditOle_AddRef(&This
->IRichEditOle_iface
);
2517 ITextDocument_fnRelease(ITextDocument
* me
)
2519 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2520 return IRichEditOle_Release(&This
->IRichEditOle_iface
);
2523 static HRESULT WINAPI
2524 ITextDocument_fnGetTypeInfoCount(ITextDocument
* me
,
2527 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2528 FIXME("stub %p\n",This
);
2532 static HRESULT WINAPI
2533 ITextDocument_fnGetTypeInfo(ITextDocument
* me
, UINT iTInfo
, LCID lcid
,
2534 ITypeInfo
** ppTInfo
)
2536 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2537 FIXME("stub %p\n",This
);
2541 static HRESULT WINAPI
2542 ITextDocument_fnGetIDsOfNames(ITextDocument
* me
, REFIID riid
,
2543 LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
)
2545 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2546 FIXME("stub %p\n",This
);
2550 static HRESULT WINAPI
2551 ITextDocument_fnInvoke(ITextDocument
* me
, DISPID dispIdMember
,
2552 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
,
2553 VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
)
2555 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2556 FIXME("stub %p\n",This
);
2560 static HRESULT WINAPI
2561 ITextDocument_fnGetName(ITextDocument
* me
, BSTR
* pName
)
2563 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2564 FIXME("stub %p\n",This
);
2568 static HRESULT WINAPI
2569 ITextDocument_fnGetSelection(ITextDocument
* me
, ITextSelection
** ppSel
)
2571 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2572 TRACE("(%p)\n", me
);
2575 return E_INVALIDARG
;
2576 *ppSel
= &This
->txtSel
->ITextSelection_iface
;
2577 ITextSelection_AddRef(*ppSel
);
2581 static HRESULT WINAPI
2582 ITextDocument_fnGetStoryCount(ITextDocument
* me
, LONG
* pCount
)
2584 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2585 FIXME("stub %p\n",This
);
2589 static HRESULT WINAPI
2590 ITextDocument_fnGetStoryRanges(ITextDocument
* me
,
2591 ITextStoryRanges
** ppStories
)
2593 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2594 FIXME("stub %p\n",This
);
2598 static HRESULT WINAPI
2599 ITextDocument_fnGetSaved(ITextDocument
* me
, LONG
* pValue
)
2601 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2602 FIXME("stub %p\n",This
);
2606 static HRESULT WINAPI
2607 ITextDocument_fnSetSaved(ITextDocument
* me
, LONG Value
)
2609 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2610 FIXME("stub %p\n",This
);
2614 static HRESULT WINAPI
2615 ITextDocument_fnGetDefaultTabStop(ITextDocument
* me
, float* pValue
)
2617 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2618 FIXME("stub %p\n",This
);
2622 static HRESULT WINAPI
2623 ITextDocument_fnSetDefaultTabStop(ITextDocument
* me
, float Value
)
2625 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2626 FIXME("stub %p\n",This
);
2630 static HRESULT WINAPI
2631 ITextDocument_fnNew(ITextDocument
* me
)
2633 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2634 FIXME("stub %p\n",This
);
2638 static HRESULT WINAPI
2639 ITextDocument_fnOpen(ITextDocument
* me
, VARIANT
* pVar
, LONG Flags
,
2642 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2643 FIXME("stub %p\n",This
);
2647 static HRESULT WINAPI
2648 ITextDocument_fnSave(ITextDocument
* me
, VARIANT
* pVar
, LONG Flags
,
2651 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2652 FIXME("stub %p\n",This
);
2656 static HRESULT WINAPI
2657 ITextDocument_fnFreeze(ITextDocument
* me
, LONG
* pCount
)
2659 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2660 FIXME("stub %p\n",This
);
2664 static HRESULT WINAPI
2665 ITextDocument_fnUnfreeze(ITextDocument
* me
, LONG
* pCount
)
2667 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2668 FIXME("stub %p\n",This
);
2672 static HRESULT WINAPI
2673 ITextDocument_fnBeginEditCollection(ITextDocument
* me
)
2675 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2676 FIXME("stub %p\n",This
);
2680 static HRESULT WINAPI
2681 ITextDocument_fnEndEditCollection(ITextDocument
* me
)
2683 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2684 FIXME("stub %p\n",This
);
2688 static HRESULT WINAPI
2689 ITextDocument_fnUndo(ITextDocument
* me
, LONG Count
, LONG
* prop
)
2691 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2692 FIXME("stub %p\n",This
);
2696 static HRESULT WINAPI
2697 ITextDocument_fnRedo(ITextDocument
* me
, LONG Count
, LONG
* prop
)
2699 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2700 FIXME("stub %p\n",This
);
2704 static HRESULT
CreateITextRange(IRichEditOleImpl
*reOle
, LONG start
, LONG end
, ITextRange
** ppRange
)
2706 ITextRangeImpl
*txtRge
= heap_alloc(sizeof(ITextRangeImpl
));
2709 return E_OUTOFMEMORY
;
2710 txtRge
->ITextRange_iface
.lpVtbl
= &trvt
;
2712 txtRge
->reOle
= reOle
;
2713 txtRge
->start
= start
;
2715 list_add_head(&reOle
->rangelist
, &txtRge
->entry
);
2716 *ppRange
= &txtRge
->ITextRange_iface
;
2720 static HRESULT WINAPI
2721 ITextDocument_fnRange(ITextDocument
* me
, LONG cp1
, LONG cp2
,
2722 ITextRange
** ppRange
)
2724 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2725 const int len
= ME_GetTextLength(This
->editor
) + 1;
2727 TRACE("%p %p %d %d\n", This
, ppRange
, cp1
, cp2
);
2729 return E_INVALIDARG
;
2733 cp1
= min(cp1
, len
);
2734 cp2
= min(cp2
, len
);
2743 cp1
= cp2
= len
- 1;
2745 return CreateITextRange(This
, cp1
, cp2
, ppRange
);
2748 static HRESULT WINAPI
2749 ITextDocument_fnRangeFromPoint(ITextDocument
* me
, LONG x
, LONG y
,
2750 ITextRange
** ppRange
)
2752 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
2753 FIXME("stub %p\n",This
);
2757 static const ITextDocumentVtbl tdvt
= {
2758 ITextDocument_fnQueryInterface
,
2759 ITextDocument_fnAddRef
,
2760 ITextDocument_fnRelease
,
2761 ITextDocument_fnGetTypeInfoCount
,
2762 ITextDocument_fnGetTypeInfo
,
2763 ITextDocument_fnGetIDsOfNames
,
2764 ITextDocument_fnInvoke
,
2765 ITextDocument_fnGetName
,
2766 ITextDocument_fnGetSelection
,
2767 ITextDocument_fnGetStoryCount
,
2768 ITextDocument_fnGetStoryRanges
,
2769 ITextDocument_fnGetSaved
,
2770 ITextDocument_fnSetSaved
,
2771 ITextDocument_fnGetDefaultTabStop
,
2772 ITextDocument_fnSetDefaultTabStop
,
2773 ITextDocument_fnNew
,
2774 ITextDocument_fnOpen
,
2775 ITextDocument_fnSave
,
2776 ITextDocument_fnFreeze
,
2777 ITextDocument_fnUnfreeze
,
2778 ITextDocument_fnBeginEditCollection
,
2779 ITextDocument_fnEndEditCollection
,
2780 ITextDocument_fnUndo
,
2781 ITextDocument_fnRedo
,
2782 ITextDocument_fnRange
,
2783 ITextDocument_fnRangeFromPoint
2786 /* ITextSelection */
2787 static HRESULT WINAPI
ITextSelection_fnQueryInterface(
2793 if (IsEqualGUID(riid
, &IID_IUnknown
)
2794 || IsEqualGUID(riid
, &IID_IDispatch
)
2795 || IsEqualGUID(riid
, &IID_ITextRange
)
2796 || IsEqualGUID(riid
, &IID_ITextSelection
))
2799 ITextSelection_AddRef(me
);
2803 return E_NOINTERFACE
;
2806 static ULONG WINAPI
ITextSelection_fnAddRef(ITextSelection
*me
)
2808 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2809 return InterlockedIncrement(&This
->ref
);
2812 static ULONG WINAPI
ITextSelection_fnRelease(ITextSelection
*me
)
2814 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2815 ULONG ref
= InterlockedDecrement(&This
->ref
);
2821 static HRESULT WINAPI
ITextSelection_fnGetTypeInfoCount(ITextSelection
*me
, UINT
*pctinfo
)
2823 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2825 return CO_E_RELEASED
;
2827 FIXME("not implemented\n");
2831 static HRESULT WINAPI
ITextSelection_fnGetTypeInfo(ITextSelection
*me
, UINT iTInfo
, LCID lcid
,
2832 ITypeInfo
**ppTInfo
)
2834 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2836 return CO_E_RELEASED
;
2838 FIXME("not implemented\n");
2842 static HRESULT WINAPI
ITextSelection_fnGetIDsOfNames(ITextSelection
*me
, REFIID riid
,
2843 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2845 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2847 return CO_E_RELEASED
;
2849 FIXME("not implemented\n");
2853 static HRESULT WINAPI
ITextSelection_fnInvoke(
2855 DISPID dispIdMember
,
2859 DISPPARAMS
*pDispParams
,
2860 VARIANT
*pVarResult
,
2861 EXCEPINFO
*pExcepInfo
,
2864 FIXME("not implemented\n");
2868 /*** ITextRange methods ***/
2869 static HRESULT WINAPI
ITextSelection_fnGetText(ITextSelection
*me
, BSTR
*pbstr
)
2871 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2872 ME_Cursor
*start
= NULL
, *end
= NULL
;
2877 return CO_E_RELEASED
;
2878 TRACE("%p\n", pbstr
);
2880 return E_INVALIDARG
;
2882 ME_GetSelection(This
->reOle
->editor
, &start
, &end
);
2883 endOfs
= ME_GetCursorOfs(end
);
2884 nChars
= endOfs
- ME_GetCursorOfs(start
);
2891 *pbstr
= SysAllocStringLen(NULL
, nChars
);
2893 return E_OUTOFMEMORY
;
2895 bEOP
= (end
->pRun
->next
->type
== diTextEnd
&& endOfs
> ME_GetTextLength(This
->reOle
->editor
));
2896 ME_GetTextW(This
->reOle
->editor
, *pbstr
, nChars
, start
, nChars
, FALSE
, bEOP
);
2897 TRACE("%s\n", wine_dbgstr_w(*pbstr
));
2902 static HRESULT WINAPI
ITextSelection_fnSetText(ITextSelection
*me
, BSTR bstr
)
2904 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2906 return CO_E_RELEASED
;
2908 FIXME("not implemented\n");
2912 static HRESULT WINAPI
ITextSelection_fnGetChar(ITextSelection
*me
, LONG
*pch
)
2914 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2915 ME_Cursor
*start
= NULL
, *end
= NULL
;
2918 return CO_E_RELEASED
;
2921 return E_INVALIDARG
;
2923 ME_GetSelection(This
->reOle
->editor
, &start
, &end
);
2924 return range_GetChar(This
->reOle
->editor
, start
, pch
);
2927 static HRESULT WINAPI
ITextSelection_fnSetChar(ITextSelection
*me
, LONG ch
)
2929 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2931 return CO_E_RELEASED
;
2933 FIXME("not implemented\n");
2937 static HRESULT WINAPI
ITextSelection_fnGetDuplicate(ITextSelection
*me
, ITextRange
**ppRange
)
2939 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2941 return CO_E_RELEASED
;
2943 FIXME("not implemented\n");
2947 static HRESULT WINAPI
ITextSelection_fnGetFormattedText(ITextSelection
*me
, ITextRange
**ppRange
)
2949 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2951 return CO_E_RELEASED
;
2953 FIXME("not implemented\n");
2957 static HRESULT WINAPI
ITextSelection_fnSetFormattedText(ITextSelection
*me
, ITextRange
*pRange
)
2959 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2961 return CO_E_RELEASED
;
2963 FIXME("not implemented\n");
2967 static HRESULT WINAPI
ITextSelection_fnGetStart(ITextSelection
*me
, LONG
*pcpFirst
)
2969 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2972 return CO_E_RELEASED
;
2975 return E_INVALIDARG
;
2976 ME_GetSelectionOfs(This
->reOle
->editor
, pcpFirst
, &lim
);
2977 TRACE("%d\n", *pcpFirst
);
2981 static HRESULT WINAPI
ITextSelection_fnSetStart(ITextSelection
*me
, LONG cpFirst
)
2983 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2985 return CO_E_RELEASED
;
2987 FIXME("not implemented\n");
2991 static HRESULT WINAPI
ITextSelection_fnGetEnd(ITextSelection
*me
, LONG
*pcpLim
)
2993 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
2996 return CO_E_RELEASED
;
2999 return E_INVALIDARG
;
3000 ME_GetSelectionOfs(This
->reOle
->editor
, &first
, pcpLim
);
3001 TRACE("%d\n", *pcpLim
);
3005 static HRESULT WINAPI
ITextSelection_fnSetEnd(ITextSelection
*me
, LONG cpLim
)
3007 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3009 return CO_E_RELEASED
;
3011 FIXME("not implemented\n");
3015 static HRESULT WINAPI
ITextSelection_fnGetFont(ITextSelection
*me
, ITextFont
**pFont
)
3017 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3019 return CO_E_RELEASED
;
3021 FIXME("not implemented\n");
3025 static HRESULT WINAPI
ITextSelection_fnSetFont(ITextSelection
*me
, ITextFont
*pFont
)
3027 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3029 return CO_E_RELEASED
;
3031 FIXME("not implemented\n");
3035 static HRESULT WINAPI
ITextSelection_fnGetPara(ITextSelection
*me
, ITextPara
**para
)
3037 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3039 return CO_E_RELEASED
;
3041 FIXME("not implemented\n");
3045 static HRESULT WINAPI
ITextSelection_fnSetPara(ITextSelection
*me
, ITextPara
*pPara
)
3047 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3049 return CO_E_RELEASED
;
3051 FIXME("not implemented\n");
3055 static HRESULT WINAPI
ITextSelection_fnGetStoryLength(ITextSelection
*me
, LONG
*pcch
)
3057 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3059 return CO_E_RELEASED
;
3061 FIXME("not implemented\n");
3065 static HRESULT WINAPI
ITextSelection_fnGetStoryType(ITextSelection
*me
, LONG
*pValue
)
3067 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3069 return CO_E_RELEASED
;
3071 FIXME("not implemented\n");
3075 static HRESULT WINAPI
ITextSelection_fnCollapse(ITextSelection
*me
, LONG bStart
)
3077 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3081 return CO_E_RELEASED
;
3083 ME_GetSelectionOfs(This
->reOle
->editor
, &start
, &end
);
3084 hres
= range_Collapse(bStart
, &start
, &end
);
3085 if (SUCCEEDED(hres
))
3086 ME_SetSelection(This
->reOle
->editor
, start
, end
);
3090 static HRESULT WINAPI
ITextSelection_fnExpand(ITextSelection
*me
, LONG Unit
, LONG
*pDelta
)
3092 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3094 return CO_E_RELEASED
;
3096 FIXME("not implemented\n");
3100 static HRESULT WINAPI
ITextSelection_fnGetIndex(ITextSelection
*me
, LONG Unit
, LONG
*pIndex
)
3102 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3104 return CO_E_RELEASED
;
3106 FIXME("not implemented\n");
3110 static HRESULT WINAPI
ITextSelection_fnSetIndex(ITextSelection
*me
, LONG Unit
, LONG Index
,
3113 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3115 return CO_E_RELEASED
;
3117 FIXME("not implemented\n");
3121 static HRESULT WINAPI
ITextSelection_fnSetRange(ITextSelection
*me
, LONG cpActive
, LONG cpOther
)
3123 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3125 return CO_E_RELEASED
;
3127 FIXME("not implemented\n");
3131 static HRESULT WINAPI
ITextSelection_fnInRange(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3133 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3135 return CO_E_RELEASED
;
3137 FIXME("not implemented\n");
3141 static HRESULT WINAPI
ITextSelection_fnInStory(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3143 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3145 return CO_E_RELEASED
;
3147 FIXME("not implemented\n");
3151 static HRESULT WINAPI
ITextSelection_fnIsEqual(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3153 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3155 return CO_E_RELEASED
;
3157 FIXME("not implemented\n");
3161 static HRESULT WINAPI
ITextSelection_fnSelect(ITextSelection
*me
)
3163 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3165 return CO_E_RELEASED
;
3167 FIXME("not implemented\n");
3171 static HRESULT WINAPI
ITextSelection_fnStartOf(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3174 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3176 return CO_E_RELEASED
;
3178 FIXME("not implemented\n");
3182 static HRESULT WINAPI
ITextSelection_fnEndOf(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3185 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3187 return CO_E_RELEASED
;
3189 FIXME("not implemented\n");
3193 static HRESULT WINAPI
ITextSelection_fnMove(ITextSelection
*me
, LONG Unit
, LONG Count
, LONG
*pDelta
)
3195 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3197 return CO_E_RELEASED
;
3199 FIXME("not implemented\n");
3203 static HRESULT WINAPI
ITextSelection_fnMoveStart(ITextSelection
*me
, LONG Unit
, LONG Count
,
3206 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3208 return CO_E_RELEASED
;
3210 FIXME("not implemented\n");
3214 static HRESULT WINAPI
ITextSelection_fnMoveEnd(ITextSelection
*me
, LONG Unit
, LONG Count
,
3217 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3219 return CO_E_RELEASED
;
3221 FIXME("not implemented\n");
3225 static HRESULT WINAPI
ITextSelection_fnMoveWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3228 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3230 return CO_E_RELEASED
;
3232 FIXME("not implemented\n");
3236 static HRESULT WINAPI
ITextSelection_fnMoveStartWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3239 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3241 return CO_E_RELEASED
;
3243 FIXME("not implemented\n");
3247 static HRESULT WINAPI
ITextSelection_fnMoveEndWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3250 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3252 return CO_E_RELEASED
;
3254 FIXME("not implemented\n");
3258 static HRESULT WINAPI
ITextSelection_fnMoveUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3261 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3263 return CO_E_RELEASED
;
3265 FIXME("not implemented\n");
3269 static HRESULT WINAPI
ITextSelection_fnMoveStartUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3272 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3274 return CO_E_RELEASED
;
3276 FIXME("not implemented\n");
3280 static HRESULT WINAPI
ITextSelection_fnMoveEndUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3283 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3285 return CO_E_RELEASED
;
3287 FIXME("not implemented\n");
3291 static HRESULT WINAPI
ITextSelection_fnFindText(ITextSelection
*me
, BSTR bstr
, LONG cch
, LONG Flags
,
3294 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3296 return CO_E_RELEASED
;
3298 FIXME("not implemented\n");
3302 static HRESULT WINAPI
ITextSelection_fnFindTextStart(ITextSelection
*me
, BSTR bstr
, LONG cch
,
3303 LONG Flags
, LONG
*pLength
)
3305 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3307 return CO_E_RELEASED
;
3309 FIXME("not implemented\n");
3313 static HRESULT WINAPI
ITextSelection_fnFindTextEnd(ITextSelection
*me
, BSTR bstr
, LONG cch
,
3314 LONG Flags
, LONG
*pLength
)
3316 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3318 return CO_E_RELEASED
;
3320 FIXME("not implemented\n");
3324 static HRESULT WINAPI
ITextSelection_fnDelete(ITextSelection
*me
, LONG Unit
, LONG Count
,
3327 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3329 return CO_E_RELEASED
;
3331 FIXME("not implemented\n");
3335 static HRESULT WINAPI
ITextSelection_fnCut(ITextSelection
*me
, VARIANT
*pVar
)
3337 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3339 return CO_E_RELEASED
;
3341 FIXME("not implemented\n");
3345 static HRESULT WINAPI
ITextSelection_fnCopy(ITextSelection
*me
, VARIANT
*pVar
)
3347 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3349 return CO_E_RELEASED
;
3351 FIXME("not implemented\n");
3355 static HRESULT WINAPI
ITextSelection_fnPaste(ITextSelection
*me
, VARIANT
*pVar
, LONG Format
)
3357 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3359 return CO_E_RELEASED
;
3361 FIXME("not implemented\n");
3365 static HRESULT WINAPI
ITextSelection_fnCanPaste(ITextSelection
*me
, VARIANT
*pVar
, LONG Format
,
3368 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3370 return CO_E_RELEASED
;
3372 FIXME("not implemented\n");
3376 static HRESULT WINAPI
ITextSelection_fnCanEdit(ITextSelection
*me
, LONG
*pb
)
3378 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3380 return CO_E_RELEASED
;
3382 FIXME("not implemented\n");
3386 static HRESULT WINAPI
ITextSelection_fnChangeCase(ITextSelection
*me
, LONG Type
)
3388 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3390 return CO_E_RELEASED
;
3392 FIXME("not implemented\n");
3396 static HRESULT WINAPI
ITextSelection_fnGetPoint(ITextSelection
*me
, LONG Type
, LONG
*cx
, LONG
*cy
)
3398 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3400 return CO_E_RELEASED
;
3402 FIXME("not implemented\n");
3406 static HRESULT WINAPI
ITextSelection_fnSetPoint(ITextSelection
*me
, LONG x
, LONG y
, LONG Type
,
3409 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3411 return CO_E_RELEASED
;
3413 FIXME("not implemented\n");
3417 static HRESULT WINAPI
ITextSelection_fnScrollIntoView(ITextSelection
*me
, LONG Value
)
3419 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3421 return CO_E_RELEASED
;
3423 FIXME("not implemented\n");
3427 static HRESULT WINAPI
ITextSelection_fnGetEmbeddedObject(ITextSelection
*me
, IUnknown
**ppv
)
3429 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3431 return CO_E_RELEASED
;
3433 FIXME("not implemented\n");
3437 /*** ITextSelection methods ***/
3438 static HRESULT WINAPI
ITextSelection_fnGetFlags(ITextSelection
*me
, LONG
*pFlags
)
3440 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3442 return CO_E_RELEASED
;
3444 FIXME("not implemented\n");
3448 static HRESULT WINAPI
ITextSelection_fnSetFlags(ITextSelection
*me
, LONG Flags
)
3450 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3452 return CO_E_RELEASED
;
3454 FIXME("not implemented\n");
3458 static HRESULT WINAPI
ITextSelection_fnGetType(ITextSelection
*me
, LONG
*pType
)
3460 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3462 return CO_E_RELEASED
;
3464 FIXME("not implemented\n");
3468 static HRESULT WINAPI
ITextSelection_fnMoveLeft(ITextSelection
*me
, LONG Unit
, LONG Count
,
3469 LONG Extend
, LONG
*pDelta
)
3471 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3473 return CO_E_RELEASED
;
3475 FIXME("not implemented\n");
3479 static HRESULT WINAPI
ITextSelection_fnMoveRight(ITextSelection
*me
, LONG Unit
, LONG Count
,
3480 LONG Extend
, LONG
*pDelta
)
3482 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3484 return CO_E_RELEASED
;
3486 FIXME("not implemented\n");
3490 static HRESULT WINAPI
ITextSelection_fnMoveUp(ITextSelection
*me
, LONG Unit
, LONG Count
,
3491 LONG Extend
, LONG
*pDelta
)
3493 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3495 return CO_E_RELEASED
;
3497 FIXME("not implemented\n");
3501 static HRESULT WINAPI
ITextSelection_fnMoveDown(ITextSelection
*me
, LONG Unit
, LONG Count
,
3502 LONG Extend
, LONG
*pDelta
)
3504 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3506 return CO_E_RELEASED
;
3508 FIXME("not implemented\n");
3512 static HRESULT WINAPI
ITextSelection_fnHomeKey(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3515 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3517 return CO_E_RELEASED
;
3519 FIXME("not implemented\n");
3523 static HRESULT WINAPI
ITextSelection_fnEndKey(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3526 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3528 return CO_E_RELEASED
;
3530 FIXME("not implemented\n");
3534 static HRESULT WINAPI
ITextSelection_fnTypeText(ITextSelection
*me
, BSTR bstr
)
3536 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3538 return CO_E_RELEASED
;
3540 FIXME("not implemented\n");
3544 static const ITextSelectionVtbl tsvt
= {
3545 ITextSelection_fnQueryInterface
,
3546 ITextSelection_fnAddRef
,
3547 ITextSelection_fnRelease
,
3548 ITextSelection_fnGetTypeInfoCount
,
3549 ITextSelection_fnGetTypeInfo
,
3550 ITextSelection_fnGetIDsOfNames
,
3551 ITextSelection_fnInvoke
,
3552 ITextSelection_fnGetText
,
3553 ITextSelection_fnSetText
,
3554 ITextSelection_fnGetChar
,
3555 ITextSelection_fnSetChar
,
3556 ITextSelection_fnGetDuplicate
,
3557 ITextSelection_fnGetFormattedText
,
3558 ITextSelection_fnSetFormattedText
,
3559 ITextSelection_fnGetStart
,
3560 ITextSelection_fnSetStart
,
3561 ITextSelection_fnGetEnd
,
3562 ITextSelection_fnSetEnd
,
3563 ITextSelection_fnGetFont
,
3564 ITextSelection_fnSetFont
,
3565 ITextSelection_fnGetPara
,
3566 ITextSelection_fnSetPara
,
3567 ITextSelection_fnGetStoryLength
,
3568 ITextSelection_fnGetStoryType
,
3569 ITextSelection_fnCollapse
,
3570 ITextSelection_fnExpand
,
3571 ITextSelection_fnGetIndex
,
3572 ITextSelection_fnSetIndex
,
3573 ITextSelection_fnSetRange
,
3574 ITextSelection_fnInRange
,
3575 ITextSelection_fnInStory
,
3576 ITextSelection_fnIsEqual
,
3577 ITextSelection_fnSelect
,
3578 ITextSelection_fnStartOf
,
3579 ITextSelection_fnEndOf
,
3580 ITextSelection_fnMove
,
3581 ITextSelection_fnMoveStart
,
3582 ITextSelection_fnMoveEnd
,
3583 ITextSelection_fnMoveWhile
,
3584 ITextSelection_fnMoveStartWhile
,
3585 ITextSelection_fnMoveEndWhile
,
3586 ITextSelection_fnMoveUntil
,
3587 ITextSelection_fnMoveStartUntil
,
3588 ITextSelection_fnMoveEndUntil
,
3589 ITextSelection_fnFindText
,
3590 ITextSelection_fnFindTextStart
,
3591 ITextSelection_fnFindTextEnd
,
3592 ITextSelection_fnDelete
,
3593 ITextSelection_fnCut
,
3594 ITextSelection_fnCopy
,
3595 ITextSelection_fnPaste
,
3596 ITextSelection_fnCanPaste
,
3597 ITextSelection_fnCanEdit
,
3598 ITextSelection_fnChangeCase
,
3599 ITextSelection_fnGetPoint
,
3600 ITextSelection_fnSetPoint
,
3601 ITextSelection_fnScrollIntoView
,
3602 ITextSelection_fnGetEmbeddedObject
,
3603 ITextSelection_fnGetFlags
,
3604 ITextSelection_fnSetFlags
,
3605 ITextSelection_fnGetType
,
3606 ITextSelection_fnMoveLeft
,
3607 ITextSelection_fnMoveRight
,
3608 ITextSelection_fnMoveUp
,
3609 ITextSelection_fnMoveDown
,
3610 ITextSelection_fnHomeKey
,
3611 ITextSelection_fnEndKey
,
3612 ITextSelection_fnTypeText
3615 static ITextSelectionImpl
*
3616 CreateTextSelection(IRichEditOleImpl
*reOle
)
3618 ITextSelectionImpl
*txtSel
= heap_alloc(sizeof *txtSel
);
3622 txtSel
->ITextSelection_iface
.lpVtbl
= &tsvt
;
3624 txtSel
->reOle
= reOle
;
3628 LRESULT
CreateIRichEditOle(IUnknown
*outer_unk
, ME_TextEditor
*editor
, LPVOID
*ppvObj
)
3630 IRichEditOleImpl
*reo
;
3632 reo
= heap_alloc(sizeof(IRichEditOleImpl
));
3636 reo
->IUnknown_inner
.lpVtbl
= &reo_unk_vtbl
;
3637 reo
->IRichEditOle_iface
.lpVtbl
= &revt
;
3638 reo
->ITextDocument_iface
.lpVtbl
= &tdvt
;
3640 reo
->editor
= editor
;
3641 reo
->txtSel
= CreateTextSelection(reo
);
3647 reo
->clientSite
= CreateOleClientSite(reo
);
3648 if (!reo
->clientSite
)
3650 ITextSelection_Release(&reo
->txtSel
->ITextSelection_iface
);
3654 TRACE("Created %p\n",reo
);
3655 list_init(&reo
->rangelist
);
3657 reo
->outer_unk
= outer_unk
;
3659 reo
->outer_unk
= &reo
->IUnknown_inner
;
3660 *ppvObj
= &reo
->IRichEditOle_iface
;
3665 static void convert_sizel(const ME_Context
*c
, const SIZEL
* szl
, SIZE
* sz
)
3667 /* sizel is in .01 millimeters, sz in pixels */
3668 sz
->cx
= MulDiv(szl
->cx
, c
->dpi
.cx
, 2540);
3669 sz
->cy
= MulDiv(szl
->cy
, c
->dpi
.cy
, 2540);
3672 /******************************************************************************
3673 * ME_GetOLEObjectSize
3675 * Sets run extent for OLE objects.
3677 void ME_GetOLEObjectSize(const ME_Context
*c
, ME_Run
*run
, SIZE
*pSize
)
3685 assert(run
->nFlags
& MERF_GRAPHICS
);
3686 assert(run
->ole_obj
);
3688 if (run
->ole_obj
->sizel
.cx
!= 0 || run
->ole_obj
->sizel
.cy
!= 0)
3690 convert_sizel(c
, &run
->ole_obj
->sizel
, pSize
);
3691 if (c
->editor
->nZoomNumerator
!= 0)
3693 pSize
->cx
= MulDiv(pSize
->cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3694 pSize
->cy
= MulDiv(pSize
->cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3699 if (IOleObject_QueryInterface(run
->ole_obj
->poleobj
, &IID_IDataObject
, (void**)&ido
) != S_OK
)
3701 FIXME("Query Interface IID_IDataObject failed!\n");
3702 pSize
->cx
= pSize
->cy
= 0;
3705 fmt
.cfFormat
= CF_BITMAP
;
3707 fmt
.dwAspect
= DVASPECT_CONTENT
;
3709 fmt
.tymed
= TYMED_GDI
;
3710 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
3712 fmt
.cfFormat
= CF_ENHMETAFILE
;
3713 fmt
.tymed
= TYMED_ENHMF
;
3714 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
3716 FIXME("unsupported format\n");
3717 pSize
->cx
= pSize
->cy
= 0;
3718 IDataObject_Release(ido
);
3726 GetObjectW(stgm
.u
.hBitmap
, sizeof(dibsect
), &dibsect
);
3727 pSize
->cx
= dibsect
.dsBm
.bmWidth
;
3728 pSize
->cy
= dibsect
.dsBm
.bmHeight
;
3729 if (!stgm
.pUnkForRelease
) DeleteObject(stgm
.u
.hBitmap
);
3732 GetEnhMetaFileHeader(stgm
.u
.hEnhMetaFile
, sizeof(emh
), &emh
);
3733 pSize
->cx
= emh
.rclBounds
.right
- emh
.rclBounds
.left
;
3734 pSize
->cy
= emh
.rclBounds
.bottom
- emh
.rclBounds
.top
;
3735 if (!stgm
.pUnkForRelease
) DeleteEnhMetaFile(stgm
.u
.hEnhMetaFile
);
3738 FIXME("Unsupported tymed %d\n", stgm
.tymed
);
3741 IDataObject_Release(ido
);
3742 if (c
->editor
->nZoomNumerator
!= 0)
3744 pSize
->cx
= MulDiv(pSize
->cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3745 pSize
->cy
= MulDiv(pSize
->cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3749 void ME_DrawOLE(ME_Context
*c
, int x
, int y
, ME_Run
*run
,
3750 ME_Paragraph
*para
, BOOL selected
)
3761 assert(run
->nFlags
& MERF_GRAPHICS
);
3762 assert(run
->ole_obj
);
3763 if (IOleObject_QueryInterface(run
->ole_obj
->poleobj
, &IID_IDataObject
, (void**)&ido
) != S_OK
)
3765 FIXME("Couldn't get interface\n");
3768 has_size
= run
->ole_obj
->sizel
.cx
!= 0 || run
->ole_obj
->sizel
.cy
!= 0;
3769 fmt
.cfFormat
= CF_BITMAP
;
3771 fmt
.dwAspect
= DVASPECT_CONTENT
;
3773 fmt
.tymed
= TYMED_GDI
;
3774 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
3776 fmt
.cfFormat
= CF_ENHMETAFILE
;
3777 fmt
.tymed
= TYMED_ENHMF
;
3778 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
3780 FIXME("Couldn't get storage medium\n");
3781 IDataObject_Release(ido
);
3788 GetObjectW(stgm
.u
.hBitmap
, sizeof(dibsect
), &dibsect
);
3789 hMemDC
= CreateCompatibleDC(c
->hDC
);
3790 SelectObject(hMemDC
, stgm
.u
.hBitmap
);
3793 convert_sizel(c
, &run
->ole_obj
->sizel
, &sz
);
3795 sz
.cx
= MulDiv(dibsect
.dsBm
.bmWidth
, c
->dpi
.cx
, 96);
3796 sz
.cy
= MulDiv(dibsect
.dsBm
.bmHeight
, c
->dpi
.cy
, 96);
3798 if (c
->editor
->nZoomNumerator
!= 0)
3800 sz
.cx
= MulDiv(sz
.cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3801 sz
.cy
= MulDiv(sz
.cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3803 if (sz
.cx
== dibsect
.dsBm
.bmWidth
&& sz
.cy
== dibsect
.dsBm
.bmHeight
)
3805 BitBlt(c
->hDC
, x
, y
- sz
.cy
,
3806 dibsect
.dsBm
.bmWidth
, dibsect
.dsBm
.bmHeight
,
3807 hMemDC
, 0, 0, SRCCOPY
);
3809 StretchBlt(c
->hDC
, x
, y
- sz
.cy
, sz
.cx
, sz
.cy
,
3810 hMemDC
, 0, 0, dibsect
.dsBm
.bmWidth
,
3811 dibsect
.dsBm
.bmHeight
, SRCCOPY
);
3814 if (!stgm
.pUnkForRelease
) DeleteObject(stgm
.u
.hBitmap
);
3817 GetEnhMetaFileHeader(stgm
.u
.hEnhMetaFile
, sizeof(emh
), &emh
);
3820 convert_sizel(c
, &run
->ole_obj
->sizel
, &sz
);
3822 sz
.cy
= MulDiv(emh
.rclBounds
.bottom
- emh
.rclBounds
.top
, c
->dpi
.cx
, 96);
3823 sz
.cx
= MulDiv(emh
.rclBounds
.right
- emh
.rclBounds
.left
, c
->dpi
.cy
, 96);
3825 if (c
->editor
->nZoomNumerator
!= 0)
3827 sz
.cx
= MulDiv(sz
.cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3828 sz
.cy
= MulDiv(sz
.cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
3836 rc
.right
= x
+ sz
.cx
;
3838 PlayEnhMetaFile(c
->hDC
, stgm
.u
.hEnhMetaFile
, &rc
);
3840 if (!stgm
.pUnkForRelease
) DeleteEnhMetaFile(stgm
.u
.hEnhMetaFile
);
3843 FIXME("Unsupported tymed %d\n", stgm
.tymed
);
3847 if (selected
&& !c
->editor
->bHideSelection
)
3848 PatBlt(c
->hDC
, x
, y
- sz
.cy
, sz
.cx
, sz
.cy
, DSTINVERT
);
3849 IDataObject_Release(ido
);
3852 void ME_DeleteReObject(REOBJECT
* reo
)
3854 if (reo
->poleobj
) IOleObject_Release(reo
->poleobj
);
3855 if (reo
->pstg
) IStorage_Release(reo
->pstg
);
3856 if (reo
->polesite
) IOleClientSite_Release(reo
->polesite
);
3860 void ME_CopyReObject(REOBJECT
* dst
, const REOBJECT
* src
)
3864 if (dst
->poleobj
) IOleObject_AddRef(dst
->poleobj
);
3865 if (dst
->pstg
) IStorage_AddRef(dst
->pstg
);
3866 if (dst
->polesite
) IOleClientSite_AddRef(dst
->polesite
);
3869 void ME_GetITextDocumentInterface(IRichEditOle
*iface
, LPVOID
*ppvObj
)
3871 IRichEditOleImpl
*This
= impl_from_IRichEditOle(iface
);
3872 *ppvObj
= &This
->ITextDocument_iface
;