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


C++ AXObjectCache::get方法代码示例

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


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

示例1: reportFindInPageResultToAccessibility

void TextFinder::reportFindInPageResultToAccessibility(int identifier)
{
    AXObjectCache* axObjectCache = ownerFrame().frame()->document()->existingAXObjectCache();
    if (!axObjectCache)
        return;

    AXObject* startObject = axObjectCache->get(m_activeMatch->startContainer());
    AXObject* endObject = axObjectCache->get(m_activeMatch->endContainer());
    if (!startObject || !endObject)
        return;

    WebLocalFrameImpl* mainFrameImpl = ownerFrame().viewImpl()->mainFrameImpl();
    if (mainFrameImpl && mainFrameImpl->client()) {
        mainFrameImpl->client()->handleAccessibilityFindInPageResult(
            identifier, m_activeMatchIndexInCurrentFrame + 1,
            WebAXObject(startObject), m_activeMatch->startOffset(),
            WebAXObject(endObject), m_activeMatch->endOffset());
    }
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:19,代码来源:TextFinder.cpp

示例2: parentObjectIfExists

AccessibilityObject* AccessibilityScrollView::parentObjectIfExists() const
{
    if (!m_scrollView || !m_scrollView->isFrameView())
        return nullptr;
    
    AXObjectCache* cache = axObjectCache();
    if (!cache)
        return nullptr;

    HTMLFrameOwnerElement* owner = toFrameView(m_scrollView)->frame().ownerElement();
    if (owner && owner->renderer())
        return cache->get(owner);
    
    return nullptr;
}
开发者ID:chenbk85,项目名称:webkit2-wincairo,代码行数:15,代码来源:AccessibilityScrollView.cpp

示例3: addChildren

void AccessibilityTable::addChildren()
{
    if (!isDataTable()) {
        AccessibilityRenderObject::addChildren();
        return;
    }
    
    ASSERT(!m_haveChildren); 
    
    m_haveChildren = true;
    if (!m_renderer)
        return;
    
    RenderTable* table = static_cast<RenderTable*>(m_renderer);
    AXObjectCache* axCache = m_renderer->document()->axObjectCache();

    // go through all the available sections to pull out the rows
    // and add them as children
    RenderTableSection* tableSection = table->header();
    if (!tableSection)
        tableSection = table->firstBody();
    
    if (!tableSection)
        return;
    
    RenderTableSection* initialTableSection = tableSection;
    
    while (tableSection) {
        
        HashSet<AccessibilityObject*> appendedRows;

        unsigned numRows = tableSection->numRows();
        unsigned numCols = tableSection->numColumns();
        for (unsigned rowIndex = 0; rowIndex < numRows; ++rowIndex) {
            for (unsigned colIndex = 0; colIndex < numCols; ++colIndex) {
                
                RenderTableCell* cell = tableSection->cellAt(rowIndex, colIndex).cell;
                if (!cell)
                    continue;
                
                AccessibilityObject* rowObject = axCache->get(cell->parent());
                if (!rowObject->isTableRow())
                    continue;
                
                AccessibilityTableRow* row = static_cast<AccessibilityTableRow*>(rowObject);
                // we need to check every cell for a new row, because cell spans
                // can cause us to mess rows if we just check the first column
                if (appendedRows.contains(row))
                    continue;
                
                row->setRowIndex((int)m_rows.size());        
                m_rows.append(row);
                m_children.append(row);
                appendedRows.add(row);
            }
        }
        
        tableSection = table->sectionBelow(tableSection, true);
    }
    
    // make the columns based on the number of columns in the first body
    unsigned length = initialTableSection->numColumns();
    for (unsigned i = 0; i < length; ++i) {
        AccessibilityTableColumn* column = static_cast<AccessibilityTableColumn*>(axCache->get(ColumnRole));
        column->setColumnIndex((int)i);
        column->setParentTable(this);
        m_columns.append(column);
        m_children.append(column);
    }
    
    AccessibilityObject* headerContainerObject = headerContainer();
    if (headerContainerObject)
        m_children.append(headerContainerObject);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:74,代码来源:AccessibilityTable.cpp


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