HildonFindToolbar

HildonFindToolbar — A toolbar with a search field.

Synopsis

                    HildonFindToolbar;
GtkWidget*          hildon_find_toolbar_new             (const gchar *label);
GtkWidget*          hildon_find_toolbar_new_with_model  (const gchar *label,
                                                         GtkListStore *model,
                                                         gint column);
void                hildon_find_toolbar_highlight_entry (HildonFindToolbar *ftb,
                                                         gboolean get_focus);
void                hildon_find_toolbar_set_active      (HildonFindToolbar *toolbar,
                                                         gint index);
gint                hildon_find_toolbar_get_active      (HildonFindToolbar *toolbar);
void                hildon_find_toolbar_set_active_iter (HildonFindToolbar *toolbar,
                                                         GtkTreeIter *iter);
gboolean            hildon_find_toolbar_get_active_iter (HildonFindToolbar *toolbar,
                                                         GtkTreeIter *iter);
gint32              hildon_find_toolbar_get_last_index  (HildonFindToolbar *toolbar);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkToolbar
                                 +----HildonFindToolbar

Implemented Interfaces

HildonFindToolbar implements AtkImplementorIface and GtkBuildable.

Properties

  "column"                   gint                  : Read / Write
  "history-limit"            gint                  : Read / Write / Construct
  "label"                    gchar*                : Read / Write / Construct
  "list"                     GtkListStore*         : Read / Write
  "max-characters"           gint                  : Read / Write / Construct
  "prefix"                   gchar*                : Read / Write

Signals

  "close"                                          : Run Last
  "history-append"                                 : Run Last
  "invalid-input"                                  : Run Last
  "search"                                         : Run Last

Description

HildonFindToolbar is a toolbar that contains a search entry and a dropdown list with previously searched strings. The list is represented using a GtkListStore and can be accesed using a property 'list'. Entries are added automatically to the list when the search button is pressed.

Details

HildonFindToolbar

typedef struct _HildonFindToolbar HildonFindToolbar;


hildon_find_toolbar_new ()

GtkWidget*          hildon_find_toolbar_new             (const gchar *label);

Creates a new HildonFindToolbar.

label : label for the find_toolbar, NULL to set the label to default "Find"
Returns : a new HildonFindToolbar

hildon_find_toolbar_new_with_model ()

GtkWidget*          hildon_find_toolbar_new_with_model  (const gchar *label,
                                                         GtkListStore *model,
                                                         gint column);

Creates a new HildonFindToolbar with a model.

label : label for the find_toolbar, NULL to set the label to default "Find"
model : a GtkListStore
column : indicating which column the search histry list will retreive string from
Returns : a new HildonFindToolbar

hildon_find_toolbar_highlight_entry ()

void                hildon_find_toolbar_highlight_entry (HildonFindToolbar *ftb,
                                                         gboolean get_focus);

Highlights the current entry in the find toolbar.

ftb : find Toolbar whose entry is to be highlighted
get_focus : if user passes TRUE to this value, then the text in the entry will not only get highlighted, but also get focused.

hildon_find_toolbar_set_active ()

void                hildon_find_toolbar_set_active      (HildonFindToolbar *toolbar,
                                                         gint index);

Sets the active item on the toolbar's combo-box. Simply calls gtk_combo_box_set_active on the HildonFindToolbar's combo.

toolbar : A find toolbar to operate on
index : An index in the model passed during construction, or -1 to have no active item

hildon_find_toolbar_get_active ()

gint                hildon_find_toolbar_get_active      (HildonFindToolbar *toolbar);

Gets the index of the currently active item, or -1 if there's no active item. Simply calls gtk_combo_box_get_active on the HildonFindToolbar's combo.

toolbar : A find toolbar to query
Returns : An integer which is the index of the currently active item, or -1 if there's no active item.

hildon_find_toolbar_set_active_iter ()

void                hildon_find_toolbar_set_active_iter (HildonFindToolbar *toolbar,
                                                         GtkTreeIter *iter);

Sets the current active item to be the one referenced by iter. Simply calls gtk_combo_box_set_active_iter on the HildonFindToolbar's combo.

toolbar : A find toolbar to operate on
iter : An iter to make active

hildon_find_toolbar_get_active_iter ()

gboolean            hildon_find_toolbar_get_active_iter (HildonFindToolbar *toolbar,
                                                         GtkTreeIter *iter);

Sets iter to point to the current active item, if it exists. Simply calls gtk_combo_box_get_active_iter on the HildonFindToolbar's combo.

toolbar : A find toolbar to query
iter : The uninitialized GtkTreeIter
Returns : TRUE, if iter was set

hildon_find_toolbar_get_last_index ()

gint32              hildon_find_toolbar_get_last_index  (HildonFindToolbar *toolbar);

Returns the index of the last (most recently added) item in the toolbar. Can be used to set this item active in the history-append signal.

toolbar : A find toolbar to query
Returns : Index of the last entry

Property Details

The "column" property

  "column"                   gint                  : Read / Write

The column number in GtkListStore where strings of search history are kept.

Allowed values: >= 0

Default value: 0


The "history-limit" property

  "history-limit"            gint                  : Read / Write / Construct

Maximum number of history items in the combobox.

Allowed values: >= 0

Default value: 5


The "label" property

  "label"                    gchar*                : Read / Write / Construct

The label to display before the search box.

Default value: "ecdg_ti_find_toolbar_label"


The "list" property

  "list"                     GtkListStore*         : Read / Write

A GtkListStore where the search history is kept.


The "max-characters" property

  "max-characters"           gint                  : Read / Write / Construct

Maximum number of characters in search string.

Allowed values: [0,65535]

Default value: 0


The "prefix" property

  "prefix"                   gchar*                : Read / Write

Search string.

Default value: NULL

Signal Details

The "close" signal

void                user_function                      (HildonFindToolbar *toolbar,
                                                        gpointer           user_data)      : Run Last

Gets emitted when the close button is pressed.

toolbar : the toolbar which received the signal
user_data : user data set when the signal handler was connected.

The "history-append" signal

gboolean            user_function                      (HildonFindToolbar *toolbar,
                                                        gpointer           user_data)      : Run Last

Gets emitted when the current search prefix should be added to history.

toolbar : the toolbar which received the signal
user_data : user data set when the signal handler was connected.

The "invalid-input" signal

void                user_function                      (HildonFindToolbar *toolbar,
                                                        gpointer           user_data)      : Run Last

Gets emitted when the maximum search prefix length is reached and user tries to type more.

toolbar : the toolbar which received the signal
user_data : user data set when the signal handler was connected.

The "search" signal

void                user_function                      (HildonFindToolbar *toolbar,
                                                        gpointer           user_data)      : Run Last

Gets emitted when the find button is pressed.

toolbar : the toolbar which received the signal
user_data : user data set when the signal handler was connected.

See Also

HildonWindow