PlacesSidebarProtocol
public protocol PlacesSidebarProtocol : ScrolledWindowProtocol
GtkPlacesSidebar
is a widget that displays a list of frequently-used places in the
file system: the user’s home directory, the user’s bookmarks, and volumes and drives.
This widget is used as a sidebar in GtkFileChooser
and may be used by file managers
and similar programs.
The places sidebar displays drives and volumes, and will automatically mount or unmount them when the user selects them.
Applications can hook to various signals in the places sidebar to customize its behavior. For example, they can add extra commands to the context menu of the sidebar.
While bookmarks are completely in control of the user, the places sidebar also
allows individual applications to provide extra shortcut folders that are unique
to each application. For example, a Paint program may want to add a shortcut
for a Clipart folder. You can do this with gtk_places_sidebar_add_shortcut()
.
To make use of the places sidebar, an application at least needs to connect
to the GtkPlacesSidebar::open-location
signal. This is emitted when the
user selects in the sidebar a location to open. The application should also
call gtk_places_sidebar_set_location()
when it changes the currently-viewed
location.
CSS nodes
GtkPlacesSidebar uses a single CSS node with name placessidebar and style class .sidebar.
Among the children of the places sidebar, the following style classes can be used:
- .sidebar-new-bookmark-row for the ‘Add new bookmark’ row
- .sidebar-placeholder-row for a row that is a placeholder
- .has-open-popup when a popup is open for a row
The PlacesSidebarProtocol
protocol exposes the methods and properties of an underlying GtkPlacesSidebar
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 PlacesSidebar
.
Alternatively, use PlacesSidebarRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkPlacesSidebar
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
places_sidebar_ptr
Default implementationTyped pointer to the underlying
GtkPlacesSidebar
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPlacesSidebar
instance.Declaration
Swift
var places_sidebar_ptr: UnsafeMutablePointer<GtkPlacesSidebar>! { get }
-
Required Initialiser for types conforming to
PlacesSidebarProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PlacesSidebarPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: PlacesSidebarPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a PlacesSidebar property
Declaration
Swift
@inlinable func get(property: PlacesSidebarPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a PlacesSidebar property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: PlacesSidebarPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
PlacesSidebarSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PlacesSidebarSignalName, 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
PlacesSidebarSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PlacesSidebarSignalName, 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)
-
onDragActionAsk(flags:
Extension methodhandler: ) The places sidebar emits this signal when it needs to ask the application to pop up a menu to ask the user for which drag action to perform.
Note
This represents the underlyingdrag-action-ask
signalDeclaration
Swift
@discardableResult @inlinable func onDragActionAsk(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ actions: Int) -> Int) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
actions
Possible drag actions that need to be asked for.
handler
the final drag action that the sidebar should pass to the drag side of the drag-and-drop operation. Run the given callback whenever the
dragActionAsk
signal is emitted -
dragActionAskSignal
Extension methodTyped
drag-action-ask
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragActionAskSignal: PlacesSidebarSignalName { get }
-
onDragActionRequested(flags:
Extension methodhandler: ) When the user starts a drag-and-drop operation and the sidebar needs to ask the application for which drag action to perform, then the sidebar will emit this signal.
The application can evaluate the
context
for customary actions, or it can check the type of the files indicated bysource_file_list
against the possible actions for the destinationdest_file
.The drag action to use must be the return value of the signal handler.
Note
This represents the underlyingdrag-action-requested
signalDeclaration
Swift
@discardableResult @inlinable func onDragActionRequested(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ context: Gdk.DragContextRef, _ destFile: GIO.FileRef, _ sourceFileList: GLib.ListRef) -> Int) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
context
GdkDragContext
with information about the drag operationdestFile
GFile
with the tentative location that is being hovered for a dropsourceFileList
List of
GFile
that are being draggedhandler
The drag action to use, for example,
GDK_ACTION_COPY
orGDK_ACTION_MOVE
, or 0 if no action is allowed here (i.e. drops are not allowed in the specifieddest_file
). Run the given callback whenever thedragActionRequested
signal is emitted -
dragActionRequestedSignal
Extension methodTyped
drag-action-requested
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragActionRequestedSignal: PlacesSidebarSignalName { get }
-
onDragPerformDrop(flags:
Extension methodhandler: ) The places sidebar emits this signal when the user completes a drag-and-drop operation and one of the sidebar’s items is the destination. This item is in the
dest_file
, and thesource_file_list
has the list of files that are dropped into it and which should be copied/moved/etc. based on the specifiedaction
.Note
This represents the underlyingdrag-perform-drop
signalDeclaration
Swift
@discardableResult @inlinable func onDragPerformDrop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ destFile: GIO.FileRef, _ sourceFileList: GLib.ListRef, _ action: Int) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
destFile
Destination
GFile
.sourceFileList
GList
ofGFile
that got dropped.action
Drop action to perform.
handler
The signal handler to call Run the given callback whenever the
dragPerformDrop
signal is emitted -
dragPerformDropSignal
Extension methodTyped
drag-perform-drop
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var dragPerformDropSignal: PlacesSidebarSignalName { get }
-
onMount(flags:
Extension methodhandler: ) The places sidebar emits this signal when it starts a new operation because the user clicked on some location that needs mounting. In this way the application using the
GtkPlacesSidebar
can track the progress of the operation and, for example, show a notification.Note
This represents the underlyingmount
signalDeclaration
Swift
@discardableResult @inlinable func onMount(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ mountOperation: GIO.MountOperationRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
mountOperation
the
GMountOperation
that is going to start.handler
The signal handler to call Run the given callback whenever the
mount
signal is emitted -
mountSignal
Extension methodTyped
mount
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var mountSignal: PlacesSidebarSignalName { get }
-
onOpenLocation(flags:
Extension methodhandler: ) The places sidebar emits this signal when the user selects a location in it. The calling application should display the contents of that location; for example, a file manager should show a list of files in the specified location.
Note
This represents the underlyingopen-location
signalDeclaration
Swift
@discardableResult @inlinable func onOpenLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ location: GIO.FileRef, _ openFlags: PlacesOpenFlags) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
location
GFile
to which the caller should switch.openFlags
a single value from
GtkPlacesOpenFlags
specifying how thelocation
should be opened.handler
The signal handler to call Run the given callback whenever the
openLocation
signal is emitted -
openLocationSignal
Extension methodTyped
open-location
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var openLocationSignal: PlacesSidebarSignalName { get }
-
onPopulatePopup(flags:
Extension methodhandler: ) The places sidebar emits this signal when the user invokes a contextual popup on one of its items. In the signal handler, the application may add extra items to the menu as appropriate. For example, a file manager may want to add a “Properties” command to the menu.
It is not necessary to store the
selected_item
for each menu item; during their callbacks, the application can usegtk_places_sidebar_get_location()
to get the file to which the item refers.The
selected_item
argument may benil
in case the selection refers to a volume. In this case,selected_volume
will be non-nil
. In this case, the calling application will have tog_object_ref()
theselected_volume
and keep it around to use it in the callback.The
container
and all its contents are destroyed after the user dismisses the popup. The popup is re-created (and thus, this signal is emitted) every time the user activates the contextual menu.Before 3.18, the
container
always was aGtkMenu
, and you were expected to add your items asGtkMenuItems
. Since 3.18, the popup may be implemented as aGtkPopover
, in which casecontainer
will be something else, e.g. aGtkBox
, to which you may addGtkModelButtons
or other widgets, such asGtkEntries
,GtkSpinButtons
, etc. If your application can deal with this situation, you can setGtkPlacesSidebar::populate-all
totrue
to request that this signal is emitted for populating popovers as well.Note
This represents the underlyingpopulate-popup
signalDeclaration
Swift
@discardableResult @inlinable func onPopulatePopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ container: WidgetRef, _ selectedItem: GIO.FileRef?, _ selectedVolume: GIO.VolumeRef?) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
container
a
GtkMenu
or anotherGtkContainer
selectedItem
GFile
with the item to which the popup should refer, ornil
in the case of aselected_volume
.selectedVolume
GVolume
if the selected item is a volume, ornil
if it is a file.handler
The signal handler to call Run the given callback whenever the
populatePopup
signal is emitted -
populatePopupSignal
Extension methodTyped
populate-popup
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var populatePopupSignal: PlacesSidebarSignalName { get }
-
onShowConnectToServer(flags:
Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present an way to connect directly to a network server. For example, the application may bring up a dialog box asking for a URL like “sftp://ftp.example.com”. It is up to the application to create the corresponding mount by using, for example,
g_file_mount_enclosing_volume()
.Note
This represents the underlyingshow-connect-to-server
signalDeclaration
Swift
@discardableResult @inlinable func onShowConnectToServer(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
showConnectToServer
signal is emitted -
showConnectToServerSignal
Extension methodTyped
show-connect-to-server
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showConnectToServerSignal: PlacesSidebarSignalName { get }
-
onShowEnterLocation(flags:
Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present an way to directly enter a location. For example, the application may bring up a dialog box asking for a URL like “http://http.example.com”.
Note
This represents the underlyingshow-enter-location
signalDeclaration
Swift
@discardableResult @inlinable func onShowEnterLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
showEnterLocation
signal is emitted -
showEnterLocationSignal
Extension methodTyped
show-enter-location
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showEnterLocationSignal: PlacesSidebarSignalName { get }
-
onShowErrorMessage(flags:
Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present an error message. Most of these messages refer to mounting or unmounting media, for example, when a drive cannot be started for some reason.
Note
This represents the underlyingshow-error-message
signalDeclaration
Swift
@discardableResult @inlinable func onShowErrorMessage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ primary: String, _ secondary: String) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
primary
primary message with a summary of the error to show.
secondary
secondary message with details of the error to show.
handler
The signal handler to call Run the given callback whenever the
showErrorMessage
signal is emitted -
showErrorMessageSignal
Extension methodTyped
show-error-message
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showErrorMessageSignal: PlacesSidebarSignalName { get }
-
onShowOtherLocations(flags:
Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present a way to show other locations e.g. drives and network access points. For example, the application may bring up a page showing persistent volumes and discovered network addresses.
Note
This represents the underlyingshow-other-locations
signalDeclaration
Swift
@discardableResult @inlinable func onShowOtherLocations(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
showOtherLocations
signal is emitted -
showOtherLocationsSignal
Extension methodTyped
show-other-locations
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showOtherLocationsSignal: PlacesSidebarSignalName { get }
-
onShowOtherLocationsWithFlags(flags:
Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present a way to show other locations e.g. drives and network access points. For example, the application may bring up a page showing persistent volumes and discovered network addresses.
Note
This represents the underlyingshow-other-locations-with-flags
signalDeclaration
Swift
@discardableResult @inlinable func onShowOtherLocationsWithFlags(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ openFlags: PlacesOpenFlags) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
openFlags
a single value from
GtkPlacesOpenFlags
specifying how it should be opened.handler
The signal handler to call Run the given callback whenever the
showOtherLocationsWithFlags
signal is emitted -
showOtherLocationsWithFlagsSignal
Extension methodTyped
show-other-locations-with-flags
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showOtherLocationsWithFlagsSignal: PlacesSidebarSignalName { get }
-
onShowStarredLocation(flags:
Extension methodhandler: ) The places sidebar emits this signal when it needs the calling application to present a way to show the starred files. In GNOME, starred files are implemented by setting the nao:predefined-tag-favorite tag in the tracker database.
Note
This represents the underlyingshow-starred-location
signalDeclaration
Swift
@discardableResult @inlinable func onShowStarredLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ openFlags: PlacesOpenFlags) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
openFlags
a single value from
GtkPlacesOpenFlags
specifying how the starred file should be opened.handler
The signal handler to call Run the given callback whenever the
showStarredLocation
signal is emitted -
showStarredLocationSignal
Extension methodTyped
show-starred-location
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var showStarredLocationSignal: PlacesSidebarSignalName { get }
-
onUnmount(flags:
Extension methodhandler: ) The places sidebar emits this signal when it starts a new operation because the user for example ejected some drive or unmounted a mount. In this way the application using the
GtkPlacesSidebar
can track the progress of the operation and, for example, show a notification.Note
This represents the underlyingunmount
signalDeclaration
Swift
@discardableResult @inlinable func onUnmount(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ mountOperation: GIO.MountOperationRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
mountOperation
the
GMountOperation
that is going to start.handler
The signal handler to call Run the given callback whenever the
unmount
signal is emitted -
unmountSignal
Extension methodTyped
unmount
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var unmountSignal: PlacesSidebarSignalName { get }
-
onNotifyLocalOnly(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::local-only
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyLocalOnly(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyLocalOnly
signal is emitted -
notifyLocalOnlySignal
Extension methodTyped
notify::local-only
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyLocalOnlySignal: PlacesSidebarSignalName { get }
-
onNotifyLocation(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::location
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyLocation
signal is emitted -
notifyLocationSignal
Extension methodTyped
notify::location
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyLocationSignal: PlacesSidebarSignalName { get }
-
onNotifyOpenFlags(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::open-flags
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyOpenFlags(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyOpenFlags
signal is emitted -
notifyOpenFlagsSignal
Extension methodTyped
notify::open-flags
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyOpenFlagsSignal: PlacesSidebarSignalName { get }
-
onNotifyPopulateAll(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::populate-all
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPopulateAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyPopulateAll
signal is emitted -
notifyPopulateAllSignal
Extension methodTyped
notify::populate-all
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPopulateAllSignal: PlacesSidebarSignalName { get }
-
onNotifyShowConnectToServer(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-connect-to-server
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowConnectToServer(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowConnectToServer
signal is emitted -
notifyShowConnectToServerSignal
Extension methodTyped
notify::show-connect-to-server
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowConnectToServerSignal: PlacesSidebarSignalName { get }
-
onNotifyShowDesktop(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-desktop
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowDesktop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowDesktop
signal is emitted -
notifyShowDesktopSignal
Extension methodTyped
notify::show-desktop
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowDesktopSignal: PlacesSidebarSignalName { get }
-
onNotifyShowEnterLocation(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-enter-location
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowEnterLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowEnterLocation
signal is emitted -
notifyShowEnterLocationSignal
Extension methodTyped
notify::show-enter-location
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowEnterLocationSignal: PlacesSidebarSignalName { get }
-
onNotifyShowOtherLocations(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-other-locations
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowOtherLocations(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowOtherLocations
signal is emitted -
notifyShowOtherLocationsSignal
Extension methodTyped
notify::show-other-locations
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowOtherLocationsSignal: PlacesSidebarSignalName { get }
-
onNotifyShowRecent(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-recent
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowRecent(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowRecent
signal is emitted -
notifyShowRecentSignal
Extension methodTyped
notify::show-recent
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowRecentSignal: PlacesSidebarSignalName { get }
-
onNotifyShowStarredLocation(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-starred-location
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowStarredLocation(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowStarredLocation
signal is emitted -
notifyShowStarredLocationSignal
Extension methodTyped
notify::show-starred-location
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowStarredLocationSignal: PlacesSidebarSignalName { get }
-
onNotifyShowTrash(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-trash
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowTrash(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PlacesSidebarRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowTrash
signal is emitted -
notifyShowTrashSignal
Extension methodTyped
notify::show-trash
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowTrashSignal: PlacesSidebarSignalName { get }
-
addShortcut(location:
Extension method) Applications may want to present some folders in the places sidebar if they could be immediately useful to users. For example, a drawing program could add a “/usr/share/clipart” location when the sidebar is being used in an “Insert Clipart” dialog box.
This function adds the specified
location
to a special place for immutable shortcuts. The shortcuts are application-specific; they are not shared across applications, and they are not persistent. If this function is called multiple times with different locations, then they are added to the sidebar’s list in the same order as the function is called.Declaration
Swift
@inlinable func addShortcut<FileT>(location: FileT) where FileT : FileProtocol
-
getLocalOnly()
Extension methodReturns the value previously set with
gtk_places_sidebar_set_local_only()
.Declaration
Swift
@inlinable func getLocalOnly() -> Bool
-
getLocation()
Extension methodGets the currently selected location in the
sidebar
. This can benil
when nothing is selected, for example, whengtk_places_sidebar_set_location()
has been called with a location that is not among the sidebar’s list of places to show.You can use this function to get the selection in the
sidebar
. Also, if you connect to theGtkPlacesSidebar::populate-popup
signal, you can use this function to get the location that is being referred to during the callbacks for your menu items.Declaration
Swift
@inlinable func getLocation() -> GIO.FileRef!
-
getNthBookmark(n:
Extension method) This function queries the bookmarks added by the user to the places sidebar, and returns one of them. This function is used by
GtkFileChooser
to implement the “Alt-1”, “Alt-2”, etc. shortcuts, which activate the cooresponding bookmark.Declaration
Swift
@inlinable func getNthBookmark(n: Int) -> GIO.FileRef!
-
getOpenFlags()
Extension methodGets the open flags.
Declaration
Swift
@inlinable func getOpenFlags() -> PlacesOpenFlags
-
getShowConnectToServer()
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_connect_to_server()
get_show_connect_to_server is deprecated: It is recommended to group this functionality with the drives and network location under the new ‘Other Location’ item
Declaration
Swift
@available(*, deprecated) @inlinable func getShowConnectToServer() -> Bool
-
getShowDesktop()
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_desktop()
Declaration
Swift
@inlinable func getShowDesktop() -> Bool
-
getShowEnterLocation()
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_enter_location()
Declaration
Swift
@inlinable func getShowEnterLocation() -> Bool
-
getShowOtherLocations()
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_other_locations()
Declaration
Swift
@inlinable func getShowOtherLocations() -> Bool
-
getShowRecent()
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_recent()
Declaration
Swift
@inlinable func getShowRecent() -> Bool
-
getShowStarredLocation()
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_starred_location()
Declaration
Swift
@inlinable func getShowStarredLocation() -> Bool
-
getShowTrash()
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_trash()
Declaration
Swift
@inlinable func getShowTrash() -> Bool
-
listShortcuts()
Extension methodGets the list of shortcuts.
Declaration
Swift
@inlinable func listShortcuts() -> GLib.SListRef!
-
removeShortcut(location:
Extension method) Removes an application-specific shortcut that has been previously been inserted with
gtk_places_sidebar_add_shortcut()
. If thelocation
is not a shortcut in the sidebar, then nothing is done.Declaration
Swift
@inlinable func removeShortcut<FileT>(location: FileT) where FileT : FileProtocol
-
setDropTargets(visible:
Extension methodcontext: ) Make the GtkPlacesSidebar show drop targets, so it can show the available drop targets and a “new bookmark” row. This improves the Drag-and-Drop experience of the user and allows applications to show all available drop targets at once.
This needs to be called when the application is aware of an ongoing drag that might target the sidebar. The drop-targets-visible state will be unset automatically if the drag finishes in the GtkPlacesSidebar. You only need to unset the state when the drag ends on some other widget on your application.
Declaration
Swift
@inlinable func setDropTargets<DragContextT>(visible: Bool, context: DragContextT) where DragContextT : DragContextProtocol
-
set(localOnly:
Extension method) Sets whether the
sidebar
should only show local files.Declaration
Swift
@inlinable func set(localOnly: Bool)
-
set(location:
Extension method) Sets the location that is being shown in the widgets surrounding the
sidebar
, for example, in a folder view in a file manager. In turn, thesidebar
will highlight that location if it is being shown in the list of places, or it will unhighlight everything if thelocation
is not among the places in the list.Declaration
Swift
@inlinable func set(location: GIO.FileRef? = nil)
-
set(location:
Extension method) Sets the location that is being shown in the widgets surrounding the
sidebar
, for example, in a folder view in a file manager. In turn, thesidebar
will highlight that location if it is being shown in the list of places, or it will unhighlight everything if thelocation
is not among the places in the list.Declaration
Swift
@inlinable func set<FileT>(location: FileT?) where FileT : FileProtocol
-
setOpen(flags:
Extension method) Sets the way in which the calling application can open new locations from the places sidebar. For example, some applications only open locations “directly” into their main view, while others may support opening locations in a new notebook tab or a new window.
This function is used to tell the places
sidebar
about the ways in which the application can open new locations, so that the sidebar can display (or not) the “Open in new tab” and “Open in new window” menu items as appropriate.When the
GtkPlacesSidebar::open-location
signal is emitted, its flags argument will be set to one of theflags
that was passed ingtk_places_sidebar_set_open_flags()
.Passing 0 for
flags
will causeGTK_PLACES_OPEN_NORMAL
to always be sent to callbacks for the “open-location” signal.Declaration
Swift
@inlinable func setOpen(flags: PlacesOpenFlags)
-
set(showConnectToServer:
Extension method) Sets whether the
sidebar
should show an item for connecting to a network server; this is off by default. An application may want to turn this on if it implements a way for the user to connect to network servers directly.If you enable this, you should connect to the
GtkPlacesSidebar::show-connect-to-server
signal.set_show_connect_to_server is deprecated: It is recommended to group this functionality with the drives and network location under the new ‘Other Location’ item
Declaration
Swift
@available(*, deprecated) @inlinable func set(showConnectToServer: Bool)
-
set(showDesktop:
Extension method) Sets whether the
sidebar
should show an item for the Desktop folder. The default value for this option is determined by the desktop environment and the user’s configuration, but this function can be used to override it on a per-application basis.Declaration
Swift
@inlinable func set(showDesktop: Bool)
-
set(showEnterLocation:
Extension method) Sets whether the
sidebar
should show an item for entering a location; this is off by default. An application may want to turn this on if manually entering URLs is an expected user action.If you enable this, you should connect to the
GtkPlacesSidebar::show-enter-location
signal.Declaration
Swift
@inlinable func set(showEnterLocation: Bool)
-
set(showOtherLocations:
Extension method) Sets whether the
sidebar
should show an item for the application to show an Other Locations view; this is off by default. When set totrue
, persistent devices such as hard drives are hidden, otherwise they are shown in the sidebar. An application may want to turn this on if it implements a way for the user to see and interact with drives and network servers directly.If you enable this, you should connect to the
GtkPlacesSidebar::show-other-locations
signal.Declaration
Swift
@inlinable func set(showOtherLocations: Bool)
-
set(showRecent:
Extension method) Sets whether the
sidebar
should show an item for recent files. The default value for this option is determined by the desktop environment, but this function can be used to override it on a per-application basis.Declaration
Swift
@inlinable func set(showRecent: Bool)
-
set(showStarredLocation:
Extension method) If you enable this, you should connect to the
GtkPlacesSidebar::show-starred-location
signal.Declaration
Swift
@inlinable func set(showStarredLocation: Bool)
-
set(showTrash:
Extension method) Sets whether the
sidebar
should show an item for the Trash location.Declaration
Swift
@inlinable func set(showTrash: Bool)
-
localOnly
Extension methodReturns the value previously set with
gtk_places_sidebar_set_local_only()
.Declaration
Swift
@inlinable var localOnly: Bool { get nonmutating set }
-
location
Extension methodUndocumented
Declaration
Swift
@inlinable var location: GIO.FileRef! { get nonmutating set }
-
openFlags
Extension methodGets the open flags.
Declaration
Swift
@inlinable var openFlags: PlacesOpenFlags { get nonmutating set }
-
showConnectToServer
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_connect_to_server()
get_show_connect_to_server is deprecated: It is recommended to group this functionality with the drives and network location under the new ‘Other Location’ item
Declaration
Swift
@inlinable var showConnectToServer: Bool { get nonmutating set }
-
showDesktop
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_desktop()
Declaration
Swift
@inlinable var showDesktop: Bool { get nonmutating set }
-
showEnterLocation
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_enter_location()
Declaration
Swift
@inlinable var showEnterLocation: Bool { get nonmutating set }
-
showOtherLocations
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_other_locations()
Declaration
Swift
@inlinable var showOtherLocations: Bool { get nonmutating set }
-
showRecent
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_recent()
Declaration
Swift
@inlinable var showRecent: Bool { get nonmutating set }
-
showStarredLocation
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_starred_location()
Declaration
Swift
@inlinable var showStarredLocation: Bool { get nonmutating set }
-
showTrash
Extension methodReturns the value previously set with
gtk_places_sidebar_set_show_trash()
Declaration
Swift
@inlinable var showTrash: Bool { get nonmutating set }