DzlSuggestionEntry: Dazzle Reference Manual

## DzlSuggestionEntry DzlSuggestionEntry |

## Functions

void | (*DzlSuggestionPositionFunc) ()
GtkWidget * | dzl_suggestion_entry_new ()
void | dzl_suggestion_entry_set_model ()
GListModel * | dzl_suggestion_entry_get_model ()
const gchar * | dzl_suggestion_entry_get_typed_text ()
DzlSuggestion * | dzl_suggestion_entry_get_suggestion ()
void | dzl_suggestion_entry_set_suggestion ()
void | dzl_suggestion_entry_set_position_func ()
gboolean | dzl_suggestion_entry_get_activate_on_single_click ()
void | dzl_suggestion_entry_set_activate_on_single_click ()
void | dzl_suggestion_entry_hide_suggestions ()
GtkWidget * | dzl_suggestion_entry_get_popover ()
gboolean | dzl_suggestion_entry_get_compact ()
void | dzl_suggestion_entry_set_compact ()
void | dzl_suggestion_entry_default_position_func ()
void | dzl_suggestion_entry_window_position_func ()

## Properties

gboolean | activate-on-single-click | Read / Write
gboolean | compact | Read / Write
GListModel * | model | Read / Write
DzlSuggestion * | suggestion | Read / Write
char * | typed-text | Read

## Signals

void | action | Action
void | activate-suggestion | Action
void | hide-suggestions | Action
void | move-suggestion | Action
void | show-suggestions | Action
void | suggestion-activated | Run Last
void | suggestion-selected | Run Last

## Types and Values

#define | DZL_TYPE_SUGGESTION_ENTRY
struct | DzlSuggestionEntryClass
| DzlSuggestionEntry

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkEntry
                    ╰── DzlSuggestionEntry

## Implemented Interfaces

DzlSuggestionEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.

## Description

## Functions

### DzlSuggestionPositionFunc ()

    void
    (*DzlSuggestionPositionFunc) (DzlSuggestionEntry *entry,
                                  GdkRectangle *area,
                                  gboolean *is_absolute,
                                  gpointer user_data);

Positions the popover in the coordinates defined by `area` .

If `is_absolute` is set to `TRUE`, then absolute coordinates are used. Otherwise, the position is expected to be relative to `entry` .

#### Parameters

entry | a DzlSuggestionEntry |
area | location to place the popover. | [inout]
is_absolute | If the area is in absolute coordinates. | [inout]
user_data | closure data |

Since: 3.26

### dzl_suggestion_entry_new ()

    GtkWidget *
    dzl_suggestion_entry_new (void);

### dzl_suggestion_entry_set_model ()

    void
    dzl_suggestion_entry_set_model (DzlSuggestionEntry *self,
                                    GListModel *model);

### dzl_suggestion_entry_get_model ()

    GListModel *
    dzl_suggestion_entry_get_model (DzlSuggestionEntry *self);

Gets the model being visualized.

#### Parameters

self | a DzlSuggestionEntry |

#### Returns

A GListModel or `NULL`.

[nullable][transfer none]

### dzl_suggestion_entry_get_typed_text ()

    const gchar *
    dzl_suggestion_entry_get_typed_text (DzlSuggestionEntry *self);

### dzl_suggestion_entry_get_suggestion ()

    DzlSuggestion *
    dzl_suggestion_entry_get_suggestion (DzlSuggestionEntry *self);

Gets the currently selected suggestion.

#### Parameters

self | a DzlSuggestionEntry |

#### Returns

An DzlSuggestion or `NULL`.

[nullable][transfer none]

### dzl_suggestion_entry_set_suggestion ()

    void
    dzl_suggestion_entry_set_suggestion (DzlSuggestionEntry *self,
                                         DzlSuggestion *suggestion);

### dzl_suggestion_entry_set_position_func ()

    void
    dzl_suggestion_entry_set_position_func
                                   (DzlSuggestionEntry *self,
                                    DzlSuggestionPositionFunc func,
                                    gpointer func_data,
                                    GDestroyNotify func_data_destroy);

Sets a position func to position the popover.

In `func` , you should set the height of the rectangle to the maximum height that the popover should be allowed to grow.

#### Parameters

self | a DzlSuggestionEntry |
func | A function to call to position the popover, or `NULL` to set the default. | [scope async][closure func_data][destroy func_data_destroy][nullable]
func_data | closure data for `func` . | [nullable]
func_data_destroy | a destroy notify for `func_data` . | [nullable]

Since: 3.26

### dzl_suggestion_entry_get_activate_on_single_click ()

    gboolean
    dzl_suggestion_entry_get_activate_on_single_click
                                   (DzlSuggestionEntry *self);

### dzl_suggestion_entry_set_activate_on_single_click ()

    void
    dzl_suggestion_entry_set_activate_on_single_click
                                   (DzlSuggestionEntry *self,
                                    gboolean activate_on_single_click);

### dzl_suggestion_entry_hide_suggestions ()

    void
    dzl_suggestion_entry_hide_suggestions (DzlSuggestionEntry *self);

### dzl_suggestion_entry_get_popover ()

    GtkWidget *
    dzl_suggestion_entry_get_popover (DzlSuggestionEntry *self);

