From 10d6726b429cb379175723cd4a5fd7a1043e8fcc Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 10 Jul 2006 12:03:57 -0700 Subject: [PATCH] riched20: Add stub implementation of ITextDocument. --- dlls/riched20/richole.c | 308 ++++++++++++++++++++++++++-- include/.gitignore | 1 + include/Makefile.in | 1 + include/tom.idl | 430 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 718 insertions(+), 22 deletions(-) create mode 100644 include/tom.idl diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 497c0fc319a..9ceb930d0db 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -32,6 +32,7 @@ #include "ole2.h" #include "richole.h" #include "editor.h" +#include "tom.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(richedit); @@ -46,26 +47,42 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit); TEXTSERV_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d); TEXTSERV_GUID(IID_ITextHost, 0xc5bdd8d0, 0xd26e, 0x11ce, 0xa8, 0x9e); TEXTSERV_GUID(IID_ITextHost2, 0xc5bdd8d0, 0xd26e, 0x11ce, 0xa8, 0x9e); +DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d); typedef struct IRichEditOleImpl { - const IRichEditOleVtbl *lpVtbl; + const IRichEditOleVtbl *lpRichEditOleVtbl; + const ITextDocumentVtbl *lpTextDocumentVtbl; LONG ref; ME_TextEditor *editor; } IRichEditOleImpl; +static inline IRichEditOleImpl *impl_from_IRichEditOle(IRichEditOle *iface) +{ + return (IRichEditOleImpl *)((BYTE*)iface - FIELD_OFFSET(IRichEditOleImpl, lpRichEditOleVtbl)); +} + +static inline IRichEditOleImpl *impl_from_ITextDocument(ITextDocument *iface) +{ + return (IRichEditOleImpl *)((BYTE*)iface - FIELD_OFFSET(IRichEditOleImpl, lpTextDocumentVtbl)); +} + static HRESULT WINAPI IRichEditOle_fnQueryInterface(IRichEditOle *me, REFIID riid, LPVOID *ppvObj) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); TRACE("%p %s\n", This, debugstr_guid(riid) ); + *ppvObj = NULL; if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IRichEditOle)) + *ppvObj = &This->lpRichEditOleVtbl; + else if (IsEqualGUID(riid, &IID_ITextDocument)) + *ppvObj = &This->lpTextDocumentVtbl; + if (*ppvObj) { IRichEditOle_AddRef(me); - *ppvObj = (LPVOID) This; return S_OK; } FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid) ); @@ -76,7 +93,7 @@ IRichEditOle_fnQueryInterface(IRichEditOle *me, REFIID riid, LPVOID *ppvObj) static ULONG WINAPI IRichEditOle_fnAddRef(IRichEditOle *me) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); ULONG ref = InterlockedIncrement( &This->ref ); TRACE("%p ref = %lu\n", This, ref); @@ -87,7 +104,7 @@ IRichEditOle_fnAddRef(IRichEditOle *me) static ULONG WINAPI IRichEditOle_fnRelease(IRichEditOle *me) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); ULONG ref = InterlockedDecrement(&This->ref); TRACE ("%p ref=%lu\n", This, ref); @@ -103,7 +120,7 @@ IRichEditOle_fnRelease(IRichEditOle *me) static HRESULT WINAPI IRichEditOle_fnActivateAs(IRichEditOle *me, REFCLSID rclsid, REFCLSID rclsidAs) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -111,7 +128,7 @@ IRichEditOle_fnActivateAs(IRichEditOle *me, REFCLSID rclsid, REFCLSID rclsidAs) static HRESULT WINAPI IRichEditOle_fnContextSensitiveHelp(IRichEditOle *me, BOOL fEnterMode) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -120,7 +137,7 @@ static HRESULT WINAPI IRichEditOle_fnConvertObject(IRichEditOle *me, LONG iob, REFCLSID rclsidNew, LPCSTR lpstrUserTypeNew) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -129,7 +146,7 @@ static HRESULT WINAPI IRichEditOle_fnGetClientSite(IRichEditOle *me, LPOLECLIENTSITE *lplpolesite) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -138,7 +155,7 @@ static HRESULT WINAPI IRichEditOle_fnGetClipboardData(IRichEditOle *me, CHARRANGE *lpchrg, DWORD reco, LPDATAOBJECT *lplpdataobj) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); CHARRANGE tmpchrg; TRACE("(%p,%p,%ld)\n",This, lpchrg, reco); @@ -153,7 +170,7 @@ IRichEditOle_fnGetClipboardData(IRichEditOle *me, CHARRANGE *lpchrg, static LONG WINAPI IRichEditOle_fnGetLinkCount(IRichEditOle *me) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -162,7 +179,7 @@ static HRESULT WINAPI IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob, REOBJECT *lpreobject, DWORD dwFlags) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -170,7 +187,7 @@ IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob, static LONG WINAPI IRichEditOle_fnGetObjectCount(IRichEditOle *me) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -178,7 +195,7 @@ IRichEditOle_fnGetObjectCount(IRichEditOle *me) static HRESULT WINAPI IRichEditOle_fnHandsOffStorage(IRichEditOle *me, LONG iob) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -187,7 +204,7 @@ static HRESULT WINAPI IRichEditOle_fnImportDataObject(IRichEditOle *me, LPDATAOBJECT lpdataobj, CLIPFORMAT cf, HGLOBAL hMetaPict) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -195,7 +212,7 @@ IRichEditOle_fnImportDataObject(IRichEditOle *me, LPDATAOBJECT lpdataobj, static HRESULT WINAPI IRichEditOle_fnInPlaceDeactivate(IRichEditOle *me) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -203,7 +220,7 @@ IRichEditOle_fnInPlaceDeactivate(IRichEditOle *me) static HRESULT WINAPI IRichEditOle_fnInsertObject(IRichEditOle *me, REOBJECT *lpreobject) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -211,7 +228,7 @@ IRichEditOle_fnInsertObject(IRichEditOle *me, REOBJECT *lpreobject) static HRESULT WINAPI IRichEditOle_fnSaveCompleted(IRichEditOle *me, LONG iob, LPSTORAGE lpstg) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -219,7 +236,7 @@ static HRESULT WINAPI IRichEditOle_fnSaveCompleted(IRichEditOle *me, LONG iob, static HRESULT WINAPI IRichEditOle_fnSetDvaspect(IRichEditOle *me, LONG iob, DWORD dvaspect) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -227,7 +244,7 @@ IRichEditOle_fnSetDvaspect(IRichEditOle *me, LONG iob, DWORD dvaspect) static HRESULT WINAPI IRichEditOle_fnSetHostNames(IRichEditOle *me, LPCSTR lpstrContainerApp, LPCSTR lpstrContainerObj) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p %s %s\n",This, lpstrContainerApp, lpstrContainerObj); return E_NOTIMPL; } @@ -235,7 +252,7 @@ static HRESULT WINAPI IRichEditOle_fnSetHostNames(IRichEditOle *me, static HRESULT WINAPI IRichEditOle_fnSetLinkAvailable(IRichEditOle *me, LONG iob, BOOL fAvailable) { - IRichEditOleImpl *This = (IRichEditOleImpl *)me; + IRichEditOleImpl *This = impl_from_IRichEditOle(me); FIXME("stub %p\n",This); return E_NOTIMPL; } @@ -262,6 +279,252 @@ static const IRichEditOleVtbl revt = { IRichEditOle_fnImportDataObject }; +static HRESULT WINAPI +ITextDocument_fnQueryInterface(ITextDocument* me, REFIID riid, + void** ppvObject) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + return IRichEditOle_fnQueryInterface((IRichEditOle*)&This->lpRichEditOleVtbl, + riid, ppvObject); +} + +static ULONG WINAPI +ITextDocument_fnAddRef(ITextDocument* me) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + return IRichEditOle_fnAddRef((IRichEditOle*)&This->lpRichEditOleVtbl); +} + +static ULONG WINAPI +ITextDocument_fnRelease(ITextDocument* me) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + return IRichEditOle_fnRelease((IRichEditOle*)&This->lpRichEditOleVtbl); +} + +static HRESULT WINAPI +ITextDocument_fnGetTypeInfoCount(ITextDocument* me, + UINT* pctinfo) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnGetTypeInfo(ITextDocument* me, UINT iTInfo, LCID lcid, + ITypeInfo** ppTInfo) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnGetIDsOfNames(ITextDocument* me, REFIID riid, + LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnInvoke(ITextDocument* me, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, + VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnGetName(ITextDocument* me, BSTR* pName) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnGetSelection(ITextDocument* me, ITextSelection** ppSel) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnGetStoryCount(ITextDocument* me, long* pCount) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnGetStoryRanges(ITextDocument* me, + ITextStoryRanges** ppStories) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnGetSaved(ITextDocument* me, long* pValue) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnSetSaved(ITextDocument* me, long Value) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnGetDefaultTabStop(ITextDocument* me, float* pValue) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnSetDefaultTabStop(ITextDocument* me, float Value) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnNew(ITextDocument* me) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnOpen(ITextDocument* me, VARIANT* pVar, long Flags, + long CodePage) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnSave(ITextDocument* me, VARIANT* pVar, long Flags, + long CodePage) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnFreeze(ITextDocument* me, long* pCount) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnUnfreeze(ITextDocument* me, long* pCount) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnBeginEditCollection(ITextDocument* me) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnEndEditCollection(ITextDocument* me) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnUndo(ITextDocument* me, long Count, long* prop) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnRedo(ITextDocument* me, long Count, long* prop) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnRange(ITextDocument* me, long cp1, long cp2, + ITextRange** ppRange) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI +ITextDocument_fnRangeFromPoint(ITextDocument* me, long x, long y, + ITextRange** ppRange) +{ + IRichEditOleImpl *This = impl_from_ITextDocument(me); + FIXME("stub %p\n",This); + return E_NOTIMPL; +} + +static const ITextDocumentVtbl tdvt = { + ITextDocument_fnQueryInterface, + ITextDocument_fnAddRef, + ITextDocument_fnRelease, + ITextDocument_fnGetTypeInfoCount, + ITextDocument_fnGetTypeInfo, + ITextDocument_fnGetIDsOfNames, + ITextDocument_fnInvoke, + ITextDocument_fnGetName, + ITextDocument_fnGetSelection, + ITextDocument_fnGetStoryCount, + ITextDocument_fnGetStoryRanges, + ITextDocument_fnGetSaved, + ITextDocument_fnSetSaved, + ITextDocument_fnGetDefaultTabStop, + ITextDocument_fnSetDefaultTabStop, + ITextDocument_fnNew, + ITextDocument_fnOpen, + ITextDocument_fnSave, + ITextDocument_fnFreeze, + ITextDocument_fnUnfreeze, + ITextDocument_fnBeginEditCollection, + ITextDocument_fnEndEditCollection, + ITextDocument_fnUndo, + ITextDocument_fnRedo, + ITextDocument_fnRange, + ITextDocument_fnRangeFromPoint +}; + LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) { IRichEditOleImpl *reo; @@ -270,7 +533,8 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) if (!reo) return 0; - reo->lpVtbl = &revt; + reo->lpRichEditOleVtbl = &revt; + reo->lpTextDocumentVtbl = &tdvt; reo->ref = 1; reo->editor = editor; TRACE("Created %p\n",reo); diff --git a/include/.gitignore b/include/.gitignore index 46c85ca8a9b..037d5c0557d 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -37,6 +37,7 @@ /shobjidl.h /shtypes.h /strmif.h +/tom.h /unknwn.h /urlmon.h /wtypes.h diff --git a/include/Makefile.in b/include/Makefile.in index d485620c9ff..31260107672 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -43,6 +43,7 @@ WINDOWS_IDL_SRCS = \ shobjidl.idl \ shtypes.idl \ strmif.idl \ + tom.idl \ unknwn.idl \ urlmon.idl \ wtypes.idl \ diff --git a/include/tom.idl b/include/tom.idl new file mode 100644 index 00000000000..91d03b48a37 --- /dev/null +++ b/include/tom.idl @@ -0,0 +1,430 @@ +/* + * Copyright 2006 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "oaidl.idl"; + +typedef enum tagTomConstants +{ + tomFalse = 0, + tomTrue = -1, + tomUndefined = -9999999, + tomToggle = -9999998, + tomAutoColor = -9999997, + tomDefault = -9999996, + tomSuspend = -9999995, + tomResume = -9999994, + tomApplyNow = 0, + tomApplyLater = 1, + tomTrackParms = 2, + tomCacheParms = 3, + tomBackward = 0xc00000001, + tomForward = 0x3ffffffff, + tomMove = 0, + tomExtend = 1, + tomNoSelection = 0, + tomSelectionIP = 1, + tomSelectionNormal = 2, + tomSelectionFrame = 3, + tomSelectionColumn = 4, + tomSelectionRow = 5, + tomSelectionBlock = 6, + tomSelectionInlineShape = 7, + tomSelectionShape = 8, + tomSelStartActive = 1, + tomSelAtEOL = 2, + tomSelOvertype = 4, + tomSelActive = 8, + tomSelReplace = 16, + tomEnd = 0, + tomStart = 32, + tomCollapseEnd = 0, + tomCollapseStart = 1, + tomClientCoord = 256, + tomNone = 0, + tomSingle = 1, + tomWords = 2, + tomDouble = 3, + tomDotted = 4, + tomDash = 5, + tomDashDot = 6, + tomDashDotDot = 7, + tomWave = 8, + tomThick = 9, + tomHair = 10, + tomLineSpaceSingle = 0, + tomLineSpace1pt5 = 1, + tomLineSpaceDouble = 2, + tomLineSpaceAtLeast = 3, + tomLineSpaceExactly = 4, + tomLineSpaceMultiple = 5, + tomAlignLeft = 0, + tomAlignCenter = 1, + tomAlignRight = 2, + tomAlignJustify = 3, + tomAlignDecimal = 3, + tomAlignBar = 4, + tomAlignInterWord = 3, + tomAlignInterLetter = 4, + tomAlignScaled = 5, + tomAlignGlyphs = 6, + tomAlignSnapGrid = 7, + tomSpaces = 0, + tomDots = 1, + tomDashes = 2, + tomLines = 3, + tomThickLines = 4, + tomEquals = 5, + tomTabBack = -3, + tomTabNext = -2, + tomTabHere = -1, + tomListBullet = 1, + tomListNumberAsArabic = 2, + tomListNumberAsLCLetter = 3, + tomListNumberAsUCLetter = 4, + tomListNumberAsLCRoman = 5, + tomListNumberAsUCRoman = 6, + tomListNumberAsSequence = 7, + tomListParentheses = 0x10000, + tomListPeriod = 0x20000, + tomListPlain = 0x30000, + tomCharacter = 1, + tomWord = 2, + tomSentence = 3, + tomParagraph = 4, + tomLine = 5, + tomStory = 6, + tomScreen = 7, + tomSection = 8, + tomColumn = 9, + tomRow = 10, + tomWindow = 11, + tomCell = 12, + tomCharFormat = 13, + tomParaFormat = 14, + tomTable = 15, + tomObject = 16, + tomMatchWord = 2, + tomMatchCase = 4, + tomMatchPattern = 8, + tomUnknownStory = 0, + tomMainTextStory = 1, + tomFootnotesStory = 2, + tomEndnotesStory = 3, + tomCommentsStory = 4, + tomTextFrameStory = 5, + tomEvenPagesHeaderStory = 6, + tomPrimaryHeaderStory = 7, + tomEvenPagesFooterStory = 8, + tomPrimaryFooterStory = 9, + tomFirstPageHeaderStory = 10, + tomFirstPageFooterStory = 11, + tomNoAnimation = 0, + tomLasVegasLights = 1, + tomBlinkingBackground = 2, + tomSparkleText = 3, + tomMarchingBlackAnts = 4, + tomMarchingRedAnts = 5, + tomShimmer = 6, + tomWipeDown = 7, + tomWipeRight = 8, + tomAnimationMax = 8, + tomLowerCase = 0, + tomUpperCase = 1, + tomTitleCase = 2, + tomSentenceCase = 4, + tomToggleCase = 5, + tomReadOnly = 0x100, + tomShareDenyRead = 0x200, + tomShareDenyWrite = 0x400, + tomPasteFile = 0x1000, + tomCreateNew = 0x10, + tomCreateAlways = 0x20, + tomOpenExisting = 0x30, + tomOpenAlways = 0x40, + tomTruncateExisting = 0x50, + tomRTF = 0x1, + tomText = 0x2, + tomHTML = 0x3, + tomWordDocument = 0x4, + tomBold = 0x800000001, + tomItalic = 0x800000002, + tomUnderline = 0x800000004, + tomStrikeout = 0x800000008, + tomProtected = 0x800000010, + tomLink = 0x800000020, + tomSmallCaps = 0x800000040, + tomAllCaps = 0x800000080, + tomHidden = 0x800000100, + tomOutline = 0x800000200, + tomShadow = 0x800000400, + tomEmboss = 0x800000800, + tomImprint = 0x800001000, + tomDisabled = 0x800002000, + tomRevised = 0x800004000, + tomNormalCaret = 0, + tomKoreanBlockCaret = 0x1, + tomIncludeInset = 0x1, + tomIgnoreCurrentFont = 0, + tomMatchFontCharset = 0x1, + tomMatchFontSignature = 0x2, + tomCharset = 0x80000000, + tomRE10Mode = 0x1, + tomNoIME = 0x80000, + tomSelfIME = 0x40000 +} tomConstants; + +interface ITextRange; +interface ITextSelection; +interface ITextStoryRanges; + +[ + object, + uuid(8cc497c0-a1df-11ce-8098-00aa0047be5d) +] +interface ITextDocument : IDispatch +{ + HRESULT GetName([retval, out]BSTR *pName); + HRESULT GetSelection([retval, out]ITextSelection **ppSel); + HRESULT GetStoryCount([retval, out]long *pCount); + HRESULT GetStoryRanges([retval, out]ITextStoryRanges **ppStories); + HRESULT GetSaved([retval, out]long *pValue); + HRESULT SetSaved([in]long Value); + HRESULT GetDefaultTabStop([retval, out]float *pValue); + HRESULT SetDefaultTabStop([in]float Value); + HRESULT New(); + HRESULT Open([in]VARIANT *pVar, [in]long Flags, [in]long CodePage); + HRESULT Save([in]VARIANT *pVar, [in]long Flags, [in]long CodePage); + HRESULT Freeze([retval, out]long *pCount); + HRESULT Unfreeze([retval, out]long *pCount); + HRESULT BeginEditCollection(); + HRESULT EndEditCollection(); + HRESULT Undo([in]long Count, [retval, out]long *prop); + HRESULT Redo([in]long Count, [retval, out]long *prop); + HRESULT Range([in]long cp1, [in]long cp2, [retval, out]ITextRange**ppRange); + HRESULT RangeFromPoint([in]long x, [in]long y, [retval, out]ITextRange**ppRange); +}; + +interface ITextFont; +interface ITextPara; + +[ + object, + uuid(8cc497c2-a1df-11ce-8098-00aa0047be5d) +] +interface ITextRange : IDispatch +{ + HRESULT GetText([retval, out]BSTR *pbstr); + HRESULT SetText([in]BSTR bstr); + HRESULT GetChar([retval, out]long *pch); + HRESULT SetChar([in]long ch); + HRESULT GetDuplicate([retval, out]ITextRange **ppRange); + HRESULT GetFormattedText([retval, out]ITextRange **ppRange); + HRESULT SetFormattedText([in]ITextRange *pRange); + HRESULT GetStart([retval, out]long *pcpFirst); + HRESULT SetStart([in]long cpFirst); + HRESULT GetEnd([retval, out]long *pcpLim); + HRESULT SetEnd([in]long cpLim); + HRESULT GetFont([retval, out]ITextFont **pFont); + HRESULT SetFont([in]ITextFont *pFont); + HRESULT GetPara([retval, out]ITextPara **ppPara); + HRESULT SetPara([in]ITextPara *pPara); + HRESULT GetStoryLength([retval, out]long *pcch); + HRESULT GetStoryType([retval, out]long *pValue); + HRESULT Collapse([in]long bStart); + HRESULT Expand([in]long Unit, [retval, out]long *pDelta); + HRESULT GetIndex([in]long Unit, [retval, out]long *pIndex); + HRESULT SetIndex([in]long Unit, [in]long Index, [in]long Extend); + HRESULT SetRange([in]long cpActive, [in]long cpOther); + HRESULT InRange([in]ITextRange *pRange, [retval, out]long *pb); + HRESULT InStory([in]ITextRange *pRange, [retval, out]long *pb); + HRESULT IsEqual([in]ITextRange *pRange, [retval, out]long *pb); + HRESULT Select(); + HRESULT StartOf([in]long Unit, [in]long Extend, [retval, out]long *pDelta); + HRESULT EndOf([in]long Unit, [in]long Extend, [retval, out]long *pDelta); + HRESULT Move([in]long Unit, [in]long Count, [retval, out]long *pDelta); + HRESULT MoveStart([in]long Unit, [in]long Count, [retval, out]long *pDelta); + HRESULT MoveEnd([in]long Unit, [in]long Count, [retval, out]long *pDelta); + HRESULT MoveWhile([in]VARIANT *Cset, [in]long Count, [retval, out]long *pDelta); + HRESULT MoveStartWhile([in]VARIANT *Cset, [in]long Count, [retval, out]long *pDelta); + HRESULT MoveEndWhile([in]VARIANT *Cset, [in]long Count, [retval, out]long *pDelta); + HRESULT MoveUntil([in]VARIANT *Cset, [in]long Count, [retval, out]long *pDelta); + HRESULT MoveStartUntil([in]VARIANT *Cset, [in]long Count, [retval, out]long *pDelta); + HRESULT MoveEndUntil([in]VARIANT *Cset, [in]long Count, [retval, out]long *pDelta); + HRESULT FindText([in]BSTR bstr, [in]long cch, [in]long Flags, [retval, out]long *pLength); + HRESULT FindTextStart([in]BSTR bstr, [in]long cch, [in]long Flags, [retval, out]long *pLength); + HRESULT FindTextEnd([in]BSTR bstr, [in]long cch, [in]long Flags, [retval, out]long *pLength); + HRESULT Delete([in]long Unit, [in]long Count, [retval, out]long *pDelta); + HRESULT Cut([out]VARIANT *pVar); + HRESULT Copy([out]VARIANT *pVar); + HRESULT Paste([in]VARIANT *pVar, [in]long Format); + HRESULT CanPaste([in]VARIANT *pVar, [in]long Format, [retval, out]long *pb); + HRESULT CanEdit([retval, out]long *pb); + HRESULT ChangeCase([in]long Type); + HRESULT GetPoint([in]long Type, [out]long *cx, [out]long *cy); + HRESULT SetPoint([in]long x, [in]long y, [in]long Type, [in]long Extend); + HRESULT ScrollIntoView([in]long Value); + HRESULT GetEmbeddedObject([retval, out]IUnknown **ppv); +}; + +[ + object, + uuid(8cc497c1-a1df-11ce-8098-00aa0047be5d) +] +interface ITextSelection : ITextRange +{ + HRESULT GetFlags([retval, out]long *pFlags); + HRESULT SetFlags([in]long Flags); + HRESULT GetType([retval, out]long *pType); + HRESULT MoveLeft([in]long Unit, [in]long Count, [in]long Extend, [retval, out]long *pDelta); + HRESULT MoveRight([in]long Unit, [in]long Count, [in]long Extend, [retval, out]long *pDelta); + HRESULT MoveUp([in]long Unit, [in]long Count, [in]long Extend, [retval, out]long *pDelta); + HRESULT MoveDown([in]long Unit, [in]long Count, [in]long Extend, [retval, out]long *pDelta); + HRESULT HomeKey([in]long Unit, [in]long Extend, [retval, out]long *pDelta); + HRESULT EndKey([in]long Unit, [in]long Extend, [retval, out]long *pDelta); + HRESULT TypeText([in]BSTR bstr); +}; + +[ + object, + uuid(8cc497c3-a1df-11ce-8098-00aa0047be5d) +] +interface ITextFont : IDispatch +{ + HRESULT GetDuplicate([retval, out]ITextFont **ppFont); + HRESULT SetDuplicate([in]ITextFont *pFont); + HRESULT CanChange([out]long *pB); + HRESULT IsEqual([in]ITextFont *pFont, [retval, out]long *pB); + HRESULT Reset([in]long Value); + HRESULT GetStyle([retval, out]long *pValue); + HRESULT SetStyle([in]long Value); + HRESULT GetAllCaps([retval, out]long *pValue); + HRESULT SetAllCaps([in]long Value); + HRESULT GetAnimation([retval, out]long *pValue); + HRESULT SetAnimation([in]long Value); + HRESULT GetBackColor([retval, out]long *pValue); + HRESULT SetBackColor([in]long Value); + HRESULT GetBold([retval, out]long *pValue); + HRESULT SetBold([in]long Value); + HRESULT GetEmboss([retval, out]long *pValue); + HRESULT SetEmboss([in]long Value); + HRESULT GetForeColor([retval, out]long *pValue); + HRESULT SetForeColor([in]long Value); + HRESULT GetHidden([retval, out]long *pValue); + HRESULT SetHidden([in]long Value); + HRESULT GetEngrave([retval, out]long *pValue); + HRESULT SetEngrave([in]long Value); + HRESULT GetItalic([retval, out]long *pValue); + HRESULT SetItalic([in]long Value); + HRESULT GetKerning([retval, out]long *pValue); + HRESULT SetKerning([in]long Value); + HRESULT GetLanguageID([retval, out]long *pValue); + HRESULT SetLanguageID([in]long Value); + HRESULT GetName([retval, out]BSTR *pValue); + HRESULT SetName([in]BSTR Value); + HRESULT GetOutline([retval, out]long *pValue); + HRESULT SetOutline([in]long Value); + HRESULT GetPosition([retval, out]long *pValue); + HRESULT SetPosition([in]long Value); + HRESULT GetProtected([retval, out]long *pValue); + HRESULT SetProtected([in]long Value); + HRESULT GetShadow([retval, out]long *pValue); + HRESULT SetShadow([in]long Value); + HRESULT GetSize([retval, out]long *pValue); + HRESULT SetSize([in]long Value); + HRESULT GetSmallCaps([retval, out]long *pValue); + HRESULT SetSmallCaps([in]long Value); + HRESULT GetSpacing([retval, out]float *pValue); + HRESULT SetSpacing([in]float Value); + HRESULT GetStrikeThrough([retval, out]long *pValue); + HRESULT SetStrikeThrough([in]long Value); + HRESULT GetSubscript([retval, out]long *pValue); + HRESULT SetSubscript([in]long Value); + HRESULT GetSuperscript([retval, out]long *pValue); + HRESULT SetSuperscript([in]long Value); + HRESULT GetUnderline([retval, out]long *pValue); + HRESULT SetUnderline([in]long Value); + HRESULT GetWeight([retval, out]long *pValue); + HRESULT SetWeight([in]long Value); +}; + +[ + object, + uuid(8cc497c4-a1df-11ce-8098-00aa0047be5d) +] +interface ITextPara : IDispatch +{ + HRESULT GetDuplicate([retval, out]ITextPara *ppPara); + HRESULT SetDuplicate([in]ITextPara *pPara); + HRESULT CanChange([out]long *pB); + HRESULT IsEqual([in]ITextPara *pPara, [retval, out]long *pB); + HRESULT Reset([in]long Value); + HRESULT GetStyle([retval, out]long *pValue); + HRESULT SetStyle([in]long Value); + HRESULT GetAlignment([retval, out]long *pValue); + HRESULT SetAlignment([in]long Value); + HRESULT GetHyphenation([retval, out]long *pValue); + HRESULT SetHyphenation([in]long Value); + HRESULT GetFirstLineIndent([retval, out]float *pValue); + HRESULT GetKeepTogether([retval, out]long *pValue); + HRESULT SetKeepTogether([in]long Value); + HRESULT GetKeepWithNext([retval, out]long *pValue); + HRESULT SetKeepWithNext([in]long Value); + HRESULT GetLeftIndent([retval, out]float *pValue); + HRESULT GetLineSpacing([retval, out]float *pValue); + HRESULT GetLineSpacingRule([retval, out]long *pValue); + HRESULT GetListAlignment([retval, out]long *pValue); + HRESULT SetListAlignment([in]long Value); + HRESULT GetListLevelIndex([retval, out]long *pValue); + HRESULT SetListLevelIndex([in]long Value); + HRESULT GetListStart([retval, out]long *pValue); + HRESULT SetListStart([in]long Value); + HRESULT GetListTab([retval, out]long *pValue); + HRESULT SetListTab([in]long Value); + HRESULT GetListType([retval, out]long *pValue); + HRESULT SetListType([in]long Value); + HRESULT GetNoLineNumber([retval, out]long *pValue); + HRESULT SetNoLineNumber([in]long Value); + HRESULT GetPageBreakBefore([retval, out]long *pValue); + HRESULT SetPageBreakBefore([in]long Value); + HRESULT GetRightIndent([retval, out]float *pValue); + HRESULT SetRightIndent([in]float Value); + HRESULT SetIndents([in]float StartIndent, [in]float LeftIndent, [in]float RightIndent); + HRESULT SetLineSpacing([in]long LineSpacingRule, [in]float LineSpacing); + HRESULT GetSpaceAfter([retval, out]float *pValue); + HRESULT SetSpaceAfter([in]float Value); + HRESULT GetSpaceBefore([retval, out]float *pValue); + HRESULT SetSpaceBefore([in]float Value); + HRESULT GetWindowControl([retval, out]float *pValue); + HRESULT SetWindowControl([in]float Value); + HRESULT GetTabCount([retval, out]long *pCount); + HRESULT AddTab([in]float tbPos, [in]long tbAlign, [in]long tbLeader); + HRESULT ClearAllTabs(); + HRESULT DeleteTab([in]float tbPos); + HRESULT GetTab([in]long iTab, [out]float *ptbPos, [out]long *ptbAlign, [out]long *ptbLeader); +}; + +[ + object, + uuid(8cc497c5-a1df-11ce-8098-00aa0047be5d) +] +interface ITextStoryRanges : IDispatch +{ + HRESULT _NewEnum([retval, out]IUnknown **ppUnkEnum); + HRESULT Item([in]long Index, [retval, out]ITextRange **ppRange); + HRESULT GetCount([retval, out]long *pCount); +};