![]() |
![]() |
![]() |
hud-service Hacking Guide | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
HudQueryHudQuery — a stateful query against a HudSource |
HudQuery; void hud_query_close (HudQuery *query
); guint hud_query_get_n_results (HudQuery *query
); GVariant * hud_query_get_query_key (HudQuery *query
); HudResult * hud_query_get_result_by_index (HudQuery *query
,guint i
); HudQuery * hud_query_lookup (GVariant *query_key
); HudQuery * hud_query_new (HudSource *source
,const gchar *search_string
,gint num_results
);
HudQuery is a stateful query for a particular search string against a given HudSource.
The query monitors its source for the "change" signal and re-submits the query when changes are reported. The query has its own change signal that is fired when this happens.
The query maintains a list of results from the search which are sorted by relevance and accessible by index. Contrast this with the stateless nature of HudSource.
void hud_query_close (HudQuery *query
);
Closes a HudQuery.
This drops the query from the internal list of queries. Future use
of hud_query_lookup()
to find this query will fail.
You must still release your own reference on query
, if you have one.
This only drops the internal reference.
|
a HudQuery |
guint hud_query_get_n_results (HudQuery *query
);
Gets the number of results in query
.
|
a HudQuery |
Returns : |
the number of results |
GVariant * hud_query_get_query_key (HudQuery *query
);
Returns the query key for HudQuery
.
Each HudQuery has a unique identifying key that is assigned when the query is created.
FIXME: This is a lie.
|
a HudQuery |
Returns : |
the query key for query . [transfer none]
|
HudResult * hud_query_get_result_by_index (HudQuery *query
,guint i
);
Gets the i
th result from query
.
i
must be less than the number of results in the query. See
hud_query_get_n_results()
.
HudQuery * hud_query_lookup (GVariant *query_key
);
Finds the query that has the given query_key
.
|
a query key |
Returns : |
the query, or NULL if no such query exists. [transfer none]
|
HudQuery * hud_query_new (HudSource *source
,const gchar *search_string
,gint num_results
);
Creates a HudQuery.
A HudQuery is a stateful search for search_string
against a source
.
Each HudQuery is assigned a "query key" when it is created. This
can be used to lookup the hud query later using hud_query_lookup()
.
Because of this, an internal reference is held on the query and the
query won't be completely freed until you call hud_query_close()
on
it in addition to releasing your ref.