1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2  *
3  * Copyright (C) 2014 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_BUNDLE (as_bundle_get_type ())
19 G_DECLARE_DERIVABLE_TYPE (AsBundle, as_bundle, AS, BUNDLE, GObject)
20 
21 struct _AsBundleClass
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  * AsBundleKind:
37  * @AS_BUNDLE_KIND_UNKNOWN:		Type invalid or not known
38  * @AS_BUNDLE_KIND_LIMBA:		Limba application bundle
39  * @AS_BUNDLE_KIND_FLATPAK:		Flatpak application deployment
40  * @AS_BUNDLE_KIND_SNAP:		Snap application deployment
41  * @AS_BUNDLE_KIND_PACKAGE:		Package-based application deployment
42  * @AS_BUNDLE_KIND_CABINET:		Cabinet firmware deployment
43  * @AS_BUNDLE_KIND_APPIMAGE:		AppImage application bundle
44  *
45  * The bundle type.
46  **/
47 typedef enum {
48 	AS_BUNDLE_KIND_UNKNOWN,			/* Since: 0.3.5 */
49 	AS_BUNDLE_KIND_LIMBA,			/* Since: 0.3.5 */
50 	AS_BUNDLE_KIND_FLATPAK,			/* Since: 0.5.15 */
51 	AS_BUNDLE_KIND_SNAP,			/* Since: 0.6.1 */
52 	AS_BUNDLE_KIND_PACKAGE,			/* Since: 0.6.1 */
53 	AS_BUNDLE_KIND_CABINET,			/* Since: 0.6.2 */
54 	AS_BUNDLE_KIND_APPIMAGE,		/* Since: 0.6.4 */
55 	/*< private >*/
56 	AS_BUNDLE_KIND_LAST
57 } AsBundleKind;
58 
59 /* DEPRECATED */
60 #define AS_BUNDLE_KIND_XDG_APP	AS_BUNDLE_KIND_FLATPAK
61 
62 AsBundle	*as_bundle_new			(void);
63 
64 /* helpers */
65 AsBundleKind	 as_bundle_kind_from_string	(const gchar	*kind);
66 const gchar	*as_bundle_kind_to_string	(AsBundleKind	 kind);
67 
68 /* getters */
69 const gchar	*as_bundle_get_id		(AsBundle	*bundle);
70 const gchar	*as_bundle_get_runtime		(AsBundle	*bundle);
71 const gchar	*as_bundle_get_sdk		(AsBundle	*bundle);
72 AsBundleKind	 as_bundle_get_kind		(AsBundle	*bundle);
73 
74 /* setters */
75 void		 as_bundle_set_id		(AsBundle	*bundle,
76 						 const gchar	*id);
77 void		 as_bundle_set_runtime		(AsBundle	*bundle,
78 						 const gchar	*runtime);
79 void		 as_bundle_set_sdk		(AsBundle	*bundle,
80 						 const gchar	*sdk);
81 void		 as_bundle_set_kind		(AsBundle	*bundle,
82 						 AsBundleKind	 kind);
83 
84 G_END_DECLS
85