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.

  • ptr

    Untyped pointer to the underlying GtkPlacesSidebar instance.

    Declaration

    Swift

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

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

PlacesSidebar Class

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

    transform_to

    ValueTransformer to use for backwards transformation

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

    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

PlacesSidebar signals

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

    Declaration

    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 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 PlacesSidebarSignalName signal

    Declaration

    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 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 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 underlying drag-action-ask signal

    Declaration

    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 method

    Typed drag-action-ask signal for using the connect(signal:) methods

    Declaration

    Swift

    static var dragActionAskSignal: PlacesSidebarSignalName { get }
  • 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 by source_file_list against the possible actions for the destination dest_file.

    The drag action to use must be the return value of the signal handler.

    Note

    This represents the underlying drag-action-requested signal

    Declaration

    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 operation

    destFile

    GFile with the tentative location that is being hovered for a drop

    sourceFileList

    List of GFile that are being dragged

    handler

    The drag action to use, for example, GDK_ACTION_COPY or GDK_ACTION_MOVE, or 0 if no action is allowed here (i.e. drops are not allowed in the specified dest_file). Run the given callback whenever the dragActionRequested signal is emitted

  • dragActionRequestedSignal Extension method

    Typed drag-action-requested signal for using the connect(signal:) methods

    Declaration

    Swift

    static var dragActionRequestedSignal: PlacesSidebarSignalName { get }
  • 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 the source_file_list has the list of files that are dropped into it and which should be copied/moved/etc. based on the specified action.

    Note

    This represents the underlying drag-perform-drop signal

    Declaration

    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 of GFile 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 method

    Typed drag-perform-drop signal for using the connect(signal:) methods

    Declaration

    Swift

    static var dragPerformDropSignal: PlacesSidebarSignalName { get }
  • onMount(flags:handler:) Extension method

    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 underlying mount signal

    Declaration

    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 method

    Typed mount signal for using the connect(signal:) methods

    Declaration

    Swift

    static var mountSignal: PlacesSidebarSignalName { get }
  • 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 underlying open-location signal

    Declaration

    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 the location should be opened.

    handler

    The signal handler to call Run the given callback whenever the openLocation signal is emitted

  • openLocationSignal Extension method

    Typed open-location signal for using the connect(signal:) methods

    Declaration

    Swift

    static var openLocationSignal: PlacesSidebarSignalName { get }
  • 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 use gtk_places_sidebar_get_location() to get the file to which the item refers.

    The selected_item argument may be nil 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 to g_object_ref() the selected_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 a GtkMenu, and you were expected to add your items as GtkMenuItems. Since 3.18, the popup may be implemented as a GtkPopover, in which case container will be something else, e.g. a GtkBox, to which you may add GtkModelButtons or other widgets, such as GtkEntries, GtkSpinButtons, etc. If your application can deal with this situation, you can set GtkPlacesSidebar::populate-all to true to request that this signal is emitted for populating popovers as well.

    Note

    This represents the underlying populate-popup signal

    Declaration

    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 another GtkContainer

    selectedItem

    GFile with the item to which the popup should refer, or nil in the case of a selected_volume.

    selectedVolume

    GVolume if the selected item is a volume, or nil if it is a file.

    handler

    The signal handler to call Run the given callback whenever the populatePopup signal is emitted

  • populatePopupSignal Extension method

    Typed populate-popup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var populatePopupSignal: PlacesSidebarSignalName { get }
  • 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 underlying show-connect-to-server signal

    Declaration

    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 method

    Typed show-connect-to-server signal for using the connect(signal:) methods

    Declaration

    Swift

    static var showConnectToServerSignal: PlacesSidebarSignalName { get }
  • 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 underlying show-enter-location signal

    Declaration

    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 method

    Typed show-enter-location signal for using the connect(signal:) methods

    Declaration

    Swift

    static var showEnterLocationSignal: PlacesSidebarSignalName { get }
  • 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 underlying show-error-message signal

    Declaration

    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 method

    Typed show-error-message signal for using the connect(signal:) methods

    Declaration

    Swift

    static var showErrorMessageSignal: PlacesSidebarSignalName { get }
  • 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 underlying show-other-locations signal

    Declaration

    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 method

    Typed show-other-locations signal for using the connect(signal:) methods

    Declaration

    Swift

    static var showOtherLocationsSignal: PlacesSidebarSignalName { get }
  • 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 underlying show-other-locations-with-flags signal

    Declaration

    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

  • Typed show-other-locations-with-flags signal for using the connect(signal:) methods

    Declaration

    Swift

    static var showOtherLocationsWithFlagsSignal: PlacesSidebarSignalName { get }
  • 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 underlying show-starred-location signal

    Declaration

    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 method

    Typed show-starred-location signal for using the connect(signal:) methods

    Declaration

    Swift

    static var showStarredLocationSignal: PlacesSidebarSignalName { get }
  • onUnmount(flags:handler:) Extension method

    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 underlying unmount signal

    Declaration

    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 method

    Typed unmount signal for using the connect(signal:) methods

    Declaration

    Swift

    static var unmountSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::local-only signal

    Declaration

    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 method

    Typed notify::local-only signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyLocalOnlySignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::location signal

    Declaration

    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 method

    Typed notify::location signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyLocationSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::open-flags signal

    Declaration

    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 method

    Typed notify::open-flags signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyOpenFlagsSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::populate-all signal

    Declaration

    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 method

    Typed notify::populate-all signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPopulateAllSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::show-connect-to-server signal

    Declaration

    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

  • Typed notify::show-connect-to-server signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowConnectToServerSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::show-desktop signal

    Declaration

    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 method

    Typed notify::show-desktop signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowDesktopSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::show-enter-location signal

    Declaration

    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

  • Typed notify::show-enter-location signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowEnterLocationSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::show-other-locations signal

    Declaration

    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

  • Typed notify::show-other-locations signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowOtherLocationsSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::show-recent signal

    Declaration

    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 method

    Typed notify::show-recent signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowRecentSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::show-starred-location signal

    Declaration

    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

  • Typed notify::show-starred-location signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowStarredLocationSignal: PlacesSidebarSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::show-trash signal

    Declaration

    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 method

    Typed notify::show-trash signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowTrashSignal: PlacesSidebarSignalName { get }

