HildonFindToolbar

HildonFindToolbar — A toolbar with a search field.

Synopsis


#include <hildon/hildon.h>

                    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, GtkBuildable and GtkToolShell.

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 HildonFindToolbar, 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 an initial GtkTreeModel.

label : label for the HildonFindToolbar, NULL to set the label to default "Find".
model : a GtkListStore.
column : indicates which column the search history list will retrieve the 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 HildonFindToolbar.

ftb : HildonFindToolbar 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 HildonFindToolbar's GtkComboBox. Simply calls gtk_combo_box_set_active() on the HildonFindToolbar's GtkComboBox.

toolbar : A HildonFindToolbar to operate on.
index : An index in the model, 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 GtkComboBox.

toolbar : A HildonFindToolbar to query.
Returns : the index of the currently active item, or -1 if there is 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 GtkComboBox.

toolbar : A HildonFindToolbar to operate on.
iter : A GtkTreeIter to activate.

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 GtkComboBox.

toolbar : A HildonFindToolbar 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 HildonFindToolbar. Can be used to set this item active in the "history-append" signal.

toolbar : A HildonFindToolbar to query.
Returns : Index of the most recent 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

The 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