Top | ![]() |
![]() |
![]() |
![]() |
enum | GsAppQueryTristate |
enum | GsAppQueryProvidesType |
enum | GsAppQueryLicenseType |
enum | GsAppQueryDeveloperVerifiedType |
#define | GS_TYPE_APP_QUERY |
GsAppQuery |
GsAppQuery is an object to represent a query for apps.
It will typically be used with GsPluginJobListApps, which searches for matching apps, but it may have multiple consumers. GsAppQuery only represents the query and does not provide an implementation for executing that query.
It is immutable after construction, and hence threadsafe. It may be extended in future by adding more query properties. The existing query properties are conjunctive: results should only be returned which match *all* properties which are set, not _any_ properties which are set.
The set of apps returned for the query can be controlled with the
“refine-flags”,
“max-results” and
“dedupe-flags” properties. If refine-flags
is
set, all results must be refined using the given set of refine flags (see
GsPluginJobRefine). max-results
and dedupe-flags
are used to limit the
set of results.
Results must always be processed in this order:
Filtering using “filter-func” (and any other custom filter functions the query executor provides).
Deduplication using “dedupe-flags”.
Sorting using “sort-func”.
Truncating result list length to “max-results”.
GsAppQuery * gs_app_query_new (const gchar *first_property_name
,...
);
Create a new GsAppQuery containing the given query properties.
first_property_name |
name of the first GObject property |
|
... |
value for the first property, followed by additional property/value
pairs, then a terminating |
Since: 43
GsPluginRefineFlags
gs_app_query_get_refine_flags (GsAppQuery *self
);
Get the value of “refine-flags”.
Since: 43
guint
gs_app_query_get_max_results (GsAppQuery *self
);
Get the value of “max-results”.
Since: 43
GsAppListFilterFlags
gs_app_query_get_dedupe_flags (GsAppQuery *self
);
Get the value of “dedupe-flags”.
Since: 43
GsAppListSortFunc gs_app_query_get_sort_func (GsAppQuery *self
,gpointer *user_data_out
);
Get the value of “sort-func”.
self |
||
user_data_out |
return location
for the “sort-user-data”, or |
[out][transfer none][optional][nullable] |
Since: 43
GsAppListFilterFunc gs_app_query_get_filter_func (GsAppQuery *self
,gpointer *user_data_out
);
Get the value of “filter-func”.
self |
||
user_data_out |
return location
for the “filter-user-data”, or |
[out][transfer none][optional][nullable] |
Since: 43
guint
gs_app_query_get_n_properties_set (GsAppQuery *self
);
Get the number of query properties which have been set.
These are the properties which determine the query results, rather than ones which control refining the results (“refine-flags”, “max-results”, “dedupe-flags”, “sort-func” and its user data, “filter-func” and its user data, “license-type”).
Since: 43
const gchar * const *
gs_app_query_get_provides_files (GsAppQuery *self
);
Get the value of “provides-files”.
a list of file paths which the apps must provide,
or NULL
to not filter on file paths.
[nullable]
Since: 43
GDateTime *
gs_app_query_get_released_since (GsAppQuery *self
);
Get the value of “released-since”.
a date/time which apps must have been released since,
or NULL
to not filter on release date.
[nullable]
Since: 43
GsAppQueryTristate
gs_app_query_get_is_curated (GsAppQuery *self
);
Get the value of “is-curated”.
GS_APP_QUERY_TRISTATE_TRUE
if apps must be curated,
GS_APP_QUERY_TRISTATE_FALSE
if they must be not curated, or
GS_APP_QUERY_TRISTATE_UNSET
if it doesn’t matter
Since: 43
GsAppQueryTristate
gs_app_query_get_is_featured (GsAppQuery *self
);
Get the value of “is-featured”.
GS_APP_QUERY_TRISTATE_TRUE
if apps must be featured,
GS_APP_QUERY_TRISTATE_FALSE
if they must be not featured, or
GS_APP_QUERY_TRISTATE_UNSET
if it doesn’t matter
Since: 43
GsCategory *
gs_app_query_get_category (GsAppQuery *self
);
Get the value of “category”.
Since: 43
GsAppQueryTristate
gs_app_query_get_is_installed (GsAppQuery *self
);
Get the value of “is-installed”.
GS_APP_QUERY_TRISTATE_TRUE
if apps must be installed,
GS_APP_QUERY_TRISTATE_FALSE
if they must be not installed, or
GS_APP_QUERY_TRISTATE_UNSET
if it doesn’t matter
Since: 43
const gchar * const *
gs_app_query_get_developers (GsAppQuery *self
);
Get the value of “developers”.
Since: 43
const gchar * const *
gs_app_query_get_keywords (GsAppQuery *self
);
Get the value of “keywords”.
Since: 43
GsApp *
gs_app_query_get_alternate_of (GsAppQuery *self
);
Get the value of “alternate-of”.
Since: 43
GsAppQueryProvidesType gs_app_query_get_provides (GsAppQuery *self
,const gchar **out_provides_tag
);
Get the value of “provides-type” and “provides-tag”.
self |
||
out_provides_tag |
return
location for the value of “provides-tag”, or |
[transfer none][optional][nullable][out] |
Since: 43
GsAppQueryLicenseType
gs_app_query_get_license_type (GsAppQuery *self
);
Get the value of “license-type”.
the type of license the app must be under, or
GS_APP_QUERY_LICENSE_ANY
to not filter by license
Since: 44
GsAppQueryDeveloperVerifiedType
gs_app_query_get_developer_verified_type
(GsAppQuery *self
);
Get the value of “developer-verified-type”.
the type of developer verified state filter, or
GS_APP_QUERY_DEVELOPER_VERIFIED_ANY
to not filter by it
Since: 46
A type for storing a boolean value which can also have an ‘unknown’ or ‘unset’ state.
Within GsAppQuery this is used for boolean query properties which are unset by default so that they don’t affect the query.
Since: 43
A type for identifying the format or meaning of “provides-tag”.
This allows querying for apps which provide various types of functionality, such as printer drivers or fonts.
Format is unknown and value is unset. |
||
A package name in whatever ID format is used natively by the current distro. |
||
A GStreamer plugin name which the app must provide. |
||
A font name which the app must provide. |
||
A MIME type/content type which the app must support. |
||
A printer/PostScript driver which the app must provide. |
||
A Plasma ID which the app must provide. (FIXME: It’s not really clear what this means, but it’s historically been supported.) |
Since: 43
A type for categorising licenses, so that apps can be filtered by the type of license they have.
Since: 44
A type to filter apps by developer verified identity.
Since: 46