本文整理汇总了C++中TableAccessible::CellIndexAt方法的典型用法代码示例。如果您正苦于以下问题:C++ TableAccessible::CellIndexAt方法的具体用法?C++ TableAccessible::CellIndexAt怎么用?C++ TableAccessible::CellIndexAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableAccessible
的用法示例。
在下文中一共展示了TableAccessible::CellIndexAt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Table
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;
}
示例2: 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();
}
示例3: GetAccessibleWrap
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));
}
示例4: Table
already_AddRefed<nsIPersistentProperties>
XULListCellAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
HyperTextAccessibleWrap::NativeAttributes();
// "table-cell-index" attribute
TableAccessible* table = Table();
if (!table) // we expect to be in a listbox (table)
return attributes.forget();
nsAutoString stringIdx;
stringIdx.AppendInt(table->CellIndexAt(RowIdx(), ColIdx()));
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tableCellIndex, stringIdx);
return attributes.forget();
}
示例5: 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();
}
示例6: Table
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();
}