YelpLocationEntry

YelpLocationEntry — A location entry with history and search

Functions

Properties

YelpBookmarks * bookmarks Read / Write / Construct Only
gboolean enable-search Read / Write / Construct
YelpView * view Read / Write / Construct Only

Signals

void bookmark-clicked Run Last
void location-selected Run Last
void search-activated Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── GtkComboBox
                        ╰── YelpLocationEntry

Implemented Interfaces

YelpLocationEntry implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.

Includes

#include <yelp.h>

Description

YelpLocationEntry is a GtkComboBox designed to show the current location, provide a drop-down menu of previous locations, and allow the user to perform searches.

The GtkTreeModel used by a YelpLocationEntry is expected to have at least four columns: “entry-text-column” contains the displayed name of the location, “desc-column” contains a description for each entry, “icon-column” contains an icon name for the location, and “flags-column” contains a bit field of YelpLocationEntryFlags. These columns are specified when creating a YelpLocationEntry widget with yelp_location_entry_new_with_model().

Usually, a single row in the GtkTreeModel corresponds to a location. When a user selects a row from the drop-down menu, the icon and text for that row will be placed in the embedded text entry, and the “location-selected” signal will be emitted.

If a row has the YELP_LOCATION_ENTRY_IS_SEARCH flag set, selecting that row will not emit the “location-selected” signal. Instead, the YelpLocationEntry widget will be placed into search mode, as if by a call to yelp_location_entry_start_search().

When a row has the YELP_LOCATION_ENTRY_CAN_BOOKMARK flag set, an icon will be displayed in the secondary icon position of the embedded text entry allowing the user to bookmark the location. Clicking this icon will cause the FIXME signal to be emitted.

Functions

yelp_location_entry_new ()

GtkWidget *
yelp_location_entry_new (YelpView *window,
                         YelpBookmarks *bookmarks);

Creates a new YelpLocationEntry widget to control view .

Parameters

view

A YelpView.

 

Returns

A new YelpLocationEntry.


yelp_location_entry_start_search ()

void
yelp_location_entry_start_search (YelpLocationEntry *entry);

Puts entry into search mode. This focuses the entry and clears its text contents. When the user activates the search, the “search-activated” signal will be emitted.

Parameters

entry

A YelpLocationEntry.

 

Types and Values

struct YelpLocationEntry

struct YelpLocationEntry;

struct YelpLocationEntryClass

struct YelpLocationEntryClass {
    GtkComboBoxClass     parent;

    void     (* location_selected)          (YelpLocationEntry *entry);
    void     (* search_activated)           (YelpLocationEntry *entry);
    void     (* bookmark_clicked)           (YelpLocationEntry *entry);

    /* Padding for future expansion */
    void (*_gtk_reserved0) (void);
    void (*_gtk_reserved1) (void);
    void (*_gtk_reserved2) (void);
    void (*_gtk_reserved3) (void);
};

Property Details

The “bookmarks” property

  “bookmarks”                YelpBookmarks *

An instance of an implementation of YelpBookmarks to provide bookmark information for this location entry.

Flags: Read / Write / Construct Only


The “enable-search” property

  “enable-search”            gboolean

Whether the location entry can act as a search entry. If search is not enabled, the user will not be able to initiate a search by clicking in the embedded text entry or selecting a search row in the drop-down menu.

Flags: Read / Write / Construct

Default value: TRUE


The “view” property

  “view”                     YelpView *

The YelpView instance that this location entry controls.

Flags: Read / Write / Construct Only

Signal Details

The “bookmark-clicked” signal

void
user_function (YelpLocationEntry *widget,
               gpointer           user_data)

This signal will be emitted whenever a user clicks the bookmark icon embedded in the location entry.

Parameters

widget

The YelpLocationEntry for which the signal was emitted.

 

user_data

User data set when the handler was connected.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “location-selected” signal

void
user_function (YelpLocationEntry *widget,
               gpointer           user_data)

This signal will be emitted whenever a user selects a normal row from the drop-down menu. Note that if a row has the flag YELP_LOCATION_ENTRY_IS_SEARCH, clicking the row will cause widget to enter search mode, and this signal will not be emitted.

Parameters

widget

The YelpLocationEntry for which the signal was emitted.

 

user_data

User data set when the handler was connected.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “search-activated” signal

void
user_function (YelpLocationEntry *widget,
               gchar             *text,
               gpointer           user_data)

This signal will be emitted whenever the user activates a search, generally by pressing Enter in the embedded text entry while widget is in search mode.

Parameters

widget

The YelpLocationEntry for which the signal was emitted.

 

text

The search text.

 

user_data

User data set when the handler was connected.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last