PlacesSidebar Class: PlacesSidebarProtocol extension (methods and fields)

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

    Returns the value previously set with gtk_places_sidebar_set_local_only().

    Declaration

    Swift

    @inlinable
    func getLocalOnly() -> Bool
  • getLocation() Extension method

    Gets the currently selected location in the sidebar. This can be nil when nothing is selected, for example, when gtk_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 the GtkPlacesSidebar::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 method

    Gets the open flags.

    Declaration

    Swift

    @inlinable
    func getOpenFlags() -> PlacesOpenFlags
  • getShowConnectToServer() Extension method

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

    Returns the value previously set with gtk_places_sidebar_set_show_desktop()

    Declaration

    Swift

    @inlinable
    func getShowDesktop() -> Bool
  • getShowEnterLocation() Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_enter_location()

    Declaration

    Swift

    @inlinable
    func getShowEnterLocation() -> Bool
  • getShowOtherLocations() Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_other_locations()

    Declaration

    Swift

    @inlinable
    func getShowOtherLocations() -> Bool
  • getShowRecent() Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_recent()

    Declaration

    Swift

    @inlinable
    func getShowRecent() -> Bool
  • getShowStarredLocation() Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_starred_location()

    Declaration

    Swift

    @inlinable
    func getShowStarredLocation() -> Bool
  • getShowTrash() Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_trash()

    Declaration

    Swift

    @inlinable
    func getShowTrash() -> Bool
  • listShortcuts() Extension method

    Gets 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 the location is not a shortcut in the sidebar, then nothing is done.

    Declaration

    Swift

    @inlinable
    func removeShortcut<FileT>(location: FileT) where FileT : FileProtocol
  • 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, the sidebar will highlight that location if it is being shown in the list of places, or it will unhighlight everything if the location 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, the sidebar will highlight that location if it is being shown in the list of places, or it will unhighlight everything if the location 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 the flags that was passed in gtk_places_sidebar_set_open_flags().

    Passing 0 for flags will cause GTK_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 to true, 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 method

    Returns the value previously set with gtk_places_sidebar_set_local_only().

    Declaration

    Swift

    @inlinable
    var localOnly: Bool { get nonmutating set }
  • location Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var location: GIO.FileRef! { get nonmutating set }
  • openFlags Extension method

    Gets the open flags.

    Declaration

    Swift

    @inlinable
    var openFlags: PlacesOpenFlags { get nonmutating set }
  • showConnectToServer Extension method

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

    Returns the value previously set with gtk_places_sidebar_set_show_desktop()

    Declaration

    Swift

    @inlinable
    var showDesktop: Bool { get nonmutating set }
  • showEnterLocation Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_enter_location()

    Declaration

    Swift

    @inlinable
    var showEnterLocation: Bool { get nonmutating set }
  • showOtherLocations Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_other_locations()

    Declaration

    Swift

    @inlinable
    var showOtherLocations: Bool { get nonmutating set }
  • showRecent Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_recent()

    Declaration

    Swift

    @inlinable
    var showRecent: Bool { get nonmutating set }
  • showStarredLocation Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_starred_location()

    Declaration

    Swift

    @inlinable
    var showStarredLocation: Bool { get nonmutating set }
  • showTrash Extension method

    Returns the value previously set with gtk_places_sidebar_set_show_trash()

    Declaration

    Swift

    @inlinable
    var showTrash: Bool { get nonmutating set }