EphyNodeView

EphyNodeView — A GtkTreeView displaying a collection of EphyNode elements.

Synopsis

struct              EphyNodeView;
enum                EphyNodeViewPriority;
enum                EphyNodeViewFlags;
GtkWidget *         ephy_node_view_new                  (EphyNode *root,
                                                         EphyNodeFilter *filter);
void                ephy_node_view_add_toggle           (EphyNodeView *view,
                                                         EphyTreeModelNodeValueFunc value_func,
                                                         gpointer data);
int                 ephy_node_view_add_column           (EphyNodeView *view,
                                                         const char *title,
                                                         GType value_type,
                                                         guint prop_id,
                                                         EphyNodeViewFlags flags,
                                                         EphyTreeModelNodeValueFunc icon_func,
                                                         GtkTreeViewColumn **ret);
int                 ephy_node_view_add_data_column      (EphyNodeView *view,
                                                         GType value_type,
                                                         guint prop_id,
                                                         EphyTreeModelNodeValueFunc func,
                                                         gpointer data);
void                ephy_node_view_set_sort             (EphyNodeView *view,
                                                         GType value_type,
                                                         guint prop_id,
                                                         GtkSortType sort_type);
void                ephy_node_view_set_priority         (EphyNodeView *view,
                                                         EphyNodeViewPriority priority_prop_id);
void                ephy_node_view_remove               (EphyNodeView *view);
GList *             ephy_node_view_get_selection        (EphyNodeView *view);
void                ephy_node_view_select_node          (EphyNodeView *view,
                                                         EphyNode *node);
void                ephy_node_view_enable_drag_source   (EphyNodeView *view,
                                                         const GtkTargetEntry *types,
                                                         int n_types,
                                                         int base_drag_column_id,
                                                         int extra_drag_column_id);
void                ephy_node_view_enable_drag_dest     (EphyNodeView *view,
                                                         const GtkTargetEntry *types,
                                                         int n_types);
void                ephy_node_view_edit                 (EphyNodeView *view,
                                                         gboolean remove_if_cancelled);
gboolean            ephy_node_view_is_target            (EphyNodeView *view);
void                ephy_node_view_popup                (EphyNodeView *view,
                                                         GtkWidget *menu);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkWidget
               +----GtkContainer
                     +----GtkTreeView
                           +----EphyNodeView

Implemented Interfaces

EphyNodeView implements AtkImplementorIface, GtkBuildable and GtkScrollable.

Properties

  "filter"                   EphyNodeFilter*       : Read / Write
  "root"                     gpointer              : Read / Write / Construct Only

Signals

  "node-activated"                                 : Run Last
  "node-dropped"                                   : Run Last
  "node-middle-clicked"                            : Run Last
  "node-selected"                                  : Run Last
  "node-toggled"                                   : Run Last

Description

EphyNodeView implements a GtkTreeView displaying a given set of EphyNode elements. It implements drag and dropping.

Details

struct EphyNodeView

struct EphyNodeView;


enum EphyNodeViewPriority

typedef enum {
	EPHY_NODE_VIEW_ALL_PRIORITY,
	EPHY_NODE_VIEW_SPECIAL_PRIORITY,
	EPHY_NODE_VIEW_NORMAL_PRIORITY
} EphyNodeViewPriority;


enum EphyNodeViewFlags

typedef enum {
	EPHY_NODE_VIEW_SHOW_PRIORITY = 1 << 0,
	EPHY_NODE_VIEW_SORTABLE = 1 << 1,
	EPHY_NODE_VIEW_EDITABLE = 1 << 2,
	EPHY_NODE_VIEW_SEARCHABLE = 1 << 3,
	EPHY_NODE_VIEW_ELLIPSIZED = 1 << 4
} EphyNodeViewFlags;


ephy_node_view_new ()

GtkWidget *         ephy_node_view_new                  (EphyNode *root,
                                                         EphyNodeFilter *filter);

Creates a new EphyNodeView using filter as the model and root as the root node.

root :

the root EphyNode for the view

filter :

a filter model for the view

Returns :

a new EphyNodeView as a GtkWidget

ephy_node_view_add_toggle ()

void                ephy_node_view_add_toggle           (EphyNodeView *view,
                                                         EphyTreeModelNodeValueFunc value_func,
                                                         gpointer data);

Append a new toggle column to view with its value set by value_func which can receive the optional data parameter.

view :

an EphyNodeView widget

value_func :

an EphyTreeModelNodeValueFunc function to set column values

data :

user_data to be passed to value_func

ephy_node_view_add_column ()

int                 ephy_node_view_add_column           (EphyNodeView *view,
                                                         const char *title,
                                                         GType value_type,
                                                         guint prop_id,
                                                         EphyNodeViewFlags flags,
                                                         EphyTreeModelNodeValueFunc icon_func,
                                                         GtkTreeViewColumn **ret);

Adds a new column, corresponding to a prop_id of the model, to the view.

view :

an EphyNodeView

title :

title for the column

value_type :

type to be held by the column

prop_id :

numeric id corresponding to the column in the model to be shown

flags :

flags for the new column

icon_func :

a function providing the icon for the column

ret :

location to store the created column

Returns :

the id of the new column

ephy_node_view_add_data_column ()

int                 ephy_node_view_add_data_column      (EphyNodeView *view,
                                                         GType value_type,
                                                         guint prop_id,
                                                         EphyTreeModelNodeValueFunc func,
                                                         gpointer data);

