DirectoryListRef
public struct DirectoryListRef : DirectoryListProtocol, GWeakCapturing
GtkDirectoryList
is a list model that wraps g_file_enumerate_children_async()
.
It presents a GListModel
and fills it asynchronously with the GFileInfo
s
returned from that function.
Enumeration will start automatically when a the
[propertyGtk.DirectoryList:file
] property is set.
While the GtkDirectoryList
is being filled, the
[propertyGtk.DirectoryList:loading
] property will be set to true
. You can
listen to that property if you want to show information like a GtkSpinner
or a “Loading…” text.
If loading fails at any point, the [propertyGtk.DirectoryList:error
]
property will be set to give more indication about the failure.
The GFileInfo
s returned from a GtkDirectoryList
have the “standardfile
”
attribute set to the GFile
they refer to. This way you can get at the file
that is referred to in the same way you would via g_file_enumerator_get_child()
.
This means you do not need access to the GtkDirectoryList
, but can access
the GFile
directly from the GFileInfo
when operating with a GtkListView
or similar.
The DirectoryListRef
type acts as a lightweight Swift reference to an underlying GtkDirectoryList
instance.
It exposes methods that can operate on this data type through DirectoryListProtocol
conformance.
Use DirectoryListRef
only as an unowned
reference to an existing GtkDirectoryList
instance.
-
Untyped pointer to the underlying `GtkDirectoryList` instance.
For type-safe access, use the generated, typed pointer
directory_list_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkDirectoryList>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkDirectoryList>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkDirectoryList>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkDirectoryList>?)
-
Conditional initialiser from an optional
gpointer
Declaration
Swift
@inlinable init!(gpointer g: gpointer?)
-
Conditional initialiser from an optional, non-mutable
gconstpointer
Declaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?)
-
Reference intialiser for a related type that implements
DirectoryListProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : DirectoryListProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> DirectoryListRef where T : DirectoryListProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
DirectoryListProtocol
.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>)
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
DirectoryListProtocol
.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
DirectoryListProtocol
.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
DirectoryListProtocol
.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
DirectoryListProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Creates a new `GtkDirectoryList`.
The
GtkDirectoryList
is querying the givenfile
with the givenattributes
.Declaration
Swift
@inlinable init<FileT>(attributes: UnsafePointer<CChar>? = nil, file: FileT?) where FileT : FileProtocol