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.

  • ptr

    Untyped pointer to the underlying AtkTable instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • table_ptr Default implementation

    Typed 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)

Table signals

  • Connect a Swift signal handler to the given, typed TableSignalName signal

    Declaration

    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 by userData

    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 a C signal handler to the given, typed TableSignalName signal

    Declaration

    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 by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • The “column-deleted” signal is emitted by an object which implements the AtkTable interface when a column is deleted.

    Note

    This represents the underlying column-deleted signal

    Declaration

    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 method

    Typed column-deleted signal for using the connect(signal:) methods

    Declaration

    Swift

    static var columnDeletedSignal: TableSignalName { get }
  • The “column-inserted” signal is emitted by an object which implements the AtkTable interface when a column is inserted.

    Note

    This represents the underlying column-inserted signal

    Declaration

    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 method

    Typed column-inserted signal for using the connect(signal:) methods

    Declaration

    Swift

    static var columnInsertedSignal: TableSignalName { get }
  • The “column-reordered” signal is emitted by an object which implements the AtkTable interface when the columns are reordered.

    Note

    This represents the underlying column-reordered signal

    Declaration

    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 method

    Typed column-reordered signal for using the connect(signal:) methods

    Declaration

    Swift

    static var columnReorderedSignal: TableSignalName { get }
  • 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 underlying model-changed signal

    Declaration

    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 method

    Typed model-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var modelChangedSignal: TableSignalName { get }
  • onRowDeleted(flags:handler:) Extension method

    The “row-deleted” signal is emitted by an object which implements the AtkTable interface when a row is deleted.

    Note

    This represents the underlying row-deleted signal

    Declaration

    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 method

    Typed row-deleted signal for using the connect(signal:) methods

    Declaration

    Swift

    static var rowDeletedSignal: TableSignalName { get }
  • The “row-inserted” signal is emitted by an object which implements the AtkTable interface when a row is inserted.

    Note

    This represents the underlying row-inserted signal

    Declaration

    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 method

    Typed row-inserted signal for using the connect(signal:) methods

    Declaration

    Swift

    static var rowInsertedSignal: TableSignalName { get }
  • The “row-reordered” signal is emitted by an object which implements the AtkTable interface when the rows are reordered.

    Note

    This represents the underlying row-reordered signal

    Declaration

    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 method

    Typed row-reordered signal for using the connect(signal:) methods

    Declaration

    Swift

    static var rowReorderedSignal: TableSignalName { get }

Table Interface: TableProtocol extension (methods and fields)

  • 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 method

    Gets the caption for the table.

    Declaration

    Swift

    @inlinable
    func getCaption() -> Atk.ObjectRef!
  • getColumnAt(index:) Extension method

    Gets a gint representing the column at the specified index_.

    get_column_at_index is deprecated: Since 2.12.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getColumnAt(index: Int) -> Int
  • Gets the description text of the specified column in the table

    Declaration

    Swift

    @inlinable
    func getColumnDescription(column: Int) -> String!
  • Gets the number of columns occupied by the accessible object at the specified row and column in the table.

    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:column:) Extension method

    Gets a gint representing the index at the specified row and column.

    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 method

    Gets the number of columns in the table.

    Declaration

    Swift

    @inlinable
    func getNColumns() -> Int
  • getNRows() Extension method

    Gets 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 specified index_.

    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:column:) Extension method

    Gets the number of rows occupied by the accessible object at a specified row and column in the table.

    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!
  • 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 method

    Gets 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 selected

    Declaration

    Swift

    @inlinable
    func isColumnSelected(column: Int) -> Bool
  • isRowSelected(row:) Extension method

    Gets a boolean value indicating whether the specified row is selected

    Declaration

    Swift

    @inlinable
    func isRowSelected(row: Int) -> Bool
  • isSelected(row:column:) Extension method

    Gets a boolean value indicating whether the accessible object at the specified row and column is selected

    Declaration

    Swift

    @inlinable
    func isSelected(row: Int, column: Int) -> Bool
  • refAt(row:column:) Extension method

    Get a reference to the table cell at row, column. This cell should implement the interface AtkTableCell

    Declaration

    Swift

    @inlinable
    func refAt(row: Int, column: Int) -> Atk.ObjectRef!
  • 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
  • Sets the description text for the specified column of the table.

    Declaration

    Swift

    @inlinable
    func setColumnDescription(column: Int, description: UnsafePointer<gchar>!)
  • Sets the specified column header to header.

    Declaration

    Swift

    @inlinable
    func setColumnHeader<ObjectT>(column: Int, header: ObjectT) where ObjectT : ObjectProtocol
  • Sets the description text for the specified row of table.

    Declaration

    Swift

    @inlinable
    func setRowDescription(row: Int, description: UnsafePointer<gchar>!)
  • setRowHeader(row:header:) Extension method

    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 method

    Gets the caption for the table.

    Declaration

    Swift

    @inlinable
    var caption: Atk.ObjectRef! { get nonmutating set }
  • nColumns Extension method

    Gets the number of columns in the table.

    Declaration

    Swift

    @inlinable
    var nColumns: Int { get }
  • nRows Extension method

    Gets the number of rows in the table.

    Declaration

    Swift

    @inlinable
    var nRows: Int { get }
  • summary Extension method

    Gets the summary description of the table.

    Declaration

    Swift

    @inlinable
    var summary: Atk.ObjectRef! { get nonmutating set }