1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2  *
3  * Copyright (C) 2017 Richard Hughes <richard@hughsie.com>
4  *
5  * SPDX-License-Identifier: LGPL-2.1+
6  */
7 
8 #pragma once
9 
10 #if !defined (__APPSTREAM_GLIB_H_INSIDE__) && !defined (AS_COMPILATION)
11 #error "Only <appstream-glib.h> can be included directly."
12 #endif
13 
14 #include <glib-object.h>
15 
16 G_BEGIN_DECLS
17 
18 #define AS_TYPE_LAUNCHABLE (as_launchable_get_type ())
19 G_DECLARE_DERIVABLE_TYPE (AsLaunchable, as_launchable, AS, LAUNCHABLE, GObject)
20 
21 struct _AsLaunchableClass
22 {
23 	GObjectClass		parent_class;
24 	/*< private >*/
25 	void (*_as_reserved1)	(void);
26 	void (*_as_reserved2)	(void);
27 	void (*_as_reserved3)	(void);
28 	void (*_as_reserved4)	(void);
29 	void (*_as_reserved5)	(void);
30 	void (*_as_reserved6)	(void);
31 	void (*_as_reserved7)	(void);
32 	void (*_as_reserved8)	(void);
33 };
34 
35 /**
36  * AsLaunchableKind:
37  * @AS_LAUNCHABLE_KIND_UNKNOWN:		Type invalid or not known
38  * @AS_LAUNCHABLE_KIND_DESKTOP_ID:	A desktop ID
39  * @AS_LAUNCHABLE_KIND_SERVICE:		A system service
40  * @AS_LAUNCHABLE_KIND_COCKPIT_MANIFEST: A manifest run by the cockpit project
41  * @AS_LAUNCHABLE_KIND_URL:		A web-app
42  *
43  * The launchable type.
44  **/
45 typedef enum {
46 	AS_LAUNCHABLE_KIND_UNKNOWN,
47 	AS_LAUNCHABLE_KIND_DESKTOP_ID,		/* Since: 0.6.13 */
48 	AS_LAUNCHABLE_KIND_SERVICE,		/* Since: 0.7.3 */
49 	AS_LAUNCHABLE_KIND_COCKPIT_MANIFEST,	/* Since: 0.7.3 */
50 	AS_LAUNCHABLE_KIND_URL,			/* Since: 0.7.3 */
51 	/*< private >*/
52 	AS_LAUNCHABLE_KIND_LAST
53 } AsLaunchableKind;
54 
55 AsLaunchable	*as_launchable_new		(void);
56 
57 /* helpers */
58 AsLaunchableKind as_launchable_kind_from_string	(const gchar		*kind);
59 const gchar	*as_launchable_kind_to_string	(AsLaunchableKind	 kind);
60 
61 /* getters */
62 const gchar	*as_launchable_get_value	(AsLaunchable		*launchable);
63 AsLaunchableKind as_launchable_get_kind		(AsLaunchable		*launchable);
64 
65 /* setters */
66 void		 as_launchable_set_value	(AsLaunchable		*launchable,
67 						 const gchar		*value);
68 void		 as_launchable_set_kind		(AsLaunchable		*launchable,
69 						 AsLaunchableKind	 kind);
70 
71 G_END_DECLS
72