TableProtocol
public protocol TableProtocol
AtkTable should be implemented by components which present
elements ordered via rows and columns. It may also be used to
present tree-structured information if the nodes of the trees can
be said to contain multiple “columns”. Individual elements of an
AtkTable are typically referred to as “cells”. Those cells should
implement the interface AtkTableCell, but Atk doesn’t require
them to be direct children of the current AtkTable. They can be
grand-children, grand-grand-children etc. AtkTable provides the
API needed to get a individual cell based on the row and column
numbers.
Children of AtkTable are frequently “lightweight” objects, that
is, they may not have backing widgets in the host UI toolkit. They
are therefore often transient.
Since tables are often very complex, AtkTable includes provision
for offering simplified summary information, as well as row and
column headers and captions. Headers and captions are AtkObjects
which may implement other interfaces (AtkText, AtkImage, etc.) as
appropriate. AtkTable summaries may themselves be (simplified)
AtkTables, etc.
Note for implementors: in the past, AtkTable required that all the
cells should be direct children of AtkTable, and provided some
index based methods to request the cells. The practice showed that
that forcing made AtkTable implementation complex, and hard to
expose other kind of children, like rows or captions. Right now,
index-based methods are deprecated.
The TableProtocol protocol exposes the methods and properties of an underlying AtkTable instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Table.
Alternatively, use TableRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
AtkTableinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
table_ptrDefault implementationTyped pointer to the underlying
AtkTableinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
AtkTableinstance.Declaration
Swift
var table_ptr: UnsafeMutablePointer<AtkTable>! { get } -
Required Initialiser for types conforming to
TableProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
TableSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TableSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
TableSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TableSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onColumnDeleted(flags:Extension methodhandler: ) The “column-deleted” signal is emitted by an object which implements the AtkTable interface when a column is deleted.
Note
This represents the underlyingcolumn-deletedsignalDeclaration
Swift
@discardableResult @inlinable func onColumnDeleted(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef, _ arg1: Int, _ arg2: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
arg1The index of the first column deleted.
arg2The number of columns deleted.
handlerThe signal handler to call Run the given callback whenever the
columnDeletedsignal is emitted -
columnDeletedSignalExtension methodTyped
column-deletedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var columnDeletedSignal: TableSignalName { get } -
onColumnInserted(flags:Extension methodhandler: ) The “column-inserted” signal is emitted by an object which implements the AtkTable interface when a column is inserted.
Note
This represents the underlyingcolumn-insertedsignalDeclaration
Swift
@discardableResult @inlinable func onColumnInserted(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef, _ arg1: Int, _ arg2: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
arg1The index of the column inserted.
arg2The number of colums inserted.
handlerThe signal handler to call Run the given callback whenever the
columnInsertedsignal is emitted -
columnInsertedSignalExtension methodTyped
column-insertedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var columnInsertedSignal: TableSignalName { get } -
onColumnReordered(flags:Extension methodhandler: ) The “column-reordered” signal is emitted by an object which implements the AtkTable interface when the columns are reordered.
Note
This represents the underlyingcolumn-reorderedsignalDeclaration
Swift
@discardableResult @inlinable func onColumnReordered(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
columnReorderedsignal is emitted -
columnReorderedSignalExtension methodTyped
column-reorderedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var columnReorderedSignal: TableSignalName { get } -
onModelChanged(flags:Extension methodhandler: ) The “model-changed” signal is emitted by an object which implements the AtkTable interface when the model displayed by the table changes.
Note
This represents the underlyingmodel-changedsignalDeclaration
Swift
@discardableResult @inlinable func onModelChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
modelChangedsignal is emitted -
modelChangedSignalExtension methodTyped
model-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var modelChangedSignal: TableSignalName { get } -
onRowDeleted(flags:Extension methodhandler: ) The “row-deleted” signal is emitted by an object which implements the AtkTable interface when a row is deleted.
Note
This represents the underlyingrow-deletedsignalDeclaration
Swift
@discardableResult @inlinable func onRowDeleted(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef, _ arg1: Int, _ arg2: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
arg1The index of the first row deleted.
arg2The number of rows deleted.
handlerThe signal handler to call Run the given callback whenever the
rowDeletedsignal is emitted -
rowDeletedSignalExtension methodTyped
row-deletedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var rowDeletedSignal: TableSignalName { get } -
onRowInserted(flags:Extension methodhandler: ) The “row-inserted” signal is emitted by an object which implements the AtkTable interface when a row is inserted.
Note
This represents the underlyingrow-insertedsignalDeclaration
Swift
@discardableResult @inlinable func onRowInserted(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef, _ arg1: Int, _ arg2: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
arg1The index of the first row inserted.
arg2The number of rows inserted.
handlerThe signal handler to call Run the given callback whenever the
rowInsertedsignal is emitted -
rowInsertedSignalExtension methodTyped
row-insertedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var rowInsertedSignal: TableSignalName { get } -
onRowReordered(flags:Extension methodhandler: ) The “row-reordered” signal is emitted by an object which implements the AtkTable interface when the rows are reordered.
Note
This represents the underlyingrow-reorderedsignalDeclaration
Swift
@discardableResult @inlinable func onRowReordered(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
rowReorderedsignal is emitted -
rowReorderedSignalExtension methodTyped
row-reorderedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var rowReorderedSignal: TableSignalName { get }
-
addColumnSelection(column:Extension method) Adds the specified
columnto the selection.Declaration
Swift
@inlinable func addColumnSelection(column: Int) -> Bool -
addRowSelection(row:Extension method) Adds the specified
rowto the selection.Declaration
Swift
@inlinable func addRowSelection(row: Int) -> Bool -
getCaption()Extension methodGets the caption for the
table.Declaration
Swift
@inlinable func getCaption() -> Atk.ObjectRef! -
getColumnAt(index:Extension method) Gets a
gintrepresenting the column at the specifiedindex_.get_column_at_index is deprecated: Since 2.12.
Declaration
Swift
@available(*, deprecated) @inlinable func getColumnAt(index: Int) -> Int -
getColumnDescription(column:Extension method) Gets the description text of the specified
columnin the tableDeclaration
Swift
@inlinable func getColumnDescription(column: Int) -> String! -
getColumnExtentAt(row:Extension methodcolumn: ) Gets the number of columns occupied by the accessible object at the specified
rowandcolumnin thetable.Declaration
Swift
@inlinable func getColumnExtentAt(row: Int, column: Int) -> Int -
getColumnHeader(column:Extension method) Gets the column header of a specified column in an accessible table.
Declaration
Swift
@inlinable func getColumnHeader(column: Int) -> Atk.ObjectRef! -
getIndexAt(row:Extension methodcolumn: ) Gets a
gintrepresenting the index at the specifiedrowandcolumn.get_index_at is deprecated: Since 2.12. Use atk_table_ref_at() in order to get the accessible that represents the cell at (@row, @column)
Declaration
Swift
@available(*, deprecated) @inlinable func getIndexAt(row: Int, column: Int) -> Int -
getNColumns()Extension methodGets the number of columns in the table.
Declaration
Swift
@inlinable func getNColumns() -> Int -
getNRows()Extension methodGets the number of rows in the table.
Declaration
Swift
@inlinable func getNRows() -> Int -
getRowAt(index:Extension method) Gets a
gintrepresenting the row at the specifiedindex_.get_row_at_index is deprecated: since 2.12.
Declaration
Swift
@available(*, deprecated) @inlinable func getRowAt(index: Int) -> Int -
getRowDescription(row:Extension method) Gets the description text of the specified row in the table
Declaration
Swift
@inlinable func getRowDescription(row: Int) -> String! -
getRowExtentAt(row:Extension methodcolumn: ) Gets the number of rows occupied by the accessible object at a specified
rowandcolumnin thetable.Declaration
Swift
@inlinable func getRowExtentAt(row: Int, column: Int) -> Int -
getRowHeader(row:Extension method) Gets the row header of a specified row in an accessible table.
Declaration
Swift
@inlinable func getRowHeader(row: Int) -> Atk.ObjectRef! -
getSelectedColumns(selected:Extension method) Gets the selected columns of the table by initializing **selected with the selected column numbers. This array should be freed by the caller.
Declaration
Swift
@inlinable func getSelectedColumns(selected: UnsafeMutablePointer<UnsafeMutablePointer<gint>?>!) -> Int -
getSelectedRows(selected:Extension method) Gets the selected rows of the table by initializing **selected with the selected row numbers. This array should be freed by the caller.
Declaration
Swift
@inlinable func getSelectedRows(selected: UnsafeMutablePointer<UnsafeMutablePointer<gint>?>!) -> Int -
getSummary()Extension methodGets the summary description of the table.
Declaration
Swift
@inlinable func getSummary() -> Atk.ObjectRef! -
isColumnSelected(column:Extension method) Gets a boolean value indicating whether the specified
columnis selectedDeclaration
Swift
@inlinable func isColumnSelected(column: Int) -> Bool -
isRowSelected(row:Extension method) Gets a boolean value indicating whether the specified
rowis selectedDeclaration
Swift
@inlinable func isRowSelected(row: Int) -> Bool -
isSelected(row:Extension methodcolumn: ) Gets a boolean value indicating whether the accessible object at the specified
rowandcolumnis selectedDeclaration
Swift
@inlinable func isSelected(row: Int, column: Int) -> Bool -
refAt(row:Extension methodcolumn: ) Get a reference to the table cell at
row,column. This cell should implement the interfaceAtkTableCellDeclaration
Swift
@inlinable func refAt(row: Int, column: Int) -> Atk.ObjectRef! -
removeColumnSelection(column:Extension method) Adds the specified
columnto the selection.Declaration
Swift
@inlinable func removeColumnSelection(column: Int) -> Bool -
removeRowSelection(row:Extension method) Removes the specified
rowfrom the selection.Declaration
Swift
@inlinable func removeRowSelection(row: Int) -> Bool -
set(caption:Extension method) Sets the caption for the table.
Declaration
Swift
@inlinable func set<ObjectT>(caption: ObjectT) where ObjectT : ObjectProtocol -
setColumnDescription(column:Extension methoddescription: ) Sets the description text for the specified
columnof thetable.Declaration
Swift
@inlinable func setColumnDescription(column: Int, description: UnsafePointer<gchar>!) -
setColumnHeader(column:Extension methodheader: ) Sets the specified column header to
header.Declaration
Swift
@inlinable func setColumnHeader<ObjectT>(column: Int, header: ObjectT) where ObjectT : ObjectProtocol -
setRowDescription(row:Extension methoddescription: ) Sets the description text for the specified
rowoftable.Declaration
Swift
@inlinable func setRowDescription(row: Int, description: UnsafePointer<gchar>!) -
setRowHeader(row:Extension methodheader: ) Sets the specified row header to
header.Declaration
Swift
@inlinable func setRowHeader<ObjectT>(row: Int, header: ObjectT) where ObjectT : ObjectProtocol -
setSummary(accessible:Extension method) Sets the summary description of the table.
Declaration
Swift
@inlinable func setSummary<ObjectT>(accessible: ObjectT) where ObjectT : ObjectProtocol -
captionExtension methodGets the caption for the
table.Declaration
Swift
@inlinable var caption: Atk.ObjectRef! { get nonmutating set } -
nColumnsExtension methodGets the number of columns in the table.
Declaration
Swift
@inlinable var nColumns: Int { get } -
nRowsExtension methodGets the number of rows in the table.
Declaration
Swift
@inlinable var nRows: Int { get } -
summaryExtension methodGets the summary description of the table.
Declaration
Swift
@inlinable var summary: Atk.ObjectRef! { get nonmutating set }
View on GitHub
Install in Dash
TableProtocol Protocol Reference