DzlSuggestionEntry

DzlSuggestionEntry

Functions

Properties

GListModel * model Read / Write
gchar * typed-text Read

Signals

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

Types and Values

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_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);

  gpointer _reserved1;
  gpointer _reserved2;
  gpointer _reserved3;
  gpointer _reserved4;
  gpointer _reserved5;
  gpointer _reserved6;
  gpointer _reserved7;
  gpointer _reserved8;
};

DzlSuggestionEntry

typedef struct _DzlSuggestionEntry DzlSuggestionEntry;

Property Details

The “model” property

  “model”                    GListModel *

The model to be visualized.

Flags: Read / Write


The “typed-text” property

  “typed-text”               gchar *

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

Flags: Read

Default value: NULL

Signal Details

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,
               gint                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