本文整理汇总了C++中AccessibilityTableRow::children方法的典型用法代码示例。如果您正苦于以下问题:C++ AccessibilityTableRow::children方法的具体用法?C++ AccessibilityTableRow::children怎么用?C++ AccessibilityTableRow::children使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccessibilityTableRow
的用法示例。
在下文中一共展示了AccessibilityTableRow::children方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addTableCellChild
bool AccessibilityARIAGrid::addTableCellChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount)
{
if (!child || (!child->isTableRow() && child->ariaRoleAttribute() != RowRole))
return false;
AccessibilityTableRow* row = toAccessibilityTableRow(child);
if (appendedRows.contains(row))
return false;
// store the maximum number of columns
unsigned rowCellCount = row->children().size();
if (rowCellCount > columnCount)
columnCount = rowCellCount;
row->setRowIndex((int)m_rows.size());
m_rows.append(row);
// Try adding the row if it's not ignoring accessibility,
// otherwise add its children (the cells) as the grid's children.
if (!row->accessibilityIsIgnored())
m_children.append(row);
else
m_children.appendVector(row->children());
appendedRows.add(row);
return true;
}
示例2: addChild
void AccessibilityARIAGrid::addChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount)
{
if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole)
return;
AccessibilityTableRow* row = static_cast<AccessibilityTableRow*>(child);
if (appendedRows.contains(row))
return;
// store the maximum number of columns
unsigned rowCellCount = row->children().size();
if (rowCellCount > columnCount)
columnCount = rowCellCount;
row->setRowIndex((int)m_rows.size());
m_rows.append(row);
m_children.append(row);
appendedRows.add(row);
}
示例3: addChildrenFromSection
void AccessibilityTable::addChildrenFromSection(RenderTableSection* tableSection, unsigned& maxColumnCount)
{
ASSERT(tableSection);
if (!tableSection)
return;
AXObjectCache* axCache = m_renderer->document().axObjectCache();
HashSet<AccessibilityObject*> appendedRows;
unsigned numRows = tableSection->numRows();
for (unsigned rowIndex = 0; rowIndex < numRows; ++rowIndex) {
RenderTableRow* renderRow = tableSection->rowRendererAt(rowIndex);
if (!renderRow)
continue;
AccessibilityObject* rowObject = axCache->getOrCreate(renderRow);
if (!rowObject->isTableRow())
continue;
AccessibilityTableRow* row = toAccessibilityTableRow(rowObject);
// We need to check every cell for a new row, because cell spans
// can cause us to miss rows if we just check the first column.
if (appendedRows.contains(row))
continue;
row->setRowIndex(static_cast<int>(m_rows.size()));
m_rows.append(row);
if (!row->accessibilityIsIgnored())
m_children.append(row);
#if PLATFORM(GTK) || PLATFORM(EFL)
else
m_children.appendVector(row->children());
#endif
appendedRows.add(row);
}
maxColumnCount = std::max(tableSection->numColumns(), maxColumnCount);
}
示例4: addChildren
void AccessibilityTable::addChildren()
{
if (!isAccessibilityTable()) {
AccessibilityRenderObject::addChildren();
return;
}
ASSERT(!m_haveChildren);
m_haveChildren = true;
if (!m_renderer || !m_renderer->isTable())
return;
RenderTable* table = toRenderTable(m_renderer);
AXObjectCache* axCache = m_renderer->document().axObjectCache();
// Go through all the available sections to pull out the rows and add them as children.
table->recalcSectionsIfNeeded();
RenderTableSection* tableSection = table->topSection();
if (!tableSection)
return;
unsigned maxColumnCount = 0;
while (tableSection) {
HashSet<AccessibilityObject*> appendedRows;
unsigned numRows = tableSection->numRows();
for (unsigned rowIndex = 0; rowIndex < numRows; ++rowIndex) {
RenderTableRow* renderRow = tableSection->rowRendererAt(rowIndex);
if (!renderRow)
continue;
AccessibilityObject* rowObject = axCache->getOrCreate(renderRow);
if (!rowObject->isTableRow())
continue;
AccessibilityTableRow* row = toAccessibilityTableRow(rowObject);
// We need to check every cell for a new row, because cell spans
// can cause us to miss rows if we just check the first column.
if (appendedRows.contains(row))
continue;
row->setRowIndex(static_cast<int>(m_rows.size()));
m_rows.append(row);
if (!row->accessibilityIsIgnored())
m_children.append(row);
#if PLATFORM(GTK) || PLATFORM(EFL)
else
m_children.appendVector(row->children());
#endif
appendedRows.add(row);
}
maxColumnCount = std::max(tableSection->numColumns(), maxColumnCount);
tableSection = table->sectionBelow(tableSection, SkipEmptySections);
}
// make the columns based on the number of columns in the first body
unsigned length = maxColumnCount;
for (unsigned i = 0; i < length; ++i) {
AccessibilityTableColumn* column = toAccessibilityTableColumn(axCache->getOrCreate(ColumnRole));
column->setColumnIndex((int)i);
column->setParent(this);
m_columns.append(column);
if (!column->accessibilityIsIgnored())
m_children.append(column);
}
AccessibilityObject* headerContainerObject = headerContainer();
if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored())
m_children.append(headerContainerObject);
}
示例5: addChildren
void AccessibilityTable::addChildren()
{
if (!isAccessibilityTable()) {
AccessibilityRenderObject::addChildren();
return;
}
ASSERT(!m_haveChildren);
m_haveChildren = true;
if (!m_renderer || !m_renderer->isTable())
return;
RenderTable* table = toRenderTable(m_renderer);
AXObjectCache* axCache = m_renderer->document()->axObjectCache();
// go through all the available sections to pull out the rows
// and add them as children
// FIXME: This will skip a table with just a tfoot. Should fix by using RenderTable::topSection.
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->primaryCellAt(rowIndex, colIndex);
if (!cell)
continue;
AccessibilityObject* rowObject = axCache->getOrCreate(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);
if (!row->accessibilityIsIgnored())
m_children.append(row);
#if PLATFORM(GTK)
else
m_children.append(row->children());
#endif
appendedRows.add(row);
}
}
tableSection = table->sectionBelow(tableSection, SkipEmptySections);
}
// 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->getOrCreate(ColumnRole));
column->setColumnIndex((int)i);
column->setParent(this);
m_columns.append(column);
if (!column->accessibilityIsIgnored())
m_children.append(column);
}
AccessibilityObject* headerContainerObject = headerContainer();
if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored())
m_children.append(headerContainerObject);
}