Text Documents
PBTextDocument
Opaque object handle: (not documented yet)
This object maintains an internal reference count. When the reference count reaches zero, the object will be automatically deallocated. To increment the reference count, call PBTextDocumentRetain; to decrement the reference count, call PBTextDocumentRelease. These functions are thread-safe.
PBTextDocumentBuilder
Opaque object handle: (not documented yet)
This object maintains an internal reference count. When the reference count reaches zero, the object will be automatically deallocated. To increment the reference count, call PBTextDocumentBuilderRetain; to decrement the reference count, call PBTextDocumentBuilderRelease. These functions are thread-safe.
PBPositionedTextAttribute
Structure: A text attribute and the position from where to apply it.
Fields
start (uint32_t
): A position in the text document string, in bytes. This must be at a UTF-8 codepoint boundary. The text attribute will be applied starting from this offset until either the end of the string, or the next attribute of the same type, whichever comes first.
attribute (PBTextAttribute): The text attribute itself.
PBRangedTextAttribute
Structure: A text attribute and the range in which to apply it.
Fields
start (uint32_t
): A position in the text document string, in bytes. This must be at a UTF-8 codepoint boundary.
end (uint32_t
): A position in the text document string, in bytes. This must be at a UTF-8 codepoint boundary.
attribute (PBTextAttribute): The text attribute itself.
PBMarkdownDocumentFlags
Enumeration/bitset of type uint32_t: Flags controlling the parsing and styling of a markdown document.
Constants
PBMarkdownDocument_WITH_MARGIN
PBMarkdownDocument_WITH_MARGIN = 1<<0
(not documented yet)
PBTextDocumentCreateWithMarkdown
Function: Create a text document by parsing a markdown file.
Syntax (C/C++)
PBTextDocumentPtr _Nullable PBTextDocumentCreateWithMarkdown(
ConstStr markdownText, PBMarkdownDocumentFlags flags);
Syntax (Python)
TextDocumentCreateWithMarkdown(markdownText, flags) -> (document)
Parameters and Return Values
[in] markdownText (referenced string): The document in markdown.
[in] flags (PBMarkdownDocumentFlags): Flags bitwise OR-ed together controlling the parsing and styling of the document.
[out] document (nullable owned PBTextDocument): The created document.
Example (C/C++)
PBTextDocument *document = PBTextDocumentCreateWithMarkdown(
PB_STR("plain *italic* **bold**"), PBMarkdownDocument_WITH_MARGIN);
PBTextDisplayAddWithDocument(container,
PBElement_H_FILL | PBElement_CLIP_LAYER, document);
PBTextDocumentRelease(document);
PBTextDocumentCreateWithPositionedAttributes
Function: (not documented yet)
Syntax (C/C++)
PBTextDocumentPtr _Nullable PBTextDocumentCreateWithPositionedAttributes(
ConstStr contents,
const PBPositionedTextAttribute *_Nullable attributes, size_t attributesCount,
PBTextRoleID defaultsStyleID);
Syntax (Python)
TextDocumentCreateWithPositionedAttributes(contents, attributes, defaultsStyleID) -> (document)
Parameters and Return Values
[in] contents (referenced string): (not documented yet)
[in] attributes (referenced array of PBPositionedTextAttribute): (not documented yet)
[in] defaultsStyleID (PBTextRoleID): (not documented yet)
[out] document (nullable owned PBTextDocument): (not documented yet)
PBTextDocumentCreateWithRangedAttributes
Function: (not documented yet)
Syntax (C/C++)
PBTextDocumentPtr _Nullable PBTextDocumentCreateWithRangedAttributes(
ConstStr contents,
const PBRangedTextAttribute *_Nullable attributes, size_t attributesCount,
PBTextRoleID defaultsStyleID);
Syntax (Python)
TextDocumentCreateWithRangedAttributes(contents, attributes, defaultsStyleID) -> (document)
Parameters and Return Values
[in] contents (referenced string): (not documented yet)
[in] attributes (referenced array of PBRangedTextAttribute): (not documented yet)
[in] defaultsStyleID (PBTextRoleID): (not documented yet)
[out] document (nullable owned PBTextDocument): (not documented yet)
PBTextDocumentIsTextNode
Function: (not documented yet)
Syntax (C/C++)
bool PBTextDocumentIsTextNode(PBTextDocumentRef document);
Syntax (Python)
TextDocumentIsTextNode(document) -> (isTextNode)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[out] isTextNode (bool
): (not documented yet)
PBTextDocumentGetTextLength
Function: (not documented yet)
Syntax (C/C++)
uintptr_t PBTextDocumentGetTextLength(PBTextDocumentRef document);
Syntax (Python)
TextDocumentGetTextLength(document) -> (textLengthInBytes)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[out] textLengthInBytes (uintptr_t
): (not documented yet)
PBTextDocumentCopyTextToBuffer
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentCopyTextToBuffer(PBTextDocumentRef document,
uintptr_t fromByte, uintptr_t toByte, /* in-out */ IOStr * __restrict text);
Syntax (Python)
TextDocumentCopyTextToBuffer(document, fromByte, toByte, text)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[in] fromByte (uintptr_t
): (not documented yet)
[in] toByte (uintptr_t
): (not documented yet)
[in-out] text (string buffer): (not documented yet)
PBTextDocumentGetHyperlinkURLAtOffset
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentGetHyperlinkURLAtOffset(PBTextDocumentRef document,
uintptr_t offsetByte, /* in-out */ IOStr * __restrict url,
/* output */ intptr_t * _Nullable __restrict fromAttributeAtIndex);
Syntax (Python)
TextDocumentGetHyperlinkURLAtOffset(document, offsetByte, url) -> (fromAttributeAtIndex)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[in] offsetByte (uintptr_t
): (not documented yet)
[in-out] url (string buffer): (not documented yet)
[optional-out] fromAttributeAtIndex (intptr_t
): (not documented yet)
PBTextDocumentGetHyperlinkRange
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentGetHyperlinkRange(PBTextDocumentRef document,
uintptr_t fromAttributeAtIndex,
/* output */ uintptr_t * _Nullable __restrict fromByte,
/* output */ uintptr_t * _Nullable __restrict toByte);
Syntax (Python)
TextDocumentGetHyperlinkRange(document, fromAttributeAtIndex) -> (fromByte, toByte)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[in] fromAttributeAtIndex (uintptr_t
): (not documented yet)
[optional-out] fromByte (uintptr_t
): (not documented yet)
[optional-out] toByte (uintptr_t
): (not documented yet)
PBTextDocumentFindTextFlags
Enumeration/bitset of type uint32_t: (not documented yet)
Constants
PBTextDocumentFindText_CASE_SENSITIVE
PBTextDocumentFindText_CASE_SENSITIVE = 1<<0
(not documented yet)
PBTextDocumentFindText_BACKWARDS
PBTextDocumentFindText_BACKWARDS = 1<<1
(not documented yet)
PBTextDocumentFindText
Function: (not documented yet)
Syntax (C/C++)
bool PBTextDocumentFindText(PBTextDocumentRef document, ConstStr needle,
uintptr_t fromByte, uintptr_t toByte, PBTextDocumentFindTextFlags flags,
/* output */ uintptr_t * __restrict index);
Syntax (Python)
TextDocumentFindText(document, needle, fromByte, toByte, flags) -> (didFind, index)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[in] needle (referenced string): (not documented yet)
[in] fromByte (uintptr_t
): (not documented yet)
[in] toByte (uintptr_t
): (not documented yet)
[in] flags (PBTextDocumentFindTextFlags): (not documented yet)
[out] didFind (bool
): (not documented yet)
[out] index (uintptr_t
): (not documented yet)
PBTextDocumentGetChildNodeCount
Function: (not documented yet)
Syntax (C/C++)
uintptr_t PBTextDocumentGetChildNodeCount(PBTextDocumentRef document);
Syntax (Python)
TextDocumentGetChildNodeCount(document) -> (childNodeCount)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[out] childNodeCount (uintptr_t
): (not documented yet)
PBTextDocumentGetChildNode
Function: (not documented yet)
Syntax (C/C++)
PBTextDocumentPtr PBTextDocumentGetChildNode(PBTextDocumentRef document,
uintptr_t index, /* output */ PBTextRoleID * _Nullable __restrict roleID);
Syntax (Python)
TextDocumentGetChildNode(document, index) -> (childNode, roleID)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[in] index (uintptr_t
): (not documented yet)
[out] childNode (owned PBTextDocument): (not documented yet)
[optional-out] roleID (PBTextRoleID): (not documented yet)
PBTextDocumentGetNodeForOffset
Function: (not documented yet)
Syntax (C/C++)
PBTextDocumentPtr PBTextDocumentGetNodeForOffset(PBTextDocumentRef document,
uintptr_t offsetInBytes,
/* output */ uintptr_t * _Nullable __restrict offsetWithinChildNode,
/* output */ PBTextRoleID * _Nullable __restrict roleID);
Syntax (Python)
TextDocumentGetNodeForOffset(document, offsetInBytes) -> (childNode, offsetWithinChildNode, roleID)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[in] offsetInBytes (uintptr_t
): (not documented yet)
[out] childNode (owned PBTextDocument): (not documented yet)
[optional-out] offsetWithinChildNode (uintptr_t
): (not documented yet)
[optional-out] roleID (PBTextRoleID): (not documented yet)
PBTextDocumentFindOffsetOfNode
Function: (not documented yet)
Syntax (C/C++)
uintptr_t PBTextDocumentFindOffsetOfNode(PBTextDocumentRef document,
PBTextDocumentRef descendentNode);
Syntax (Python)
TextDocumentFindOffsetOfNode(document, descendentNode) -> (offset)
Parameters and Return Values
[in] document (referenced PBTextDocument): (not documented yet)
[in] descendentNode (referenced PBTextDocument): (not documented yet)
[out] offset (uintptr_t
): (not documented yet)
PBTextDocumentBuilderCreate
Function: (not documented yet)
Syntax (C/C++)
PBTextDocumentBuilderPtr _Nullable PBTextDocumentBuilderCreate(
PBTextRoleID defaultRole);
Syntax (Python)
TextDocumentBuilderCreate(defaultRole) -> (builder)
Parameters and Return Values
[in] defaultRole (PBTextRoleID): (not documented yet)
[out] builder (nullable owned PBTextDocumentBuilder): (not documented yet)
PBTextDocumentBuilderFinish
Function: (not documented yet)
Syntax (C/C++)
PBTextDocumentPtr _Nullable PBTextDocumentBuilderFinish(
PBTextDocumentBuilderPtr builder);
Syntax (Python)
TextDocumentBuilderFinish(builder) -> (document)
Parameters and Return Values
[in] builder (owned PBTextDocumentBuilder): (not documented yet)
[out] document (nullable owned PBTextDocument): (not documented yet)
PBTextDocumentBuilderAppend
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentBuilderAppend(PBTextDocumentBuilderRef builder,
ConstStr contents,
const PBPositionedTextAttribute *_Nullable attributes, size_t attributesCount);
Syntax (Python)
TextDocumentBuilderAppend(builder, contents, attributes)
Parameters and Return Values
[in] builder (referenced PBTextDocumentBuilder): (not documented yet)
[in] contents (referenced string): (not documented yet)
[in] attributes (referenced array of PBPositionedTextAttribute): (not documented yet)
PBTextDocumentBuilderAppendSoftBreak
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentBuilderAppendSoftBreak(PBTextDocumentBuilderRef builder);
Syntax (Python)
TextDocumentBuilderAppendSoftBreak(builder)
Parameters and Return Values
[in] builder (referenced PBTextDocumentBuilder): (not documented yet)
PBTextDocumentBuilderAppendImage
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentBuilderAppendImage(PBTextDocumentBuilderRef builder,
ConstStr sourceReference, ConstStr alternateText);
Syntax (Python)
TextDocumentBuilderAppendImage(builder, sourceReference, alternateText)
Parameters and Return Values
[in] builder (referenced PBTextDocumentBuilder): (not documented yet)
[in] sourceReference (referenced string): (not documented yet)
[in] alternateText (referenced string): (not documented yet)
PBTextDocumentBuilderOpenListItem
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentBuilderOpenListItem(PBTextDocumentBuilderRef builder,
ConstStr bulletOrNumberText, int32_t indentDp,
const PBPositionedTextAttribute *_Nullable attributes, size_t attributesCount);
Syntax (Python)
TextDocumentBuilderOpenListItem(builder, bulletOrNumberText, indentDp, attributes)
Parameters and Return Values
[in] builder (referenced PBTextDocumentBuilder): (not documented yet)
[in] bulletOrNumberText (referenced string): (not documented yet)
[in] indentDp (int32_t
): (not documented yet)
[in] attributes (referenced array of PBPositionedTextAttribute): (not documented yet)
PBTextDocumentBuilderOpenBlockWithRole
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentBuilderOpenBlockWithRole(PBTextDocumentBuilderRef builder,
PBTextRoleID role);
Syntax (Python)
TextDocumentBuilderOpenBlockWithRole(builder, role)
Parameters and Return Values
[in] builder (referenced PBTextDocumentBuilder): (not documented yet)
[in] role (PBTextRoleID): (not documented yet)
PBTextDocumentBuilderClose
Function: (not documented yet)
Syntax (C/C++)
void PBTextDocumentBuilderClose(PBTextDocumentBuilderRef builder);
Syntax (Python)
TextDocumentBuilderClose(builder)
Parameters and Return Values
[in] builder (referenced PBTextDocumentBuilder): (not documented yet)