当前位置: 首页>>代码示例>>C++>>正文


C++ AXObject::activeDescendant方法代码示例

本文整理汇总了C++中AXObject::activeDescendant方法的典型用法代码示例。如果您正苦于以下问题:C++ AXObject::activeDescendant方法的具体用法?C++ AXObject::activeDescendant怎么用?C++ AXObject::activeDescendant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AXObject的用法示例。


在下文中一共展示了AXObject::activeDescendant方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: focusedUIElementForPage

AXObject* AXObjectCacheImpl::focusedUIElementForPage(const Page* page)
{
    if (!page->settings().accessibilityEnabled())
        return 0;

    // Cross-process accessibility is not yet implemented.
    if (!page->focusController().focusedOrMainFrame()->isLocalFrame())
        return 0;

    // get the focused node in the page
    Document* focusedDocument = toLocalFrame(page->focusController().focusedOrMainFrame())->document();
    Node* focusedNode = focusedDocument->focusedElement();
    if (!focusedNode)
        focusedNode = focusedDocument;

    if (isHTMLAreaElement(*focusedNode))
        return focusedImageMapUIElement(toHTMLAreaElement(focusedNode));

    AXObject* obj = toAXObjectCacheImpl(focusedNode->document().axObjectCache())->getOrCreate(focusedNode);
    if (!obj)
        return 0;

    if (obj->shouldFocusActiveDescendant()) {
        if (AXObject* descendant = obj->activeDescendant())
            obj = descendant;
    }

    // the HTML element, for example, is focusable but has an AX object that is ignored
    if (obj->accessibilityIsIgnored())
        obj = obj->parentObjectUnignored();

    return obj;
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:33,代码来源:AXObjectCacheImpl.cpp

示例2: focusedUIElementForPage

AXObject* AXObjectCache::focusedUIElementForPage(const Page* page)
{
    if (!gAccessibilityEnabled)
        return 0;

    // get the focused node in the page
    Document* focusedDocument = page->focusController().focusedOrMainFrame()->document();
    Node* focusedNode = focusedDocument->focusedElement();
    if (!focusedNode)
        focusedNode = focusedDocument;

    if (focusedNode->hasTagName(areaTag))
        return focusedImageMapUIElement(toHTMLAreaElement(focusedNode));

    AXObject* obj = focusedNode->document().axObjectCache()->getOrCreate(focusedNode);
    if (!obj)
        return 0;

    if (obj->shouldFocusActiveDescendant()) {
        if (AXObject* descendant = obj->activeDescendant())
            obj = descendant;
    }

    // the HTML element, for example, is focusable but has an AX object that is ignored
    if (obj->accessibilityIsIgnored())
        obj = obj->parentObjectUnignored();

    return obj;
}
开发者ID:kublaj,项目名称:blink,代码行数:29,代码来源:AXObjectCache.cpp

示例3: focusedObject

AXObject* AXObjectCacheImpl::focusedObject()
{
    if (!accessibilityEnabled())
        return 0;

    // We don't have to return anything if the focused frame is not local;
    // the remote frame will have its own AXObjectCacheImpl and the focused
    // object will be sorted out by the browser process.
    Page* page = m_document->page();
    if (!page->focusController().focusedFrame())
        return 0;

    // Get the focused node in the page.
    Document* focusedDocument = page->focusController().focusedFrame()->document();
    Node* focusedNode = focusedDocument->focusedElement();
    if (!focusedNode)
        focusedNode = focusedDocument;

    // If it's an image map, get the focused link within the image map.
    if (isHTMLAreaElement(focusedNode))
        return focusedImageMapUIElement(toHTMLAreaElement(focusedNode));

    // See if there's a page popup, for example a calendar picker.
    Element* adjustedFocusedElement = focusedDocument->adjustedFocusedElement();
    if (isHTMLInputElement(adjustedFocusedElement)) {
        if (AXObject* axPopup = toHTMLInputElement(adjustedFocusedElement)->popupRootAXObject()) {
            if (Element* focusedElementInPopup = axPopup->document()->focusedElement())
                focusedNode = focusedElementInPopup;
        }

    }

    AXObject* obj = getOrCreate(focusedNode);
    if (!obj)
        return 0;

    if (obj->shouldFocusActiveDescendant()) {
        if (AXObject* descendant = obj->activeDescendant())
            obj = descendant;
    }

    // the HTML element, for example, is focusable but has an AX object that is ignored
    if (obj->accessibilityIsIgnored())
        obj = obj->parentObjectUnignored();

    return obj;
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:47,代码来源:AXObjectCacheImpl.cpp


注:本文中的AXObject::activeDescendant方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。