本文整理汇总了C++中Accessible::NextSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ Accessible::NextSibling方法的具体用法?C++ Accessible::NextSibling怎么用?C++ Accessible::NextSibling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accessible
的用法示例。
在下文中一共展示了Accessible::NextSibling方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cache
Accessible*
nsAccessiblePivot::SearchForward(Accessible* aAccessible,
nsIAccessibleTraversalRule* aRule,
bool aSearchCurrent,
nsresult* aResult)
{
*aResult = NS_OK;
// Initial position could be not set, in that case begin search from root.
Accessible* root = GetActiveRoot();
Accessible* accessible = (!aAccessible) ? root : aAccessible;
RuleCache cache(aRule);
uint16_t filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
accessible = AdjustStartPosition(accessible, cache, &filtered, aResult);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (aSearchCurrent && (filtered & nsIAccessibleTraversalRule::FILTER_MATCH))
return accessible;
while (true) {
Accessible* firstChild = nullptr;
while (!(filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) &&
(firstChild = accessible->FirstChild())) {
accessible = firstChild;
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
return accessible;
}
Accessible* sibling = nullptr;
Accessible* temp = accessible;
do {
if (temp == root)
break;
sibling = temp->NextSibling();
if (sibling)
break;
} while ((temp = temp->Parent()));
if (!sibling)
break;
accessible = sibling;
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
return accessible;
}
return nullptr;
}
示例2: while
void
TextRange::Text(nsAString& aText) const
{
Accessible* current = mStartContainer->GetChildAtOffset(mStartOffset);
uint32_t startIntlOffset =
mStartOffset - mStartContainer->GetChildOffset(current);
while (current && TextInternal(aText, current, startIntlOffset)) {
current = current->Parent();
if (!current)
break;
current = current->NextSibling();
}
}
示例3: GetActiveRoot
HyperTextAccessible*
nsAccessiblePivot::SearchForText(Accessible* aAccessible, bool aBackward)
{
Accessible* root = GetActiveRoot();
Accessible* accessible = aAccessible;
while (true) {
Accessible* child = nullptr;
while ((child = (aBackward ? accessible->LastChild() :
accessible->FirstChild()))) {
accessible = child;
if (child->IsHyperText())
return child->AsHyperText();
}
Accessible* sibling = nullptr;
Accessible* temp = accessible;
do {
if (temp == root)
break;
if (temp != aAccessible && temp->IsHyperText())
return temp->AsHyperText();
sibling = aBackward ? temp->PrevSibling() : temp->NextSibling();
if (sibling)
break;
} while ((temp = temp->Parent()));
if (!sibling)
break;
accessible = sibling;
if (accessible->IsHyperText())
return accessible->AsHyperText();
}
return nullptr;
}
示例4: TotalItemCount
uint32_t AccGroupInfo::TotalItemCount(Accessible* aContainer,
bool* aIsHierarchical) {
uint32_t itemCount = 0;
switch (aContainer->Role()) {
case roles::TABLE:
if (nsCoreUtils::GetUIntAttr(aContainer->GetContent(),
nsGkAtoms::aria_rowcount,
(int32_t*)&itemCount)) {
break;
}
if (TableAccessible* tableAcc = aContainer->AsTable()) {
return tableAcc->RowCount();
}
break;
case roles::ROW:
if (Accessible* table = nsAccUtils::TableFor(aContainer)) {
if (nsCoreUtils::GetUIntAttr(table->GetContent(),
nsGkAtoms::aria_colcount,
(int32_t*)&itemCount)) {
break;
}
if (TableAccessible* tableAcc = table->AsTable()) {
return tableAcc->ColCount();
}
}
break;
case roles::OUTLINE:
case roles::LIST:
case roles::MENUBAR:
case roles::MENUPOPUP:
case roles::COMBOBOX:
case roles::GROUPING:
case roles::TREE_TABLE:
case roles::COMBOBOX_LIST:
case roles::LISTBOX:
case roles::DEFINITION_LIST:
case roles::EDITCOMBOBOX:
case roles::RADIO_GROUP:
case roles::PAGETABLIST: {
Accessible* childItem = AccGroupInfo::FirstItemOf(aContainer);
if (!childItem) {
childItem = aContainer->FirstChild();
if (childItem && childItem->IsTextLeaf()) {
// First child can be a text leaf, check its sibling for an item.
childItem = childItem->NextSibling();
}
}
if (childItem) {
GroupPos groupPos = childItem->GroupPosition();
itemCount = groupPos.setSize;
if (groupPos.level && aIsHierarchical) {
*aIsHierarchical = true;
}
}
break;
}
default:
break;
}
return itemCount;
}