## FmSidePane

FmSidePane — A widget for side pane displaying

## Functions

void | (*FmSidePaneUpdatePopup) ()
FmSidePane * | fm_side_pane_new ()
FmPath * | fm_side_pane_get_cwd ()
void | fm_side_pane_chdir ()
void | fm_side_pane_set_mode ()
FmSidePaneMode | fm_side_pane_get_mode ()
GtkWidget * | fm_side_pane_get_title_bar ()
void | fm_side_pane_set_popup_updater ()
const char * | fm_side_pane_get_mode_name ()
FmSidePaneMode | fm_side_pane_get_mode_by_name ()
gint | fm_side_pane_get_n_modes ()
const char * | fm_side_pane_get_mode_label ()
const char * | fm_side_pane_get_mode_tooltip ()
gboolean | fm_side_pane_set_show_hidden ()
gboolean | fm_side_pane_set_home_dir ()

## Signals

void | chdir | Run Last
void | mode-changed | Run Last

## Types and Values

enum | FmSidePaneMode
struct | FmSidePaneClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBox
                        ╰── GtkVBox
                            ╰── FmSidePane

## Description

`include` : libfm/fm-gtk.h

The FmSidePane widget displays side pane for fast navigation across places.

## Functions

### FmSidePaneUpdatePopup ()

    void
    (*FmSidePaneUpdatePopup) (FmSidePane *sp,
                              GtkUIManager *ui,
                              GtkActionGroup *act_grp,
                              FmFileInfo *file,
                              gpointer user_data);

The callback to update popup menu. It can disable items of menu, add some new, replace actions, etc. depending of the window and files. In some cases `file` may be incomplete so callback should check that.

#### Parameters

sp | the side pane widget |
ui | the object to add interface |
act_grp | group of actions to add action |
file | the file the popup menu was created for |
user_data | pointer passed to `fm_side_pane_set_popup_updater()` |

### fm_side_pane_new ()

    FmSidePane *
    fm_side_pane_new (void);

Creates new side pane.

#### Returns

a new FmSidePane widget.

[transfer full]

Since: 0.1.12

### fm_side_pane_get_cwd ()

    FmPath *
    fm_side_pane_get_cwd (FmSidePane *sp);

Retrieves current active path in the side pane. Returned data are owned by side pane and should not be freed by caller.

#### Parameters

sp | a widget to inspect |

#### Returns

active file path.

Since: 0.1.12

### fm_side_pane_chdir ()

    void
    fm_side_pane_chdir (FmSidePane *sp,
                        FmPath *path);

Changes active path in the side pane.

#### Parameters

sp | a widget to apply |
path | new path |

Since: 0.1.12

### fm_side_pane_set_mode ()

    void
    fm_side_pane_set_mode (FmSidePane *sp,
                           FmSidePaneMode mode);

Changes side pane view mode.

#### Parameters

sp | a widget to apply |
mode | new mode for the side pane |

Since: 0.1.12

### fm_side_pane_get_mode ()

    FmSidePaneMode
    fm_side_pane_get_mode (FmSidePane *sp);

Retrieves side pane view mode.

#### Parameters

sp | a widget to inspect |

#### Returns

current view mode.

Since: 0.1.12

### fm_side_pane_get_title_bar ()

    GtkWidget *
    fm_side_pane_get_title_bar (FmSidePane *sp);

Retrieves side pane title bar widget.

#### Parameters

sp | a widget to inspect |

#### Returns

pointer to title bar of side pane.

[transfer none]

Since: 0.1.14

### fm_side_pane_set_popup_updater ()

    void
    fm_side_pane_set_popup_updater (FmSidePane *sp,
                                    FmSidePaneUpdatePopup update_popup,
                                    gpointer user_data);

Sets up the callback to update context menu on any item in the sidebar widget.

#### Parameters

sp | a widget to set |
update_popup | a callback to update popup. | [allow-none]
user_data | user data supplied for callback |

Since: 1.2.0

