本文整理汇总了C++中AccessibleWrap::IsDoc方法的典型用法代码示例。如果您正苦于以下问题:C++ AccessibleWrap::IsDoc方法的具体用法?C++ AccessibleWrap::IsDoc怎么用?C++ AccessibleWrap::IsDoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccessibleWrap
的用法示例。
在下文中一共展示了AccessibleWrap::IsDoc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDocumentAttributesCB
AtkAttributeSet *
getDocumentAttributesCB(AtkDocument *aDocument)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap || !accWrap->IsDoc())
return nullptr;
// according to atkobject.h, AtkAttributeSet is a GSList
GSList* attributes = nullptr;
DocAccessible* document = accWrap->AsDoc();
nsAutoString aURL;
nsresult rv = document->GetURL(aURL);
if (NS_SUCCEEDED(rv))
attributes = prependToList(attributes, kDocUrlName, aURL);
nsAutoString aW3CDocType;
rv = document->GetDocType(aW3CDocType);
if (NS_SUCCEEDED(rv))
attributes = prependToList(attributes, kDocTypeName, aW3CDocType);
nsAutoString aMimeType;
rv = document->GetMimeType(aMimeType);
if (NS_SUCCEEDED(rv))
attributes = prependToList(attributes, kMimeTypeName, aMimeType);
return attributes;
}
示例2: GetAccessibleWrap
AtkAttributeSet *
getDocumentAttributesCB(AtkDocument *aDocument)
{
nsAutoString url;
nsAutoString w3cDocType;
nsAutoString mimeType;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (accWrap) {
if (!accWrap->IsDoc()) {
return nullptr;
}
DocAccessible* document = accWrap->AsDoc();
document->URL(url);
document->DocType(w3cDocType);
document->MimeType(mimeType);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aDocument))) {
proxy->URLDocTypeMimeType(url, w3cDocType, mimeType);
} else {
return nullptr;
}
// according to atkobject.h, AtkAttributeSet is a GSList
GSList* attributes = nullptr;
attributes = prependToList(attributes, kDocUrlName, url);
attributes = prependToList(attributes, kDocTypeName, w3cDocType);
attributes = prependToList(attributes, kMimeTypeName, mimeType);
return attributes;
}
示例3: 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);
}
}
示例4: if
const gchar *
getDocumentAttributeValueCB(AtkDocument *aDocument,
const gchar *aAttrName)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap || !accWrap->IsDoc())
return nullptr;
DocAccessible* document = accWrap->AsDoc();
nsresult rv;
nsAutoString attrValue;
if (!strcasecmp(aAttrName, kDocTypeName))
rv = document->GetDocType(attrValue);
else if (!strcasecmp(aAttrName, kDocUrlName))
rv = document->GetURL(attrValue);
else if (!strcasecmp(aAttrName, kMimeTypeName))
rv = document->GetMimeType(attrValue);
else
return nullptr;
NS_ENSURE_SUCCESS(rv, nullptr);
return attrValue.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(attrValue);
}