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
AtkTable
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
table_ptr
Default implementationTyped pointer to the underlying
AtkTable
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
AtkTable
instance.Declaration
Swift
var table_ptr: UnsafeMutablePointer<AtkTable>! { get }
-
Required Initialiser for types conforming to
TableProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
TableSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TableSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The 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
TableSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TableSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The 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-deleted
signalDeclaration
Swift
@discardableResult @inlinable func onColumnDeleted(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef, _ arg1: Int, _ arg2: Int) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
arg1
The index of the first column deleted.
arg2
The number of columns deleted.
handler
The signal handler to call Run the given callback whenever the
columnDeleted
signal is emitted -
columnDeletedSignal
Extension methodTyped
column-deleted
signal 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-inserted
signalDeclaration
Swift
@discardableResult @inlinable func onColumnInserted(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef, _ arg1: Int, _ arg2: Int) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
arg1
The index of the column inserted.
arg2
The number of colums inserted.
handler
The signal handler to call Run the given callback whenever the
columnInserted
signal is emitted -
columnInsertedSignal
Extension methodTyped
column-inserted
signal 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-reordered
signalDeclaration
Swift
@discardableResult @inlinable func onColumnReordered(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
columnReordered
signal is emitted -
columnReorderedSignal
Extension methodTyped
column-reordered
signal 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-changed
signalDeclaration
Swift
@discardableResult @inlinable func onModelChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
modelChanged
signal is emitted -
modelChangedSignal
Extension methodTyped
model-changed
signal 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-deleted
signalDeclaration
Swift
@discardableResult @inlinable func onRowDeleted(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef, _ arg1: Int, _ arg2: Int) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
arg1
The index of the first row deleted.
arg2
The number of rows deleted.
handler
The signal handler to call Run the given callback whenever the
rowDeleted
signal is emitted -
rowDeletedSignal
Extension methodTyped
row-deleted
signal 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-inserted
signalDeclaration
Swift
@discardableResult @inlinable func onRowInserted(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef, _ arg1: Int, _ arg2: Int) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
arg1
The index of the first row inserted.
arg2
The number of rows inserted.
handler
The signal handler to call Run the given callback whenever the
rowInserted
signal is emitted -
rowInsertedSignal
Extension methodTyped
row-inserted
signal 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-reordered
signalDeclaration
Swift
@discardableResult @inlinable func onRowReordered(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TableRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
rowReordered
signal is emitted -
rowReorderedSignal
Extension methodTyped
row-reordered
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var rowReorderedSignal: TableSignalName { get }
-
addColumnSelection(column:
Extension method) Adds the specified
column
to the selection.Declaration
Swift
@inlinable func addColumnSelection(column: Int) -> Bool
-
addRowSelection(row:
Extension method) Adds the specified
row
to 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
gint
representing 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
column
in 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
row
andcolumn
in 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
gint
representing the index at the specifiedrow
andcolumn
.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
gint
representing 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
row
andcolumn
in 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
column
is selectedDeclaration
Swift
@inlinable func isColumnSelected(column: Int) -> Bool
-
isRowSelected(row:
Extension method) Gets a boolean value indicating whether the specified
row
is selectedDeclaration
Swift
@inlinable func isRowSelected(row: Int) -> Bool
-
isSelected(row:
Extension methodcolumn: ) Gets a boolean value indicating whether the accessible object at the specified
row
andcolumn
is 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 interfaceAtkTableCell
Declaration
Swift
@inlinable func refAt(row: Int, column: Int) -> Atk.ObjectRef!
-
removeColumnSelection(column:
Extension method) Adds the specified
column
to the selection.Declaration
Swift
@inlinable func removeColumnSelection(column: Int) -> Bool
-
removeRowSelection(row:
Extension method) Removes the specified
row
from 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
column
of 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
row
oftable
.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
-
caption
Extension methodGets the caption for the
table
.Declaration
Swift
@inlinable var caption: Atk.ObjectRef! { get nonmutating set }
-
nColumns
Extension methodGets the number of columns in the table.
Declaration
Swift
@inlinable var nColumns: Int { get }
-
nRows
Extension methodGets the number of rows in the table.
Declaration
Swift
@inlinable var nRows: Int { get }
-
summary
Extension methodGets the summary description of the table.
Declaration
Swift
@inlinable var summary: Atk.ObjectRef! { get nonmutating set }