本文整理汇总了C++中Relation::AppendTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ Relation::AppendTarget方法的具体用法?C++ Relation::AppendTarget怎么用?C++ Relation::AppendTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relation
的用法示例。
在下文中一共展示了Relation::AppendTarget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RelationByType
Relation HTMLGroupboxAccessible::RelationByType(RelationType aType) const {
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
// No override for label, so use <legend> for this <fieldset>
if (aType == RelationType::LABELLED_BY) rel.AppendTarget(mDoc, GetLegend());
return rel;
}
示例2: ChildCount
Relation
XULGroupboxAccessible::RelationByType(RelationType aType)
{
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType != RelationType::LABELLED_BY)
return rel;
// The label for xul:groupbox is generated from xul:label that is
// inside the anonymous content of the xul:caption.
// The xul:label has an accessible object but the xul:caption does not
uint32_t childCount = ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* childAcc = GetChildAt(childIdx);
if (childAcc->Role() == roles::LABEL) {
// Ensure that it's our label
Relation reverseRel = childAcc->RelationByType(RelationType::LABEL_FOR);
Accessible* testGroupbox = nullptr;
while ((testGroupbox = reverseRel.Next()))
if (testGroupbox == this) {
// The <label> points back to this groupbox
rel.AppendTarget(childAcc);
}
}
}
return rel;
}
示例3: GetChildCount
Relation
nsXULGroupboxAccessible::RelationByType(PRUint32 aType)
{
Relation rel = nsAccessibleWrap::RelationByType(aType);
if (aType != nsIAccessibleRelation::RELATION_LABELLED_BY)
return rel;
// The label for xul:groupbox is generated from xul:label that is
// inside the anonymous content of the xul:caption.
// The xul:label has an accessible object but the xul:caption does not
PRInt32 childCount = GetChildCount();
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
nsAccessible *childAcc = GetChildAt(childIdx);
if (childAcc->Role() == nsIAccessibleRole::ROLE_LABEL) {
// Ensure that it's our label
Relation reverseRel =
childAcc->RelationByType(nsIAccessibleRelation::RELATION_LABEL_FOR);
nsAccessible* testGroupbox = nsnull;
while ((testGroupbox = reverseRel.Next()))
if (testGroupbox == this) {
// The <label> points back to this groupbox
rel.AppendTarget(childAcc);
}
}
}
return rel;
}
示例4:
Relation
nsHTMLTableAccessible::RelationByType(PRUint32 aType)
{
Relation rel = nsAccessibleWrap::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_LABELLED_BY)
rel.AppendTarget(Caption());
return rel;
}
示例5: Caption
Relation
HTMLFigureAccessible::RelationByType(uint32_t aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_LABELLED_BY)
rel.AppendTarget(mDoc, Caption());
return rel;
}
示例6:
Relation
HTMLTableAccessible::RelationByType(RelationType aType)
{
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType == RelationType::LABELLED_BY)
rel.AppendTarget(Caption());
return rel;
}
示例7: Caption
Relation
HTMLFigureAccessible::RelationByType(RelationType aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
if (aType == RelationType::LABELLED_BY)
rel.AppendTarget(mDoc, Caption());
return rel;
}
示例8: RelationByType
Relation HTMLLabelAccessible::RelationByType(RelationType aType) const {
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType == RelationType::LABEL_FOR) {
dom::HTMLLabelElement* label = dom::HTMLLabelElement::FromNode(mContent);
rel.AppendTarget(mDoc, label->GetControl());
}
return rel;
}
示例9: GetLegend
Relation
HTMLGroupboxAccessible::RelationByType(uint32_t aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
// No override for label, so use <legend> for this <fieldset>
if (aType == nsIAccessibleRelation::RELATION_LABELLED_BY)
rel.AppendTarget(mDoc, GetLegend());
return rel;
}
示例10:
Relation
HTMLLabelAccessible::RelationByType(uint32_t aType)
{
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_LABEL_FOR) {
nsRefPtr<dom::HTMLLabelElement> label = dom::HTMLLabelElement::FromContent(mContent);
rel.AppendTarget(mDoc, label->GetControl());
}
return rel;
}
示例11: Parent
Relation
HTMLLegendAccessible::RelationByType(uint32_t aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
if (aType != nsIAccessibleRelation::RELATION_LABEL_FOR)
return rel;
Accessible* groupbox = Parent();
if (groupbox && groupbox->Role() == roles::GROUPING)
rel.AppendTarget(groupbox);
return rel;
}
示例12: Parent
Relation
nsHTMLLegendAccessible::RelationByType(PRUint32 aType)
{
Relation rel = nsHyperTextAccessibleWrap::RelationByType(aType);
if (aType != nsIAccessibleRelation::RELATION_LABEL_FOR)
return rel;
nsAccessible* groupbox = Parent();
if (groupbox && groupbox->Role() == nsIAccessibleRole::ROLE_GROUPING)
rel.AppendTarget(groupbox);
return rel;
}
示例13: Parent
Relation
nsXULTextAccessible::RelationByType(PRUint32 aType)
{
Relation rel = nsHyperTextAccessibleWrap::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_LABEL_FOR) {
// Caption is the label for groupbox
nsIContent *parent = mContent->GetParent();
if (parent && parent->Tag() == nsGkAtoms::caption) {
nsAccessible* parent = Parent();
if (parent && parent->Role() == roles::GROUPING)
rel.AppendTarget(parent);
}
}
return rel;
}
示例14: Parent
Relation
XULLabelAccessible::RelationByType(RelationType aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
if (aType == RelationType::LABEL_FOR) {
// Caption is the label for groupbox
nsIContent* parent = mContent->GetFlattenedTreeParent();
if (parent && parent->Tag() == nsGkAtoms::caption) {
Accessible* parent = Parent();
if (parent && parent->Role() == roles::GROUPING)
rel.AppendTarget(parent);
}
}
return rel;
}
示例15: RelationByType
Relation XULTabpanelAccessible::RelationByType(RelationType aType) const {
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType != RelationType::LABELLED_BY) return rel;
// Expose 'LABELLED_BY' relation on tabpanel accessible for tab accessible.
if (!mContent->GetParent()) return rel;
nsCOMPtr<nsIDOMXULRelatedElement> tabpanelsElm =
mContent->GetParent()->AsElement()->AsXULRelated();
if (!tabpanelsElm) return rel;
RefPtr<mozilla::dom::Element> tabElement;
tabpanelsElm->GetRelatedElement(GetNode(), getter_AddRefs(tabElement));
if (!tabElement) return rel;
rel.AppendTarget(mDoc, tabElement);
return rel;
}