Gets the result display widget for the entry. This is currently always a DzlSuggestionPopover.

#### Parameters

self | a DzlSuggestionEntry |

#### Returns

a GtkWidget.

[transfer none]

Since: 3.32

### dzl_suggestion_entry_get_compact ()

    gboolean
    dzl_suggestion_entry_get_compact (DzlSuggestionEntry *self);

Gets the “compact” property.

#### Parameters

self | a DzlSuggestionEntry |

#### Returns

`TRUE` if compact-mode is in use.

Since: 3.34

### dzl_suggestion_entry_set_compact ()

    void
    dzl_suggestion_entry_set_compact (DzlSuggestionEntry *self,
                                      gboolean compact);

Sets the “compact” property.

#### Parameters

self | a DzlSuggestionEntry |
compact | if compact mode should be used |

Since: 3.34

### dzl_suggestion_entry_default_position_func ()

    void
    dzl_suggestion_entry_default_position_func
                                   (DzlSuggestionEntry *self,
                                    GdkRectangle *area,
                                    gboolean *is_absolute,
                                    gpointer user_data);

### dzl_suggestion_entry_window_position_func ()

    void
    dzl_suggestion_entry_window_position_func
                                   (DzlSuggestionEntry *self,
                                    GdkRectangle *area,
                                    gboolean *is_absolute,
                                    gpointer user_data);

This is a DzlSuggestionPositionFunc that can be used to make the suggestion popover the full width of the window. It is similar to what you might find in a web browser.

## Types and Values

### DZL_TYPE_SUGGESTION_ENTRY

    #define DZL_TYPE_SUGGESTION_ENTRY (dzl_suggestion_entry_get_type())

### struct DzlSuggestionEntryClass

    struct DzlSuggestionEntryClass {
      GtkEntryClass parent_class;

      void (*hide_suggestions)     (DzlSuggestionEntry *self);
      void (*show_suggestions)     (DzlSuggestionEntry *self);
      void (*move_suggestion )     (DzlSuggestionEntry *self,
                                    gint                amount);
      void (*suggestion_activated) (DzlSuggestionEntry *self,
                                    DzlSuggestion      *suggestion);
      void (*suggestion_selected)  (DzlSuggestionEntry *self,
                                    DzlSuggestion      *suggestion);
    };

### DzlSuggestionEntry

    typedef struct _DzlSuggestionEntry DzlSuggestionEntry;

## Property Details

### The `“activate-on-single-click”` property

      “activate-on-single-click” gboolean

The "activate-on-single-click" property denotes if results should be activated simply by clicking on them. You may want to set this to `FALSE` if you want the behavior to only select the item.

Owner: DzlSuggestionEntry

Flags: Read / Write

Default value: FALSE

Since: 3.30

### The `“compact”` property

      “compact”                  gboolean

The "compact" property denotes if an alternate style should be used to reduce the width of the rows. This may be ideal in size contrained situations with portrait display.

Owner: DzlSuggestionEntry

Flags: Read / Write

Default value: FALSE

Since: 3.34

### The `“model”` property

      “model”                    GListModel *

The model to be visualized.

Owner: DzlSuggestionEntry

Flags: Read / Write

### The `“suggestion”` property

      “suggestion”               DzlSuggestion *

The "suggestion" property is the currently selected suggestion, if any.

Owner: DzlSuggestionEntry

Flags: Read / Write

Since: 3.30

### The `“typed-text”` property

      “typed-text”               char *

Typed text into the entry, does not include suggested text.

Owner: DzlSuggestionEntry

Flags: Read

Default value: NULL

## Signal Details

### The `“action”` signal

    void
    user_function (DzlSuggestionEntry *dzlsuggestionentry,
                   char               *arg1,
                   char               *arg2,
                   char               *arg3,
                   gpointer            user_data)

Flags: Action

### The `“activate-suggestion”` signal

    void
    user_function (DzlSuggestionEntry *dzlsuggestionentry,
                   gpointer            user_data)

Flags: Action

### The `“hide-suggestions”` signal

    void
    user_function (DzlSuggestionEntry *dzlsuggestionentry,
                   gpointer            user_data)

Flags: Action

### The `“move-suggestion”` signal

    void
    user_function (DzlSuggestionEntry *self,
                   int                 amount,
                   gpointer            user_data)

This moves the selected suggestion in the popover by the value provided. -1 moves up one row, 1, moves down a row.

#### Parameters

self | A DzlSuggestionEntry |
amount | The number of items to move |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“show-suggestions”` signal

    void
    user_function (DzlSuggestionEntry *dzlsuggestionentry,
                   gpointer            user_data)

Flags: Action

### The `“suggestion-activated”` signal

    void
    user_function (DzlSuggestionEntry *dzlsuggestionentry,
                   DzlSuggestion      *arg1,
                   gpointer            user_data)

Flags: Run Last

### The `“suggestion-selected”` signal

    void
    user_function (DzlSuggestionEntry *self,
                   DzlSuggestion      *suggestion,
                   gpointer            user_data)

This signal is emitted when a selection has been specifically selected by the user, such as by clicking on the row or moving to the row with keyboard, such as with “move-suggestion”

#### Parameters

self | a DzlSuggestionEntry |
suggestion | a DzlSuggestion |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.30