### fm_side_pane_get_mode_name ()

    const char *
    fm_side_pane_get_mode_name (FmSidePaneMode mode);

Retrieves the name of the specified side pane `mode` , or `NULL` if `mode` is invalid. The name of mode may be used for config save or another similar purpose. Returned data are owned by implementation and should be not freed by caller.

#### Parameters

mode | mode to convert |

#### Returns

the name associated with `mode` .

Since: 1.2.0

### fm_side_pane_get_mode_by_name ()

    FmSidePaneMode
    fm_side_pane_get_mode_by_name (const char *str);

Finds mode which have an associated name equal to `str` .

#### Parameters

str | the name of mode |

#### Returns

mode or FM_SP_NONE if `str` specifies invalid mode.

Since: 1.2.0

### fm_side_pane_get_n_modes ()

    gint
    fm_side_pane_get_n_modes (void);

Tests how many view modes are known to create FmSidePane widget. The returned value is the highest FmSidePaneMode that can be used due to historical reasons since FmSidePaneMode equal to 0 is invalid.

#### Returns

number of known modes for side pane.

Since: 1.2.0

### fm_side_pane_get_mode_label ()

    const char *
    fm_side_pane_get_mode_label (FmSidePaneMode mode);

Retrieves label for `mode` which can be used in menus. Returned data should not be freed by caller.

#### Parameters

mode | the view mode |

#### Returns

desription or `NULL` if `mode` is invalid.

Since: 1.2.0

### fm_side_pane_get_mode_tooltip ()

    const char *
    fm_side_pane_get_mode_tooltip (FmSidePaneMode mode);

Retrieves tooltip for `mode` which can be used in menus. Returned data should not be freed by caller.

#### Parameters

mode | the view mode |

#### Returns

desription or `NULL` if `mode` is invalid.

Since: 1.2.0

### fm_side_pane_set_show_hidden ()

    gboolean
    fm_side_pane_set_show_hidden (FmSidePane *sp,
                                  gboolean show_hidden);

Changes visibility of hidden files in side pane `sp` .

#### Parameters

sp | a widget to apply |
show_hidden | `TRUE` to show hidden files in side pane |

#### Returns

`TRUE` if current side pane mode accepts this change.

Since: 1.2.0

### fm_side_pane_set_home_dir ()

    gboolean
    fm_side_pane_set_home_dir (FmSidePane *sp,
                               const char *home_dir);

Changes path used by side pane view for "Home" items if view mode has any such items.

#### Parameters

sp | a widget to apply |
home_dir | a new path to set |

#### Returns

`TRUE` if current side pane mode accepts this change.

Since: 1.2.0

## Types and Values

### enum FmSidePaneMode

Mode of side pane view.

#### Members

FM_SP_NONE | invalid mode |
FM_SP_PLACES | FmPlacesView mode |
FM_SP_DIR_TREE | FmDirTreeView mode |
FM_SP_REMOTE | reserved mode |

### struct FmSidePaneClass

    struct FmSidePaneClass {
        GtkVBoxClass parent_class;
        void (*chdir)(FmSidePane* sp, guint button, FmPath* path);
        void (*mode_changed)(FmSidePane* sp);
    };

#### Members

`chdir` () | the class closure for the “chdir” signal |
`mode_changed` () | the class closure for the “mode-changed” signal |

## Signal Details

### The `“chdir”` signal

    void
    user_function (FmSidePane *pane,
                   guint       button,
                   gpointer    path,
                   gpointer    user_data)

The “chdir” signal is emitted when current selected directory in the `pane` is changed.

#### Parameters

pane | the widget which emitted the signal |
button | the button path was activated with |
path | (FmPath *) new directory path |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 0.1.12

### The `“mode-changed”` signal

    void
    user_function (FmSidePane *pane,
                   gpointer    user_data)

The “mode-changed” signal is emitted when view mode in the pane is changed.

#### Parameters

pane | the widget which emitted the signal |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 0.1.12