## inf-gtk-browser-model inf-gtk-browser-model |

## Synopsis

    #define             INF_GTK_TYPE_BROWSER_MODEL_STATUS
                        InfGtkBrowserModel;
    enum                InfGtkBrowserModelStatus;
    enum                InfGtkBrowserModelColumn;
    void                inf_gtk_browser_model_set_browser   (InfGtkBrowserModel *model,
                                                             GtkTreePath *path,
                                                             GtkTreeIter *iter,
                                                             InfcBrowser *browser);
    void                inf_gtk_browser_model_resolve       (InfGtkBrowserModel *model,
                                                             InfDiscovery *discovery,
                                                             InfDiscoveryInfo *info);
    gboolean            inf_gtk_browser_model_browser_iter_to_tree_iter
                                                            (InfGtkBrowserModel *model,
                                                             InfcBrowser *browser,
                                                             InfcBrowserIter *browser_iter,
                                                             GtkTreeIter *tree_iter);

## Object Hierarchy

      GInterface
       +----InfGtkBrowserModel

      GEnum
       +----InfGtkBrowserModelStatus

## Prerequisites

InfGtkBrowserModel requires GtkTreeModel and GObject.

## Known Implementations

InfGtkBrowserModel is implemented by InfGtkBrowserModelFilter, InfGtkBrowserModelSort and InfGtkBrowserStore.

## Signals

      "set-browser"                                    : Run Last

## Description

## Details

### INF_GTK_TYPE_BROWSER_MODEL_STATUS

    #define INF_GTK_TYPE_BROWSER_MODEL_STATUS          (inf_gtk_browser_model_status_get_type())

### InfGtkBrowserModel

    typedef struct _InfGtkBrowserModel InfGtkBrowserModel;

### enum InfGtkBrowserModelStatus

    typedef enum {
      INF_GTK_BROWSER_MODEL_INVALID,
      INF_GTK_BROWSER_MODEL_DISCOVERED,
      INF_GTK_BROWSER_MODEL_RESOLVING,
      INF_GTK_BROWSER_MODEL_DISCONNECTED,
      INF_GTK_BROWSER_MODEL_CONNECTING,
      INF_GTK_BROWSER_MODEL_CONNECTED,
      INF_GTK_BROWSER_MODEL_ERROR
    } InfGtkBrowserModelStatus;

### enum InfGtkBrowserModelColumn

    typedef enum {
      INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO,
      INF_GTK_BROWSER_MODEL_COL_DISCOVERY,
      INF_GTK_BROWSER_MODEL_COL_BROWSER,
      INF_GTK_BROWSER_MODEL_COL_STATUS, /* only toplevel */
      INF_GTK_BROWSER_MODEL_COL_NAME,
      INF_GTK_BROWSER_MODEL_COL_ERROR,
      INF_GTK_BROWSER_MODEL_COL_NODE,

      INF_GTK_BROWSER_MODEL_NUM_COLS
    } InfGtkBrowserModelColumn;

### inf_gtk_browser_model_set_browser ()

    void                inf_gtk_browser_model_set_browser   (InfGtkBrowserModel *model,
                                                             GtkTreePath *path,
                                                             GtkTreeIter *iter,
                                                             InfcBrowser *browser);

Emits the "set-browser" signal. This is supposed to only be called by implementations of InfGtkBrowserModel whenever they set or unset a browser on a row.

`model` : | A InfGtkBrowserModel.
`path` : | A GtkTreePath to a top-level row.
`iter` : | A GtkTreeIter pointing to the same row.
`browser` : | The new InfcBrowser to set.

### inf_gtk_browser_model_resolve ()

    void                inf_gtk_browser_model_resolve       (InfGtkBrowserModel *model,
                                                             InfDiscovery *discovery,
                                                             InfDiscoveryInfo *info);

Resolves `info` and adds the resulting connection to the model. If that connection is already contained, the original (newly resolved) entry is removed in favor of the existing entry whose browser might already have explored (parts of) the server's directory.

`model` : | A InfGtkBrowserModel.
`discovery` : | A InfDiscovery added to `store`.
`info` : | A InfDiscoveryInfo discovered by `discovery`.

### inf_gtk_browser_model_browser_iter_to_tree_iter ()

    gboolean            inf_gtk_browser_model_browser_iter_to_tree_iter
                                                            (InfGtkBrowserModel *model,
                                                             InfcBrowser *browser,
                                                             InfcBrowserIter *browser_iter,
                                                             GtkTreeIter *tree_iter);

Sets `tree_iter` to point to the same node `browser_iter` refers to within the model. If `browser` is not known to `model`, i.e. its connection was never added to `model`, then the function returns `FALSE` and `tree_iter` is left untouched.

`model` : | A InfGtkBrowserModel.
`browser` : | A InfcBrowser.
`browser_iter` : | A InfcBrowserIter pointing into `browser`.
`tree_iter` : | A GtkTreeIter that will be set by this function.
Returns : | Whether `tree_iter` was set.

## Signal Details

### The `"set-browser"` signal

    void                user_function                      (InfGtkBrowserModel *model,
                                                            GtkTreePath        *path,
                                                            GtkTreeIter        *iter,
                                                            InfcBrowser        *browser,
                                                            gpointer            user_data)      : Run Last

This signal is emitted every time a new browser is inserted to the model. This means either that a completely new item was inserted, or that an item providing only a discovery has been resolved (see `inf_gtk_browser_model_resolve()`).

`model` : | The InfGtkBrowserModel emitting the signal.
`path` : | A GtkTreePath pointing to the newly created browser.
`iter` : | A GtkTreeIter pointing to the newly created browser.
`browser` : | The newly created InfcBrowser.
`user_data` : | user data set when the signal handler was connected.