NVDA Helper
In-process and lite high-speed utilities for NVDA
|
a a field node that represents a control in a buffer. More...
#include <storage.h>
Public Member Functions | |
bool | getIdentifier (int *docHandle, int *ID) |
retreaves the node's doc handle and ID. | |
virtual std::wstring | getDebugInfo () const |
![]() | |
bool | matchAttributes (const std::vector< std::wstring > &attribs, const std::wregex ®exp) |
work out if the attributes in the given string exist on this node. | |
VBufStorage_controlFieldNode_t * | getParent () |
points to this node's parent control field node. | |
VBufStorage_fieldNode_t * | getPrevious () |
points to the node directly before this node that shares the same parent as this node. | |
VBufStorage_fieldNode_t * | getNext () |
points to the node directly after this node that shares the same parent as this node. | |
VBufStorage_fieldNode_t * | getFirstChild () |
points to this node's first child. | |
VBufStorage_fieldNode_t * | getLastChild () |
points to this node's last child. | |
bool | addAttribute (const std::wstring &name, const std::wstring &value) |
Adds an attribute to this field. | |
std::optional< std::wstring > | getAttribute (const std::wstring &name) |
Gets an attribute value for this field. | |
std::wstring | getAttributesString () const |
virtual void | getTextInRange (int startOffset, int endOffset, std::wstring &text, bool useMarkup=false, bool(*filter)(VBufStorage_fieldNode_t *)=NULL) |
fetches the text between given offsets in this node and its descendants, with optional markup. | |
int | getLength () |
Retreave the length of this node. | |
Public Attributes | |
const VBufStorage_controlFieldNodeIdentifier_t | identifier |
uniquely identifies this control in its buffer. | |
bool | requiresParentUpdate {false} |
If true, When this node is invalidated in a backend, its parent will be invalidated instead. | |
bool | allowReuseInAncestorUpdate {true} |
If true, this node is allowing itself to be reused within a subtree that is being re-rendered. | |
bool | denyReuseIfPreviousSiblingsChanged {false} |
If True, this node cannot be moved and reused within a subtree being re-rendered, if its previous siblings have changed in anyway. | |
bool | alwaysRerenderChildren {false} |
If true, this node's children will always be re-rendered along with this node when being re-rendered. | |
bool | alwaysRerenderDescendants {false} |
If true, all this node's descendants will always be re-rendered along with this node when being re-rendered. | |
![]() | |
bool | isBlock |
true if this field should cause a line break at its start and end when a buffer is calculating lines. | |
bool | isHidden |
True if this node his hidden - searches will not locate this node. | |
Protected Member Functions | |
virtual void | generateMarkupTagName (std::wstring &text) |
generates this field's markup tag name | |
virtual void | generateAttributesForMarkupOpeningTag (std::wstring &text, int startOffset, int endOffset) |
Generates the attributes within a markup opening tag. | |
virtual void | disassociateFromBuffer (VBufStorage_buffer_t *buffer) |
Disassociates this node from its buffer. | |
VBufStorage_controlFieldNode_t (int docHandle, int ID, bool isBlock) | |
constructor. | |
![]() | |
VBufStorage_fieldNode_t * | nextNodeInTree (int direction, VBufStorage_fieldNode_t *limitNode, int *relativeStartOffset) |
moves to the next node, in depth-first order. | |
int | calculateOffsetInTree () const |
Calculates the offset for this node relative to the surrounding tree. | |
virtual VBufStorage_textFieldNode_t * | locateTextFieldNodeAtOffset (int offset, int *relativeOffset) |
Locates the descendant textFieldNode that is positioned at the given offset in this node. | |
void | generateMarkupOpeningTag (std::wstring &text, int startOffset, int endOffset) |
generates a markup opening tag for this field. | |
void | generateMarkupClosingTag (std::wstring &text) |
generates a markup closing tag for this field. | |
VBufStorage_fieldNode_t (int length, bool isBlock) | |
constructor. | |
virtual | ~VBufStorage_fieldNode_t () |
destructor | |
Friends | |
class | VBufStorage_buffer_t |
Additional Inherited Members | |
![]() | |
VBufStorage_controlFieldNode_t * | parent |
points to this node's parent control field node. | |
VBufStorage_fieldNode_t * | previous |
points to the node directly before this node that shares the same parent as this node. | |
VBufStorage_fieldNode_t * | next |
points to the node directly after this node that shares the same parent as this node. | |
VBufStorage_fieldNode_t * | firstChild |
points to this node's first child. | |
VBufStorage_fieldNode_t * | lastChild |
points to this node's last child. | |
int | length |
The length of this node in characters. | |
VBufStorage_attributeMap_t | attributes |
a map to hold attributes for this field. | |
a a field node that represents a control in a buffer.
Control fields contain other control fields or text fields, they can also be uniquely identified.
|
protected |
constructor.
docHandle | the docHandle of the control |
ID | the ID of the control |
isBlock | lines lines should always break at the start and end of this control in a buffer. |
References VBufStorage_controlFieldNodeIdentifier_t::docHandle, VBufStorage_controlFieldNodeIdentifier_t::ID, identifier, and LOG_DEBUG.
|
protectedvirtual |
generates this field's markup tag name
text | where to place the generated name |
Implements VBufStorage_fieldNode_t.
Reimplemented in VBufStorage_referenceNode_t.
|
protectedvirtual |
Generates the attributes within a markup opening tag.
text | where to place the generated text |
the | offset within the node where text is being requested from |
the | offset within the node the text is being requested to. |
Reimplemented from VBufStorage_fieldNode_t.
Reimplemented in MshtmlVBufStorage_controlFieldNode_t.
References VBufStorage_controlFieldNodeIdentifier_t::docHandle, VBufStorage_fieldNode_t::generateAttributesForMarkupOpeningTag(), VBufStorage_controlFieldNodeIdentifier_t::ID, and identifier.
Referenced by MshtmlVBufStorage_controlFieldNode_t::generateAttributesForMarkupOpeningTag().
|
protectedvirtual |
Disassociates this node from its buffer.
buffer | the buffer to disassociate from |
Reimplemented from VBufStorage_fieldNode_t.
References VBufStorage_fieldNode_t::disassociateFromBuffer(), VBufStorage_buffer_t::forgetControlFieldNode(), LOG_DEBUG, and nhAssert.
retreaves the node's doc handle and ID.
docHandle | a memory location in which the doc handle will be placed. |
ID | the memory location in which the ID will be placed. |
References VBufStorage_controlFieldNodeIdentifier_t::docHandle, VBufStorage_controlFieldNodeIdentifier_t::ID, and identifier.
Referenced by VBufBackend_t::update().
|
virtual |
Reimplemented from VBufStorage_fieldNode_t.
References allowReuseInAncestorUpdate, alwaysRerenderChildren, denyReuseIfPreviousSiblingsChanged, VBufStorage_controlFieldNodeIdentifier_t::docHandle, VBufStorage_fieldNode_t::getDebugInfo(), VBufStorage_controlFieldNodeIdentifier_t::ID, identifier, and requiresParentUpdate.
Referenced by VBufStorage_buffer_t::addControlFieldNode(), VBufStorage_buffer_t::addControlFieldNode(), VBufStorage_buffer_t::insertNode(), VBufBackend_t::invalidateSubtree(), VBufStorage_buffer_t::locateControlFieldNodeAtOffset(), VBufBackend_t::update(), and MshtmlVBufStorage_controlFieldNode_t::~MshtmlVBufStorage_controlFieldNode_t().
|
friend |
const VBufStorage_controlFieldNodeIdentifier_t VBufStorage_controlFieldNode_t::identifier |
uniquely identifies this control in its buffer.
Referenced by VBufStorage_buffer_t::addControlFieldNode(), VBufStorage_buffer_t::addReferenceNodeToBuffer(), VBufStorage_buffer_t::forgetControlFieldNode(), generateAttributesForMarkupOpeningTag(), getDebugInfo(), getIdentifier(), VBufStorage_buffer_t::getIdentifierFromControlFieldNode(), VBufStorage_buffer_t::locateControlFieldNodeAtOffset(), VBufStorage_buffer_t::replaceSubtrees(), and VBufStorage_controlFieldNode_t().
bool VBufStorage_controlFieldNode_t::requiresParentUpdate {false} |
If true, When this node is invalidated in a backend, its parent will be invalidated instead.
Parent invalidation is also recursive, so that if the parent node sets this variable to true, then the first ancestor that does not set this to true is used for invalidation. An example where this might be set is on parts of a table where it is necessary for the table itself to be re-rendered if any part changes.
Referenced by MshtmlVBufBackend_t::fillVBuf(), getDebugInfo(), and VBufBackend_t::invalidateSubtree().
bool VBufStorage_controlFieldNode_t::allowReuseInAncestorUpdate {true} |
If true, this node is allowing itself to be reused within a subtree that is being re-rendered.
This is true by default, but may be set to false if this node or a descendant needs to be re-rendered but its requiresParentUpdate is true. In that case, the re-render will happen higher up in the ancestors, but ensures that this node is not reused.
Referenced by MshtmlVBufBackend_t::fillVBuf(), getDebugInfo(), VBufBackend_t::invalidateSubtree(), and markNodeAsNonreusableIfInAncestor().
bool VBufStorage_controlFieldNode_t::denyReuseIfPreviousSiblingsChanged {false} |
If True, this node cannot be moved and reused within a subtree being re-rendered, if its previous siblings have changed in anyway.
An example might be where a table is re-rendered and a new row is added in the middle. In this case, all rows and cells after the new row must not be reused as their table coordinates would have changed.
Referenced by getDebugInfo().
bool VBufStorage_controlFieldNode_t::alwaysRerenderChildren {false} |
If true, this node's children will always be re-rendered along with this node when being re-rendered.
For example: a table row might set this to ensure that if it is re-rendered, all its cells are as well.
Referenced by getDebugInfo(), and VBufBackend_t::reuseExistingNodeInRender().
bool VBufStorage_controlFieldNode_t::alwaysRerenderDescendants {false} |
If true, all this node's descendants will always be re-rendered along with this node when being re-rendered.
Referenced by VBufStorage_buffer_t::addControlFieldNode(), MshtmlVBufBackend_t::fillVBuf(), GeckoVBufBackend_t::renderThread_winEventProcHook(), and VBufBackend_t::reuseExistingNodeInRender().