Adds a new column to view, taking its value from a column in the model defined by prop_id, or from func.

view :

an EphyNodeView

value_type :

type to be held by the column

prop_id :

property corresponding to the model behind view

func :

a data function for the column or NULL

data :

optional data for func

Returns :

the id of the new column

ephy_node_view_set_sort ()

void                ephy_node_view_set_sort             (EphyNodeView *view,
                                                         GType value_type,
                                                         guint prop_id,
                                                         GtkSortType sort_type);

Adds a sort column to the view corresponding to prop_id in the model.

view :

an EphyNodeView

value_type :

type of the value held at prop_id by the model

prop_id :

column id in the model

sort_type :

the sort mode

ephy_node_view_set_priority ()

void                ephy_node_view_set_priority         (EphyNodeView *view,
                                                         EphyNodeViewPriority priority_prop_id);

Adds a priority column to the view with priority_prop_id as the value.

view :

an EphyNodeView

priority_prop_id :

one of EphyNodeViewPriority

ephy_node_view_remove ()

void                ephy_node_view_remove               (EphyNodeView *view);

Remove the currently selected nodes from view.

view :

an EphyNodeView

ephy_node_view_get_selection ()

GList *             ephy_node_view_get_selection        (EphyNodeView *view);

Returns the selected elements of view as a GList of EphyNode elements.

view :

an EphyNodeView

Returns :

a GList of EphyNode elements

ephy_node_view_select_node ()

void                ephy_node_view_select_node          (EphyNodeView *view,
                                                         EphyNode *node);

Puts the selection of view on node.

view :

an EphyNodeView

node :

the EphyNode in the view to be selected

ephy_node_view_enable_drag_source ()

void                ephy_node_view_enable_drag_source   (EphyNodeView *view,
                                                         const GtkTargetEntry *types,
                                                         int n_types,
                                                         int base_drag_column_id,
                                                         int extra_drag_column_id);

Sets view as a drag source.

view :

an EphyNodeView

types :

a GtkTargetEntry for the view

n_types :

length of types

base_drag_column_id :

id of the column for ephy_tree_model_sort_set_base_drag_column_id

extra_drag_column_id :

id of the column for ephy_tree_model_sort_set_extra_drag_column_id

ephy_node_view_enable_drag_dest ()

void                ephy_node_view_enable_drag_dest     (EphyNodeView *view,
                                                         const GtkTargetEntry *types,
                                                         int n_types);

Set the types of drag destination allowed by view.

view :

the EphyNodeView

types :

types allowed as GtkTargetEntry

n_types :

count of types

ephy_node_view_edit ()

void                ephy_node_view_edit                 (EphyNodeView *view,
                                                         gboolean remove_if_cancelled);

Edits the currently selected node in view, the remove_if_cancelled parameter controls if the node should be removed if editing is cancelled.

view :

an EphyNodeView

remove_if_cancelled :

whether the edited node should be removed if editing is cancelled

ephy_node_view_is_target ()

gboolean            ephy_node_view_is_target            (EphyNodeView *view);

Tells if view is currently focused.

view :

an EphyNodeView

Returns :

TRUE if view is focused

ephy_node_view_popup ()

void                ephy_node_view_popup                (EphyNodeView *view,
                                                         GtkWidget *menu);

Triggers the popup of menu in view.

view :

an EphyNodeView widget

menu :

a GtkMenu to be shown

Property Details

The "filter" property

  "filter"                   EphyNodeFilter*       : Read / Write

An EphyNodeFilter object to use in the view.


The "root" property

  "root"                     gpointer              : Read / Write / Construct Only

A gpointer to the root node of the EphyNode elements of the view.

Signal Details

The "node-activated" signal

void                user_function                      (EphyNodeView *view,
                                                        gpointer      node,
                                                        gpointer      user_data)      : Run Last

Emitted when a row is activated.

view :

the object on which the signal is emitted

node :

the activated EphyNode

user_data :

user data set when the signal handler was connected.

The "node-dropped" signal

void                user_function                      (EphyNodeView *view,
                                                        gpointer      node,
                                                        gpointer      uris,
                                                        gpointer      user_data)      : Run Last

Emitted when an EphyNode is dropped into the EphyNodeView.

view :

the object on which the signal is emitted

node :

the dropped EphyNode

uris :

URIs from the dragged data

user_data :

user data set when the signal handler was connected.

The "node-middle-clicked" signal

void                user_function                      (EphyNodeView *view,
                                                        gpointer      node,
                                                        gpointer      user_data)      : Run Last

Emitted when the user middle clicks on a row of the EphyNodeView.

view :

the object on which the signal is emitted

node :

the clicked EphyNode

user_data :

user data set when the signal handler was connected.

The "node-selected" signal

void                user_function                      (EphyNodeView *view,
                                                        gpointer      node,
                                                        gpointer      user_data)      : Run Last

Emitted when a row is selected.

view :

the object on which the signal is emitted

node :

the selected EphyNode

user_data :

user data set when the signal handler was connected.

The "node-toggled" signal

void                user_function                      (EphyNodeView *view,
                                                        gpointer      node,
                                                        gboolean      checked,
                                                        gpointer      user_data)      : Run Last

Emitted when a row value is toggled, only emitted for toggle columns.

view :

the object on which the signal is emitted

node :

the target EphyNode

checked :

the new value of the toggle column

user_data :

user data set when the signal handler was connected.