本文整理汇总了C++中AccessibleWrap::Document方法的典型用法代码示例。如果您正苦于以下问题:C++ AccessibleWrap::Document方法的具体用法?C++ AccessibleWrap::Document怎么用?C++ AccessibleWrap::Document使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccessibleWrap
的用法示例。
在下文中一共展示了AccessibleWrap::Document方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectionMgr
STDMETHODIMP
ia2Accessible::get_accessibleWithCaret(IUnknown** aAccessible,
long* aCaretOffset)
{
if (!aAccessible || !aCaretOffset)
return E_INVALIDARG;
*aAccessible = nullptr;
*aCaretOffset = -1;
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
int32_t caretOffset = -1;
Accessible* accWithCaret = SelectionMgr()->AccessibleWithCaret(&caretOffset);
if (!accWithCaret || acc->Document() != accWithCaret->Document())
return S_FALSE;
Accessible* child = accWithCaret;
while (!child->IsDoc() && child != acc)
child = child->Parent();
if (child != acc)
return S_FALSE;
*aAccessible = static_cast<IAccessible2*>(
static_cast<AccessibleWrap*>(accWithCaret));
(*aAccessible)->AddRef();
*aCaretOffset = caretOffset;
return S_OK;
}
示例2:
// XXX Use MOZ_CAN_RUN_SCRIPT_BOUNDARY for now due to bug 1543294.
MOZ_CAN_RUN_SCRIPT_BOUNDARY STDMETHODIMP
ia2Accessible::scrollTo(enum IA2ScrollType aScrollType) {
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED;
MOZ_ASSERT(!acc->IsProxy());
RefPtr<PresShell> presShell = acc->Document()->PresShellPtr();
nsCOMPtr<nsIContent> content = acc->GetContent();
nsCoreUtils::ScrollTo(presShell, content, aScrollType);
return S_OK;
}
示例3:
STDMETHODIMP
ia2Accessible::scrollTo(enum IA2ScrollType aScrollType)
{
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
MOZ_ASSERT(!acc->IsProxy());
nsCoreUtils::ScrollTo(acc->Document()->PresShell(), acc->GetContent(),
aScrollType);
return S_OK;
}
示例4: CacheFocusPath
void DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible) {
mFocusPath.Clear();
if (IPCAccessibilityActive()) {
DocAccessibleChild* ipcDoc = IPCDoc();
nsTArray<BatchData> cacheData;
for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent();
acc = static_cast<AccessibleWrap*>(acc->Parent())) {
auto uid = acc->IsDoc() && acc->AsDoc()->IPCDoc()
? 0
: reinterpret_cast<uint64_t>(acc->UniqueID());
nsAutoString name;
acc->Name(name);
nsAutoString textValue;
acc->Value(textValue);
nsAutoString nodeID;
acc->WrapperDOMNodeID(nodeID);
nsCOMPtr<nsIPersistentProperties> props = acc->Attributes();
nsTArray<Attribute> attributes;
nsAccUtils::PersistentPropertiesToArray(props, &attributes);
cacheData.AppendElement(BatchData(
acc->Document()->IPCDoc(), uid, acc->State(), acc->Bounds(),
acc->ActionCount(), name, textValue, nodeID, acc->CurValue(),
acc->MinValue(), acc->MaxValue(), acc->Step(), attributes));
mFocusPath.Put(acc->UniqueID(), acc);
}
ipcDoc->SendBatch(eBatch_FocusPath, cacheData);
} else if (SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(this)) {
nsTArray<AccessibleWrap*> accessibles;
for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent();
acc = static_cast<AccessibleWrap*>(acc->Parent())) {
accessibles.AppendElement(acc);
}
sessionAcc->ReplaceFocusPathCache(accessibles);
}
}