ITextDocument
ITextDocument
ITextDocument
ITextDocument
Interface
Definition
Provides access to the content of a document, providing a way to load and save the document to a stream, retrieve text ranges, get the active selection, set default formatting attributes, and so on.
public : interface ITextDocumentpublic interface ITextDocumentPublic Interface ITextDocument// This API is not available in Javascript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Properties
DefaultTabStop DefaultTabStop DefaultTabStop DefaultTabStop
Gets or sets the default tab spacing.
public : float DefaultTabStop { get; set; }public float DefaultTabStop { get; set; }Public ReadWrite Property DefaultTabStop As float// This API is not available in Javascript.
- Value
- float float float float
The new default tab spacing. The default value is 36.0 points, or 0.5 inches.
Remarks
The default tab spacing is used whenever no tab exists beyond the desired display position.
Selection Selection Selection Selection
Gets the active text selection.
public : ITextSelection Selection { get; }public ITextSelection Selection { get; }Public ReadOnly Property Selection As ITextSelection// This API is not available in Javascript.
The active text selection.
UndoLimit UndoLimit UndoLimit UndoLimit
Gets or sets the maximum number of actions that can be stored in the undo queue.
public : unsigned int UndoLimit { get; set; }public uint UndoLimit { get; set; }Public ReadWrite Property UndoLimit As uint// This API is not available in Javascript.
- Value
- unsigned int uint uint uint
The maximum number of undo actions.
- See Also
Methods
ApplyDisplayUpdates() ApplyDisplayUpdates() ApplyDisplayUpdates() ApplyDisplayUpdates()
Decrements an internal counter that controls whether text updates are displayed immediately or batched.
public : int ApplyDisplayUpdates()public int ApplyDisplayUpdates()Public Function ApplyDisplayUpdates() As int// This API is not available in Javascript.
The value of the internal counter.
Remarks
If the internal counter goes to zero, text updates are displayed immediately instead of batched.
This method cannot decrement the internal counter below zero, and no error occurs if it is called when the counter is already zero.
To increment the internal counter, call the ITextDocument.BatchDisplayUpdates method.
Note
If undo grouping is on (see ITextDocument.BeginUndoGroup ), screen updating is suppressed regardless of the internal counter's value.
- See Also
BatchDisplayUpdates() BatchDisplayUpdates() BatchDisplayUpdates() BatchDisplayUpdates()
Increments an internal counter that controls whether text updates are displayed immediately or batched.
public : int BatchDisplayUpdates()public int BatchDisplayUpdates()Public Function BatchDisplayUpdates() As int// This API is not available in Javascript.
The value of the internal counter.
Remarks
If the internal counter is nonzero, text updates are batched. This lets you perform a sequence of editing operations without the performance loss and flicker of screen updating.
To decrement the internal counter, call the ITextDocument.ApplyDisplayUpdates method.
Note
If undo grouping is on (see ITextDocument.BeginUndoGroup ), screen updating is suppressed regardless of the internal counter's value.
- See Also
BeginUndoGroup() BeginUndoGroup() BeginUndoGroup() BeginUndoGroup()
Turns on undo grouping.
public : void BeginUndoGroup()public void BeginUndoGroup()Public Function BeginUndoGroup() As void// This API is not available in Javascript.
Remarks
An undo group collects undo anti-events for editing changes even when additional undo groups would normally be created. For example, typing anti-events are normally grouped into a single undo group that can be undone with a single Ctrl+Z key combination. A paste or change in insertion point terminates the current undo group and starts another. After you call BeginUndoGroup, such terminations do not occur; only one undo group is used until you call the EndUndoGroup method. The entire group is undone by a single Ctrl+Z key combination.
When undo grouping is on:
- The undo manager adds undo anti-events for text changes to the current undo group.
- A single undo command executes all of the undo anti-events in the undo group. This restores the text state to the one that was active when undo grouping was turned on.
- See Also
CanCopy() CanCopy() CanCopy() CanCopy()
Determines whether document content can be copied to the Clipboard.
public : PlatForm::Boolean CanCopy()public bool CanCopy()Public Function CanCopy() As bool// This API is not available in Javascript.
True if copying to the Clipboard is allowed; otherwise false.
Remarks
Copying is allowed unless the document is copy-protected.
- See Also
CanPaste() CanPaste() CanPaste() CanPaste()
Determines whether the Clipboard has content that can be pasted into the document.
public : PlatForm::Boolean CanPaste()public bool CanPaste()Public Function CanPaste() As bool// This API is not available in Javascript.
True if the Clipboard has content that can be pasted into the document; otherwise false.
Remarks
Pasting is allowed unless the control is read-only or the selection is protected and the client refuses permission to paste.
- See Also
CanRedo() CanRedo() CanRedo() CanRedo()
Determines whether one or more redo operations exist.
public : PlatForm::Boolean CanRedo()public bool CanRedo()Public Function CanRedo() As bool// This API is not available in Javascript.
True if one or more redo operations exist; otherwise false.
- See Also
CanUndo() CanUndo() CanUndo() CanUndo()
Determines whether one or more undo operations exist.
public : PlatForm::Boolean CanUndo()public bool CanUndo()Public Function CanUndo() As bool// This API is not available in Javascript.
True if one or more undo operations exist; otherwise false.
- See Also
EndUndoGroup() EndUndoGroup() EndUndoGroup() EndUndoGroup()
Turns off undo grouping.
public : void EndUndoGroup()public void EndUndoGroup()Public Function EndUndoGroup() As void// This API is not available in Javascript.
- See Also
GetDefaultCharacterFormat() GetDefaultCharacterFormat() GetDefaultCharacterFormat() GetDefaultCharacterFormat()
Retrieves the default character formatting attributes of the document.
public : ITextCharacterFormat GetDefaultCharacterFormat()public ITextCharacterFormat GetDefaultCharacterFormat()Public Function GetDefaultCharacterFormat() As ITextCharacterFormat// This API is not available in Javascript.
The default character formatting attributes.
- See Also
GetDefaultParagraphFormat() GetDefaultParagraphFormat() GetDefaultParagraphFormat() GetDefaultParagraphFormat()
Retrieves the default paragraph formatting attributes of the document.
public : ITextParagraphFormat GetDefaultParagraphFormat()public ITextParagraphFormat GetDefaultParagraphFormat()Public Function GetDefaultParagraphFormat() As ITextParagraphFormat// This API is not available in Javascript.
The default paragraph formatting attributes.
- See Also
GetRange(Int32, Int32) GetRange(Int32, Int32) GetRange(Int32, Int32) GetRange(Int32, Int32)
Retrieves a new text range for the active story of the document.
public : ITextRange GetRange(int startPosition, int endPosition)public ITextRange GetRange(Int32 startPosition, Int32 endPosition)Public Function GetRange(startPosition As Int32, endPosition As Int32) As ITextRange// This API is not available in Javascript.
- startPosition
- int Int32 Int32 Int32
The starting position of the new text range, relative to the beginning of the story.
- endPosition
- int Int32 Int32 Int32
The ending position of the new text range.
The new text range.
- See Also
GetRangeFromPoint(Point, PointOptions) GetRangeFromPoint(Point, PointOptions) GetRangeFromPoint(Point, PointOptions) GetRangeFromPoint(Point, PointOptions)
Retrieves the degenerate (empty) text range at, or nearest to, a particular point on the screen.
public : ITextRange GetRangeFromPoint(Point point, PointOptions options)public ITextRange GetRangeFromPoint(Point point, PointOptions options)Public Function GetRangeFromPoint(point As Point, options As PointOptions) As ITextRange// This API is not available in Javascript.
The alignment type of the specified point.
The text range object.
- See Also
GetText(TextGetOptions, String) GetText(TextGetOptions, String) GetText(TextGetOptions, String) GetText(TextGetOptions, String)
Gets the text in the active story (document).
public : void GetText(TextGetOptions options, PlatForm::String value)public void GetText(TextGetOptions options, String value)Public Function GetText(options As TextGetOptions, value As String) As void// This API is not available in Javascript.
The text retrieval options.
- value
- PlatForm::String String String String
The text in the active story.
- See Also
LoadFromStream(TextSetOptions, IRandomAccessStream) LoadFromStream(TextSetOptions, IRandomAccessStream) LoadFromStream(TextSetOptions, IRandomAccessStream) LoadFromStream(TextSetOptions, IRandomAccessStream)
Loads a document from a stream.
public : void LoadFromStream(TextSetOptions options, IRandomAccessStream value)public void LoadFromStream(TextSetOptions options, IRandomAccessStream value)Public Function LoadFromStream(options As TextSetOptions, value As IRandomAccessStream) As void// This API is not available in Javascript.
The text options to use for the loading the document.
The random access stream that contains the document.
- See Also
SaveToStream(TextGetOptions, IRandomAccessStream) SaveToStream(TextGetOptions, IRandomAccessStream) SaveToStream(TextGetOptions, IRandomAccessStream) SaveToStream(TextGetOptions, IRandomAccessStream)
Saves the document to a stream.
public : void SaveToStream(TextGetOptions options, IRandomAccessStream value)public void SaveToStream(TextGetOptions options, IRandomAccessStream value)Public Function SaveToStream(options As TextGetOptions, value As IRandomAccessStream) As void// This API is not available in Javascript.
The text options for saving the document.
The random access stream for saving the document.
- See Also
SetDefaultCharacterFormat(ITextCharacterFormat) SetDefaultCharacterFormat(ITextCharacterFormat) SetDefaultCharacterFormat(ITextCharacterFormat) SetDefaultCharacterFormat(ITextCharacterFormat)
Sets the default character formatting attributes of the document.
public : void SetDefaultCharacterFormat(ITextCharacterFormat value)public void SetDefaultCharacterFormat(ITextCharacterFormat value)Public Function SetDefaultCharacterFormat(value As ITextCharacterFormat) As void// This API is not available in Javascript.
The new default character formatting attributes.
- See Also
SetDefaultParagraphFormat(ITextParagraphFormat) SetDefaultParagraphFormat(ITextParagraphFormat) SetDefaultParagraphFormat(ITextParagraphFormat) SetDefaultParagraphFormat(ITextParagraphFormat)
Sets the default paragraph formatting attributes of the document.
public : void SetDefaultParagraphFormat(ITextParagraphFormat value)public void SetDefaultParagraphFormat(ITextParagraphFormat value)Public Function SetDefaultParagraphFormat(value As ITextParagraphFormat) As void// This API is not available in Javascript.
The default paragraph formatting attributes.
- See Also
SetText(TextSetOptions, String) SetText(TextSetOptions, String) SetText(TextSetOptions, String) SetText(TextSetOptions, String)
Sets the text of the document.
public : void SetText(TextSetOptions options, PlatForm::String value)public void SetText(TextSetOptions options, String value)Public Function SetText(options As TextSetOptions, value As String) As void// This API is not available in Javascript.
Options controlling how the text is inserted into the document.
- value
- PlatForm::String String String String
The new text.
Remarks
If the string is NULL, the text in the document is deleted.
- See Also