HudItem

HudItem — a user-interesting item that can be activated

Synopsis

                    HudItem;
struct              HudItemClass;
void                hud_item_activate                   (HudItem *item,
                                                         GVariant *platform_data);
gpointer            hud_item_construct                  (GType g_type,
                                                         HudStringList *tokens,
                                                         const gchar *desktop_file,
                                                         const gchar *app_icon,
                                                         gboolean enabled);
const gchar *       hud_item_get_app_icon               (HudItem *item);
gboolean            hud_item_get_enabled                (HudItem *item);
const gchar *       hud_item_get_item_icon              (HudItem *item);
HudStringList *     hud_item_get_tokens                 (HudItem *item);
guint               hud_item_get_usage                  (HudItem *item);
HudItem *           hud_item_new                        (HudStringList *tokens,
                                                         const gchar *desktop_file,
                                                         const gchar *app_icon,
                                                         gboolean enabled);

Object Hierarchy

  GObject
   +----HudItem

Description

A HudItem represents a user-interesting action that can be activated from the Hud user interface.

Details

HudItem

typedef struct _HudItem HudItem;

This is an opaque structure type.


struct HudItemClass

struct HudItemClass {
  GObjectClass parent_class;

  void (* activate) (HudItem  *item,
                     GVariant *platform_data);
};

This is the class vtable for HudItem.

GObjectClass parent_class;

the GObjectClass

activate ()

virtual function pointer for hud_item_activate()

hud_item_activate ()

void                hud_item_activate                   (HudItem *item,
                                                         GVariant *platform_data);

Activates item.

platform_data is platform data in the GApplication or GRemoteActionGroup sense. It should be a GVariant with the type a{sv}.

item :

a HudItem

platform_data :

platform data

hud_item_construct ()

gpointer            hud_item_construct                  (GType g_type,
                                                         HudStringList *tokens,
                                                         const gchar *desktop_file,
                                                         const gchar *app_icon,
                                                         gboolean enabled);

This is the Vala-style chain-up constructor corresponding to hud_item_new(). g_type must be a subtype of HudItem.

Only subclasses of HudItem should call this.

g_type :

a GType

tokens :

the search tokens for the item

desktop_file :

the desktop file of the provider of the item

app_icon :

the icon name for the application that created this item

enabled :

if the item is enabled

Returns :

a new HudItem or HudItem subclass

hud_item_get_app_icon ()

const gchar *       hud_item_get_app_icon               (HudItem *item);

Gets the icon of the application that item lies within.

item :

a HudItem

Returns :

the icon name, or "" if there is no icon

hud_item_get_enabled ()

gboolean            hud_item_get_enabled                (HudItem *item);

Checks if the item is disabled or enabled.

Disabled items should never appear in search results.

item :

a HudItem

Returns :

if the item is enabled

hud_item_get_item_icon ()

const gchar *       hud_item_get_item_icon              (HudItem *item);

Gets the icon for the action represented by item, if one exists.

item :

a HudItem

Returns :

the icon name, or "" if there is no icon

hud_item_get_tokens ()

HudStringList *     hud_item_get_tokens                 (HudItem *item);

Gets the tokens that represent the description of item.

This is a HudStringList in reverse order of how the item should appear in the Hud. For example, "File > Open" would be represneted by the list ['Open', 'File'].

item :

a HudItem

Returns :

the tokens. [transfer none]

hud_item_get_usage ()

guint               hud_item_get_usage                  (HudItem *item);

Gets the use-count of item.

This is the number of times the item has been activated in recent history.

item :

a HudItem

Returns :

the usage count

hud_item_new ()

HudItem *           hud_item_new                        (HudStringList *tokens,
                                                         const gchar *desktop_file,
                                                         const gchar *app_icon,
                                                         gboolean enabled);

Creates a new HudItem.

If enabled is FALSE then the item will never be in the result of a search.

tokens :

the search tokens for the item

desktop_file :

the desktop file of the provider of the item

app_icon :

the icon name for the application that created this item

enabled :

if the item is enabled

Returns :

a new HudItem