本文整理汇总了C++中Accessible::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Accessible::GetName方法的具体用法?C++ Accessible::GetName怎么用?C++ Accessible::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accessible
的用法示例。
在下文中一共展示了Accessible::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parent
nsresult
HTMLTextFieldAccessible::GetNameInternal(nsAString& aName)
{
nsresult rv = Accessible::GetNameInternal(aName);
NS_ENSURE_SUCCESS(rv, rv);
if (!aName.IsEmpty())
return NS_OK;
if (mContent->GetBindingParent())
{
// XXX: bug 459640
// There's a binding parent.
// This means we're part of another control, so use parent accessible for name.
// This ensures that a textbox inside of a XUL widget gets
// an accessible name.
Accessible* parent = Parent();
if (parent)
parent->GetName(aName);
}
if (!aName.IsEmpty())
return NS_OK;
// text inputs and textareas might have useful placeholder text
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, aName);
return NS_OK;
}
示例2: Parent
ENameValueFlag
HTMLTextFieldAccessible::NativeName(nsString& aName)
{
ENameValueFlag nameFlag = Accessible::NativeName(aName);
if (!aName.IsEmpty())
return nameFlag;
if (mContent->GetBindingParent()) {
// XXX: bug 459640
// There's a binding parent.
// This means we're part of another control, so use parent accessible for name.
// This ensures that a textbox inside of a XUL widget gets
// an accessible name.
Accessible* parent = Parent();
if (parent)
parent->GetName(aName);
}
if (!aName.IsEmpty())
return eNameOK;
// text inputs and textareas might have useful placeholder text
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, aName);
return eNameOK;
}
示例3: RelationByType
nsresult
XULGroupboxAccessible::GetNameInternal(nsAString& aName)
{
// XXX: we use the first related accessible only.
Accessible* label =
RelationByType(nsIAccessibleRelation::RELATION_LABELLED_BY).Next();
if (label)
return label->GetName(aName);
return NS_OK;
}