本文整理汇总了C++中TableAccessible类的典型用法代码示例。如果您正苦于以下问题:C++ TableAccessible类的具体用法?C++ TableAccessible怎么用?C++ TableAccessible使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TableAccessible类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: NS_ENSURE_ARG_POINTER
nsresult
XULTreeGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);
if (IsDefunct())
return NS_ERROR_FAILURE;
// "table-cell-index" attribute
TableAccessible* table = Table();
if (!table)
return NS_ERROR_FAILURE;
nsAutoString stringIdx;
stringIdx.AppendInt(table->CellIndexAt(mRow, ColIdx()));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex, stringIdx);
// "cycles" attribute
bool isCycler = false;
nsresult rv = mColumn->GetCycler(&isCycler);
if (NS_SUCCEEDED(rv) && isCycler)
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::cycles,
NS_LITERAL_STRING("true"));
return NS_OK;
}
开发者ID:0b10011,项目名称:mozilla-central,代码行数:26,代码来源:XULTreeGridAccessible.cpp
示例2: Table
void
XULListCellAccessible::ColHeaderCells(nsTArray<Accessible*>* aCells)
{
TableAccessible* table = Table();
NS_ASSERTION(table, "cell not in a table!");
if (!table)
return;
// Get column header cell from XUL listhead.
Accessible* list = nullptr;
Accessible* tableAcc = table->AsAccessible();
uint32_t tableChildCount = tableAcc->ChildCount();
for (uint32_t childIdx = 0; childIdx < tableChildCount; childIdx++) {
Accessible* child = tableAcc->GetChildAt(childIdx);
if (child->Role() == roles::LIST) {
list = child;
break;
}
}
if (list) {
Accessible* headerCell = list->GetChildAt(ColIdx());
if (headerCell) {
aCells->AppendElement(headerCell);
return;
}
}
// No column header cell from XUL markup, try to get it from ARIA markup.
TableCellAccessible::ColHeaderCells(aCells);
}
开发者ID:Fischer-L,项目名称:gecko-b2g,代码行数:32,代码来源:XULListboxAccessible.cpp
示例3: Table
already_AddRefed<nsIPersistentProperties>
HTMLTableCellAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
HyperTextAccessibleWrap::NativeAttributes();
// table-cell-index attribute
TableAccessible* table = Table();
if (!table)
return attributes.forget();
int32_t rowIdx = -1, colIdx = -1;
nsresult rv = GetCellIndexes(rowIdx, colIdx);
if (NS_FAILED(rv))
return attributes.forget();
nsAutoString stringIdx;
stringIdx.AppendInt(table->CellIndexAt(rowIdx, colIdx));
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tableCellIndex, stringIdx);
// abbr attribute
// Pick up object attribute from abbr DOM element (a child of the cell) or
// from abbr DOM attribute.
nsAutoString abbrText;
if (ChildCount() == 1) {
Accessible* abbr = FirstChild();
if (abbr->IsAbbreviation()) {
nsIContent* firstChildNode = abbr->GetContent()->GetFirstChild();
if (firstChildNode) {
nsTextEquivUtils::
AppendTextEquivFromTextContent(firstChildNode, &abbrText);
}
}
}
if (abbrText.IsEmpty())
mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::abbr, abbrText);
if (!abbrText.IsEmpty())
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::abbr, abbrText);
// axis attribute
nsAutoString axisText;
mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::axis, axisText);
if (!axisText.IsEmpty())
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::axis, axisText);
#ifdef DEBUG
nsAutoString unused;
attributes->SetStringProperty(NS_LITERAL_CSTRING("cppclass"),
NS_LITERAL_STRING("HTMLTableCellAccessible"),
unused);
#endif
return attributes.forget();
}
开发者ID:kinetiknz,项目名称:gecko-dev,代码行数:56,代码来源:HTMLTableAccessible.cpp
示例4: GetCellIndexes
bool
HTMLTableCellAccessible::Selected()
{
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
TableAccessible* table = Table();
NS_ENSURE_TRUE(table, false);
return table->IsCellSelected(rowIdx, colIdx);
}
开发者ID:kinetiknz,项目名称:gecko-dev,代码行数:11,代码来源:HTMLTableAccessible.cpp
示例5: Table
GroupPos ARIAGridCellAccessible::GroupPosition() {
int32_t count = 0, index = 0;
TableAccessible* table = Table();
if (table &&
nsCoreUtils::GetUIntAttr(table->AsAccessible()->GetContent(),
nsGkAtoms::aria_colcount, &count) &&
nsCoreUtils::GetUIntAttr(mContent, nsGkAtoms::aria_colindex, &index)) {
return GroupPos(0, index, count);
}
return GroupPos();
}
开发者ID:DimiL,项目名称:gecko-dev,代码行数:12,代码来源:ARIAGridAccessible.cpp
示例6: getIndexAtCB
static gint
getIndexAtCB(AtkTable* aTable, gint aRow, gint aColumn)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return -1;
TableAccessible* table = accWrap->AsTable();
NS_ENSURE_TRUE(table, -1);
return static_cast<gint>(table->CellIndexAt(aRow, aColumn));
}
开发者ID:lihuibng,项目名称:mozilla-central,代码行数:12,代码来源:nsMaiInterfaceTable.cpp
示例7: getCaptionCB
static AtkObject*
getCaptionCB(AtkTable* aTable)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nsnull;
TableAccessible* table = accWrap->AsTable();
NS_ENSURE_TRUE(table, nsnull);
Accessible* caption = table->Caption();
return caption ? AccessibleWrap::GetAtkObject(caption) : nsnull;
}
开发者ID:lihuibng,项目名称:mozilla-central,代码行数:13,代码来源:nsMaiInterfaceTable.cpp
示例8: NS_ENSURE_ARG_POINTER
NS_IMETHODIMP
xpcAccessibleTableCell::GetTable(nsIAccessibleTable** aTable)
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nullptr;
if (!Intl())
return NS_ERROR_FAILURE;
TableAccessible* table = Intl()->Table();
if (!table)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleTable> xpcTable =
do_QueryInterface(static_cast<nsIAccessible*>(ToXPC(table->AsAccessible())));
xpcTable.forget(aTable);
return NS_OK;
}
开发者ID:70599,项目名称:Waterfox,代码行数:18,代码来源:xpcAccessibleTableCell.cpp
示例9: nsPersistentProperties
already_AddRefed<nsIPersistentProperties>
XULTreeGridCellAccessible::NativeAttributes() {
RefPtr<nsPersistentProperties> attributes = new nsPersistentProperties();
// "table-cell-index" attribute
TableAccessible* table = Table();
if (!table) return attributes.forget();
nsAutoString stringIdx;
stringIdx.AppendInt(table->CellIndexAt(mRow, ColIdx()));
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tableCellIndex, stringIdx);
// "cycles" attribute
if (mColumn->Cycler())
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::cycles,
NS_LITERAL_STRING("true"));
return attributes.forget();
}
开发者ID:Noctem,项目名称:gecko-dev,代码行数:19,代码来源:XULTreeGridAccessible.cpp
示例10: switch
role
HTMLTableHeaderCellAccessible::NativeRole()
{
// Check value of @scope attribute.
static Element::AttrValuesArray scopeValues[] =
{ &nsGkAtoms::col, &nsGkAtoms::colgroup,
&nsGkAtoms::row, &nsGkAtoms::rowgroup, nullptr };
int32_t valueIdx =
mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
scopeValues, eCaseMatters);
switch (valueIdx) {
case 0:
case 1:
return roles::COLUMNHEADER;
case 2:
case 3:
return roles::ROWHEADER;
}
TableAccessible* table = Table();
if (!table)
return roles::NOTHING;
// If the cell next to this one is not a header cell then assume this cell is
// a row header for it.
uint32_t rowIdx = RowIdx(), colIdx = ColIdx();
Accessible* cell = table->CellAt(rowIdx, colIdx + ColExtent());
if (cell && !nsCoreUtils::IsHTMLTableHeader(cell->GetContent()))
return roles::ROWHEADER;
// If the cell below this one is not a header cell then assume this cell is
// a column header for it.
uint32_t rowExtent = RowExtent();
cell = table->CellAt(rowIdx + rowExtent, colIdx);
if (cell && !nsCoreUtils::IsHTMLTableHeader(cell->GetContent()))
return roles::COLUMNHEADER;
// Otherwise if this cell is surrounded by header cells only then make a guess
// based on its cell spanning. In other words if it is row spanned then assume
// it's a row header, otherwise it's a column header.
return rowExtent > 1 ? roles::ROWHEADER : roles::COLUMNHEADER;
}
开发者ID:kinetiknz,项目名称:gecko-dev,代码行数:43,代码来源:HTMLTableAccessible.cpp
示例11: do_CreateInstance
already_AddRefed<nsIPersistentProperties>
XULTreeGridCellAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
// "table-cell-index" attribute
TableAccessible* table = Table();
if (!table)
return attributes.forget();
nsAutoString stringIdx;
stringIdx.AppendInt(table->CellIndexAt(mRow, ColIdx()));
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tableCellIndex, stringIdx);
// "cycles" attribute
bool isCycler = false;
nsresult rv = mColumn->GetCycler(&isCycler);
if (NS_SUCCEEDED(rv) && isCycler)
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::cycles,
NS_LITERAL_STRING("true"));
return attributes.forget();
}
开发者ID:Kunden,项目名称:gecko-dev,代码行数:24,代码来源:XULTreeGridAccessible.cpp
注:本文中的TableAccessible类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论