HypertextProtocol
public protocol HypertextProtocol
An interface used for objects which implement linking between multiple resource or content locations, or multiple ‘markers’ within a single document. A Hypertext instance is associated with one or more Hyperlinks, which are associated with particular offsets within the Hypertext’s included content. While this interface is derived from Text, there is no requirement that Hypertext instances have textual content; they may implement Image as well, and Hyperlinks need not have non-zero text offsets.
The HypertextProtocol protocol exposes the methods and properties of an underlying AtkHypertext 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 Hypertext.
Alternatively, use HypertextRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
AtkHypertextinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
hypertext_ptrDefault implementationTyped pointer to the underlying
AtkHypertextinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
AtkHypertextinstance.Declaration
Swift
var hypertext_ptr: UnsafeMutablePointer<AtkHypertext>! { get } -
Required Initialiser for types conforming to
HypertextProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
HypertextSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: HypertextSignalName, 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
HypertextSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: HypertextSignalName, 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)
-
onLinkSelected(flags:Extension methodhandler: ) The “link-selected” signal is emitted by an AtkHyperText object when one of the hyperlinks associated with the object is selected.
Note
This represents the underlyinglink-selectedsignalDeclaration
Swift
@discardableResult @inlinable func onLinkSelected(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: HypertextRef, _ arg1: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
arg1the index of the hyperlink which is selected
handlerThe signal handler to call Run the given callback whenever the
linkSelectedsignal is emitted -
linkSelectedSignalExtension methodTyped
link-selectedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var linkSelectedSignal: HypertextSignalName { get }
-
getLink(linkIndex:Extension method) Gets the link in this hypertext document at index
link_indexDeclaration
Swift
@inlinable func getLink(linkIndex: Int) -> Atk.HyperlinkRef! -
getLinkIndex(charIndex:Extension method) Gets the index into the array of hyperlinks that is associated with the character specified by
char_index.Declaration
Swift
@inlinable func getLinkIndex(charIndex: Int) -> Int -
getNLinks()Extension methodGets the number of links within this hypertext document.
Declaration
Swift
@inlinable func getNLinks() -> Int -
nLinksExtension methodGets the number of links within this hypertext document.
Declaration
Swift
@inlinable var nLinks: Int { get }
View on GitHub
Install in Dash
HypertextProtocol Protocol Reference