SelectionProtocol
public protocol SelectionProtocol
AtkSelection should be implemented by UI components with children
which are exposed by atk_object_ref_child and
atk_object_get_n_children, if the use of the parent UI component
ordinarily involves selection of one or more of the objects
corresponding to those AtkObject children - for example,
selectable lists.
Note that other types of “selection” (for instance text selection)
are accomplished a other ATK interfaces - AtkSelection is limited
to the selection/deselection of children.
The SelectionProtocol protocol exposes the methods and properties of an underlying AtkSelection 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 Selection.
Alternatively, use SelectionRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
AtkSelectioninstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
selection_ptrDefault implementationTyped pointer to the underlying
AtkSelectioninstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
AtkSelectioninstance.Declaration
Swift
var selection_ptr: UnsafeMutablePointer<AtkSelection>! { get } -
Required Initialiser for types conforming to
SelectionProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
SelectionSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: SelectionSignalName, 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
SelectionSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: SelectionSignalName, 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)
-
onSelectionChanged(flags:Extension methodhandler: ) The “selection-changed” signal is emitted by an object which implements AtkSelection interface when the selection changes.
Note
This represents the underlyingselection-changedsignalDeclaration
Swift
@discardableResult @inlinable func onSelectionChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SelectionRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
selectionChangedsignal is emitted -
selectionChangedSignalExtension methodTyped
selection-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var selectionChangedSignal: SelectionSignalName { get }
-
addSelection(i:Extension method) Adds the specified accessible child of the object to the object’s selection.
Declaration
Swift
@inlinable func addSelection(i: Int) -> Bool -
clearSelection()Extension methodClears the selection in the object so that no children in the object are selected.
Declaration
Swift
@inlinable func clearSelection() -> Bool -
getSelectionCount()Extension methodGets the number of accessible children currently selected. Note: callers should not rely on
nilor on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or theatk_get_accessible_value()convenience method.Declaration
Swift
@inlinable func getSelectionCount() -> Int -
isChildSelected(i:Extension method) Determines if the current child of this object is selected Note: callers should not rely on
nilor on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or theatk_get_accessible_value()convenience method.Declaration
Swift
@inlinable func isChildSelected(i: Int) -> Bool -
refSelection(i:Extension method) Gets a reference to the accessible object representing the specified selected child of the object. Note: callers should not rely on
nilor on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or theatk_get_accessible_value()convenience method.Declaration
Swift
@inlinable func refSelection(i: Int) -> Atk.ObjectRef! -
removeSelection(i:Extension method) Removes the specified child of the object from the object’s selection.
Declaration
Swift
@inlinable func removeSelection(i: Int) -> Bool -
selectAllSelection()Extension methodCauses every child of the object to be selected if the object supports multiple selections.
Declaration
Swift
@inlinable func selectAllSelection() -> Bool -
selectionCountExtension methodGets the number of accessible children currently selected. Note: callers should not rely on
nilor on a zero value for indication of whether AtkSelectionIface is implemented, they should use type checking/interface checking macros or theatk_get_accessible_value()convenience method.Declaration
Swift
@inlinable var selectionCount: Int { get }
View on GitHub
Install in Dash
SelectionProtocol Protocol Reference