2 * Copyright 2006 Juan Lang
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 typedef enum tagTomConstants
25 tomUndefined
= -9999999,
27 tomAutoColor
= -9999997,
28 tomDefault
= -9999996,
29 tomSuspend
= -9999995,
35 tomBackward
= 0xc00000001,
36 tomForward
= 0x3ffffffff,
41 tomSelectionNormal
= 2,
42 tomSelectionFrame
= 3,
43 tomSelectionColumn
= 4,
45 tomSelectionBlock
= 6,
46 tomSelectionInlineShape
= 7,
47 tomSelectionShape
= 8,
48 tomSelStartActive
= 1,
69 tomLineSpaceSingle
= 0,
71 tomLineSpaceDouble
= 2,
72 tomLineSpaceAtLeast
= 3,
73 tomLineSpaceExactly
= 4,
74 tomLineSpaceMultiple
= 5,
81 tomAlignInterWord
= 3,
82 tomAlignInterLetter
= 4,
96 tomListNumberAsArabic
= 2,
97 tomListNumberAsLCLetter
= 3,
98 tomListNumberAsUCLetter
= 4,
99 tomListNumberAsLCRoman
= 5,
100 tomListNumberAsUCRoman
= 6,
101 tomListNumberAsSequence
= 7,
102 tomListParentheses
= 0x10000,
103 tomListPeriod
= 0x20000,
104 tomListPlain
= 0x30000,
125 tomMainTextStory
= 1,
126 tomFootnotesStory
= 2,
127 tomEndnotesStory
= 3,
128 tomCommentsStory
= 4,
129 tomTextFrameStory
= 5,
130 tomEvenPagesHeaderStory
= 6,
131 tomPrimaryHeaderStory
= 7,
132 tomEvenPagesFooterStory
= 8,
133 tomPrimaryFooterStory
= 9,
134 tomFirstPageHeaderStory
= 10,
135 tomFirstPageFooterStory
= 11,
137 tomLasVegasLights
= 1,
138 tomBlinkingBackground
= 2,
140 tomMarchingBlackAnts
= 4,
141 tomMarchingRedAnts
= 5,
152 tomShareDenyRead
= 0x200,
153 tomShareDenyWrite
= 0x400,
154 tomPasteFile
= 0x1000,
156 tomCreateAlways
= 0x20,
157 tomOpenExisting
= 0x30,
158 tomOpenAlways
= 0x40,
159 tomTruncateExisting
= 0x50,
163 tomWordDocument
= 0x4,
164 tomBold
= 0x800000001,
165 tomItalic
= 0x800000002,
166 tomUnderline
= 0x800000004,
167 tomStrikeout
= 0x800000008,
168 tomProtected
= 0x800000010,
169 tomLink
= 0x800000020,
170 tomSmallCaps
= 0x800000040,
171 tomAllCaps
= 0x800000080,
172 tomHidden
= 0x800000100,
173 tomOutline
= 0x800000200,
174 tomShadow
= 0x800000400,
175 tomEmboss
= 0x800000800,
176 tomImprint
= 0x800001000,
177 tomDisabled
= 0x800002000,
178 tomRevised
= 0x800004000,
180 tomKoreanBlockCaret
= 0x1,
181 tomIncludeInset
= 0x1,
182 tomIgnoreCurrentFont
= 0,
183 tomMatchFontCharset
= 0x1,
184 tomMatchFontSignature
= 0x2,
185 tomCharset
= 0x80000000,
191 interface ITextRange
;
192 interface ITextSelection
;
193 interface ITextStoryRanges
;
197 uuid(8cc497c0
-a1df
-11ce
-8098-00aa0047be5d
)
199 interface ITextDocument
: IDispatch
201 HRESULT GetName
([retval, out]BSTR *pName
);
202 HRESULT GetSelection
([retval, out]ITextSelection
**ppSel
);
203 HRESULT GetStoryCount
([retval, out]long *pCount
);
204 HRESULT GetStoryRanges
([retval, out]ITextStoryRanges
**ppStories
);
205 HRESULT GetSaved
([retval, out]long *pValue
);
206 HRESULT SetSaved
([in]long Value
);
207 HRESULT GetDefaultTabStop
([retval, out]float *pValue
);
208 HRESULT SetDefaultTabStop
([in]float Value
);
210 HRESULT Open
([in]VARIANT *pVar
, [in]long Flags
, [in]long CodePage
);
211 HRESULT Save
([in]VARIANT *pVar
, [in]long Flags
, [in]long CodePage
);
212 HRESULT Freeze
([retval, out]long *pCount
);
213 HRESULT Unfreeze
([retval, out]long *pCount
);
214 HRESULT BeginEditCollection
();
215 HRESULT EndEditCollection
();
216 HRESULT Undo
([in]long Count
, [retval, out]long *prop
);
217 HRESULT Redo
([in]long Count
, [retval, out]long *prop
);
218 HRESULT Range([in]long cp1
, [in]long cp2
, [retval, out]ITextRange
**ppRange
);
219 HRESULT RangeFromPoint
([in]long x
, [in]long y
, [retval, out]ITextRange
**ppRange
);
227 uuid(8cc497c2
-a1df
-11ce
-8098-00aa0047be5d
)
229 interface ITextRange
: IDispatch
231 HRESULT GetText
([retval, out]BSTR *pbstr
);
232 HRESULT SetText
([in]BSTR bstr);
233 HRESULT GetChar
([retval, out]long *pch
);
234 HRESULT SetChar
([in]long ch
);
235 HRESULT GetDuplicate
([retval, out]ITextRange
**ppRange
);
236 HRESULT GetFormattedText
([retval, out]ITextRange
**ppRange
);
237 HRESULT SetFormattedText
([in]ITextRange
*pRange
);
238 HRESULT GetStart
([retval, out]long *pcpFirst
);
239 HRESULT SetStart
([in]long cpFirst
);
240 HRESULT GetEnd
([retval, out]long *pcpLim
);
241 HRESULT SetEnd
([in]long cpLim
);
242 HRESULT GetFont
([retval, out]ITextFont
**pFont
);
243 HRESULT SetFont
([in]ITextFont
*pFont
);
244 HRESULT GetPara
([retval, out]ITextPara
**ppPara
);
245 HRESULT SetPara
([in]ITextPara
*pPara
);
246 HRESULT GetStoryLength
([retval, out]long *pcch
);
247 HRESULT GetStoryType
([retval, out]long *pValue
);
248 HRESULT Collapse
([in]long bStart
);
249 HRESULT Expand
([in]long Unit
, [retval, out]long *pDelta
);
250 HRESULT GetIndex
([in]long Unit
, [retval, out]long *pIndex
);
251 HRESULT SetIndex
([in]long Unit
, [in]long Index
, [in]long Extend
);
252 HRESULT SetRange
([in]long cpActive
, [in]long cpOther
);
253 HRESULT InRange
([in]ITextRange
*pRange
, [retval, out]long *pb
);
254 HRESULT InStory
([in]ITextRange
*pRange
, [retval, out]long *pb
);
255 HRESULT IsEqual
([in]ITextRange
*pRange
, [retval, out]long *pb
);
257 HRESULT StartOf
([in]long Unit
, [in]long Extend
, [retval, out]long *pDelta
);
258 HRESULT EndOf
([in]long Unit
, [in]long Extend
, [retval, out]long *pDelta
);
259 HRESULT Move
([in]long Unit
, [in]long Count
, [retval, out]long *pDelta
);
260 HRESULT MoveStart
([in]long Unit
, [in]long Count
, [retval, out]long *pDelta
);
261 HRESULT MoveEnd
([in]long Unit
, [in]long Count
, [retval, out]long *pDelta
);
262 HRESULT MoveWhile
([in]VARIANT *Cset
, [in]long Count
, [retval, out]long *pDelta
);
263 HRESULT MoveStartWhile
([in]VARIANT *Cset
, [in]long Count
, [retval, out]long *pDelta
);
264 HRESULT MoveEndWhile
([in]VARIANT *Cset
, [in]long Count
, [retval, out]long *pDelta
);
265 HRESULT MoveUntil
([in]VARIANT *Cset
, [in]long Count
, [retval, out]long *pDelta
);
266 HRESULT MoveStartUntil
([in]VARIANT *Cset
, [in]long Count
, [retval, out]long *pDelta
);
267 HRESULT MoveEndUntil
([in]VARIANT *Cset
, [in]long Count
, [retval, out]long *pDelta
);
268 HRESULT FindText
([in]BSTR bstr, [in]long cch
, [in]long Flags
, [retval, out]long *pLength
);
269 HRESULT FindTextStart
([in]BSTR bstr, [in]long cch
, [in]long Flags
, [retval, out]long *pLength
);
270 HRESULT FindTextEnd
([in]BSTR bstr, [in]long cch
, [in]long Flags
, [retval, out]long *pLength
);
271 HRESULT Delete
([in]long Unit
, [in]long Count
, [retval, out]long *pDelta
);
272 HRESULT Cut
([out]VARIANT *pVar
);
273 HRESULT Copy
([out]VARIANT *pVar
);
274 HRESULT Paste
([in]VARIANT *pVar
, [in]long Format
);
275 HRESULT CanPaste
([in]VARIANT *pVar
, [in]long Format
, [retval, out]long *pb
);
276 HRESULT CanEdit
([retval, out]long *pb
);
277 HRESULT ChangeCase
([in]long Type
);
278 HRESULT GetPoint
([in]long Type
, [out]long *cx
, [out]long *cy
);
279 HRESULT SetPoint
([in]long x
, [in]long y
, [in]long Type
, [in]long Extend
);
280 HRESULT ScrollIntoView
([in]long Value
);
281 HRESULT GetEmbeddedObject
([retval, out]IUnknown
**ppv
);
286 uuid(8cc497c1
-a1df
-11ce
-8098-00aa0047be5d
)
288 interface ITextSelection
: ITextRange
290 HRESULT GetFlags
([retval, out]long *pFlags
);
291 HRESULT SetFlags
([in]long Flags
);
292 HRESULT GetType
([retval, out]long *pType
);
293 HRESULT MoveLeft
([in]long Unit
, [in]long Count
, [in]long Extend
, [retval, out]long *pDelta
);
294 HRESULT MoveRight
([in]long Unit
, [in]long Count
, [in]long Extend
, [retval, out]long *pDelta
);
295 HRESULT MoveUp
([in]long Unit
, [in]long Count
, [in]long Extend
, [retval, out]long *pDelta
);
296 HRESULT MoveDown
([in]long Unit
, [in]long Count
, [in]long Extend
, [retval, out]long *pDelta
);
297 HRESULT HomeKey
([in]long Unit
, [in]long Extend
, [retval, out]long *pDelta
);
298 HRESULT EndKey
([in]long Unit
, [in]long Extend
, [retval, out]long *pDelta
);
299 HRESULT TypeText
([in]BSTR bstr);
304 uuid(8cc497c3
-a1df
-11ce
-8098-00aa0047be5d
)
306 interface ITextFont
: IDispatch
308 HRESULT GetDuplicate
([retval, out]ITextFont
**ppFont
);
309 HRESULT SetDuplicate
([in]ITextFont
*pFont
);
310 HRESULT CanChange
([out]long *pB
);
311 HRESULT IsEqual
([in]ITextFont
*pFont
, [retval, out]long *pB
);
312 HRESULT Reset
([in]long Value
);
313 HRESULT GetStyle
([retval, out]long *pValue
);
314 HRESULT SetStyle
([in]long Value
);
315 HRESULT GetAllCaps
([retval, out]long *pValue
);
316 HRESULT SetAllCaps
([in]long Value
);
317 HRESULT GetAnimation
([retval, out]long *pValue
);
318 HRESULT SetAnimation
([in]long Value
);
319 HRESULT GetBackColor
([retval, out]long *pValue
);
320 HRESULT SetBackColor
([in]long Value
);
321 HRESULT GetBold
([retval, out]long *pValue
);
322 HRESULT SetBold
([in]long Value
);
323 HRESULT GetEmboss
([retval, out]long *pValue
);
324 HRESULT SetEmboss
([in]long Value
);
325 HRESULT GetForeColor
([retval, out]long *pValue
);
326 HRESULT SetForeColor
([in]long Value
);
327 HRESULT GetHidden
([retval, out]long *pValue
);
328 HRESULT SetHidden
([in]long Value
);
329 HRESULT GetEngrave
([retval, out]long *pValue
);
330 HRESULT SetEngrave
([in]long Value
);
331 HRESULT GetItalic
([retval, out]long *pValue
);
332 HRESULT SetItalic
([in]long Value
);
333 HRESULT GetKerning
([retval, out]long *pValue
);
334 HRESULT SetKerning
([in]long Value
);
335 HRESULT GetLanguageID
([retval, out]long *pValue
);
336 HRESULT SetLanguageID
([in]long Value
);
337 HRESULT GetName
([retval, out]BSTR *pValue
);
338 HRESULT SetName
([in]BSTR Value
);
339 HRESULT GetOutline
([retval, out]long *pValue
);
340 HRESULT SetOutline
([in]long Value
);
341 HRESULT GetPosition
([retval, out]long *pValue
);
342 HRESULT SetPosition
([in]long Value
);
343 HRESULT GetProtected
([retval, out]long *pValue
);
344 HRESULT SetProtected
([in]long Value
);
345 HRESULT GetShadow
([retval, out]long *pValue
);
346 HRESULT SetShadow
([in]long Value
);
347 HRESULT GetSize
([retval, out]long *pValue
);
348 HRESULT SetSize
([in]long Value
);
349 HRESULT GetSmallCaps
([retval, out]long *pValue
);
350 HRESULT SetSmallCaps
([in]long Value
);
351 HRESULT GetSpacing
([retval, out]float *pValue
);
352 HRESULT SetSpacing
([in]float Value
);
353 HRESULT GetStrikeThrough
([retval, out]long *pValue
);
354 HRESULT SetStrikeThrough
([in]long Value
);
355 HRESULT GetSubscript
([retval, out]long *pValue
);
356 HRESULT SetSubscript
([in]long Value
);
357 HRESULT GetSuperscript
([retval, out]long *pValue
);
358 HRESULT SetSuperscript
([in]long Value
);
359 HRESULT GetUnderline
([retval, out]long *pValue
);
360 HRESULT SetUnderline
([in]long Value
);
361 HRESULT GetWeight
([retval, out]long *pValue
);
362 HRESULT SetWeight
([in]long Value
);
367 uuid(8cc497c4
-a1df
-11ce
-8098-00aa0047be5d
)
369 interface ITextPara
: IDispatch
371 HRESULT GetDuplicate
([retval, out]ITextPara
*ppPara
);
372 HRESULT SetDuplicate
([in]ITextPara
*pPara
);
373 HRESULT CanChange
([out]long *pB
);
374 HRESULT IsEqual
([in]ITextPara
*pPara
, [retval, out]long *pB
);
375 HRESULT Reset
([in]long Value
);
376 HRESULT GetStyle
([retval, out]long *pValue
);
377 HRESULT SetStyle
([in]long Value
);
378 HRESULT GetAlignment
([retval, out]long *pValue
);
379 HRESULT SetAlignment
([in]long Value
);
380 HRESULT GetHyphenation
([retval, out]long *pValue
);
381 HRESULT SetHyphenation
([in]long Value
);
382 HRESULT GetFirstLineIndent
([retval, out]float *pValue
);
383 HRESULT GetKeepTogether
([retval, out]long *pValue
);
384 HRESULT SetKeepTogether
([in]long Value
);
385 HRESULT GetKeepWithNext
([retval, out]long *pValue
);
386 HRESULT SetKeepWithNext
([in]long Value
);
387 HRESULT GetLeftIndent
([retval, out]float *pValue
);
388 HRESULT GetLineSpacing
([retval, out]float *pValue
);
389 HRESULT GetLineSpacingRule
([retval, out]long *pValue
);
390 HRESULT GetListAlignment
([retval, out]long *pValue
);
391 HRESULT SetListAlignment
([in]long Value
);
392 HRESULT GetListLevelIndex
([retval, out]long *pValue
);
393 HRESULT SetListLevelIndex
([in]long Value
);
394 HRESULT GetListStart
([retval, out]long *pValue
);
395 HRESULT SetListStart
([in]long Value
);
396 HRESULT GetListTab
([retval, out]long *pValue
);
397 HRESULT SetListTab
([in]long Value
);
398 HRESULT GetListType
([retval, out]long *pValue
);
399 HRESULT SetListType
([in]long Value
);
400 HRESULT GetNoLineNumber
([retval, out]long *pValue
);
401 HRESULT SetNoLineNumber
([in]long Value
);
402 HRESULT GetPageBreakBefore
([retval, out]long *pValue
);
403 HRESULT SetPageBreakBefore
([in]long Value
);
404 HRESULT GetRightIndent
([retval, out]float *pValue
);
405 HRESULT SetRightIndent
([in]float Value
);
406 HRESULT SetIndents
([in]float StartIndent
, [in]float LeftIndent
, [in]float RightIndent
);
407 HRESULT SetLineSpacing
([in]long LineSpacingRule
, [in]float LineSpacing
);
408 HRESULT GetSpaceAfter
([retval, out]float *pValue
);
409 HRESULT SetSpaceAfter
([in]float Value
);
410 HRESULT GetSpaceBefore
([retval, out]float *pValue
);
411 HRESULT SetSpaceBefore
([in]float Value
);
412 HRESULT GetWindowControl
([retval, out]float *pValue
);
413 HRESULT SetWindowControl
([in]float Value
);
414 HRESULT GetTabCount
([retval, out]long *pCount
);
415 HRESULT AddTab
([in]float tbPos
, [in]long tbAlign
, [in]long tbLeader
);
416 HRESULT ClearAllTabs
();
417 HRESULT DeleteTab
([in]float tbPos
);
418 HRESULT GetTab
([in]long iTab
, [out]float *ptbPos
, [out]long *ptbAlign
, [out]long *ptbLeader
);
423 uuid(8cc497c5
-a1df
-11ce
-8098-00aa0047be5d
)
425 interface ITextStoryRanges
: IDispatch
427 HRESULT _NewEnum
([retval, out]IUnknown
**ppUnkEnum
);
428 HRESULT Item
([in]long Index
, [retval, out]ITextRange
**ppRange
);
429 HRESULT GetCount
([retval, out]long *pCount
);