Debian Codegraph @

lib/packagekit-glib2/pk-package.h

raw
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2009 Richard Hughes <[email protected]>
4 *
5 * Licensed under the GNU Lesser General Public License Version 2.1
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #if !defined (__PACKAGEKIT_H_INSIDE__) && !defined (PK_COMPILATION)
23 #error "Only <packagekit.h> can be included directly."
24 #endif
25
26 #ifndef __PK_PACKAGE_H
27 #define __PK_PACKAGE_H
28
29 #include <glib-object.h>
30
31 #include <packagekit-glib2/pk-enum.h>
32 #include <packagekit-glib2/pk-source.h>
33
34 G_BEGIN_DECLS
35
36 #define PK_TYPE_PACKAGE (pk_package_get_type ())
37 #define PK_PACKAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_PACKAGE, PkPackage))
38 #define PK_PACKAGE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_PACKAGE, PkPackageClass))
39 #define PK_IS_PACKAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_PACKAGE))
40 #define PK_IS_PACKAGE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_PACKAGE))
41 #define PK_PACKAGE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_PACKAGE, PkPackageClass))
42 #define PK_PACKAGE_TYPE_ERROR (pk_package_error_get_type ())
43
44 typedef struct _PkPackagePrivate PkPackagePrivate;
45 typedef struct _PkPackage PkPackage;
46 typedef struct _PkPackageClass PkPackageClass;
47
48 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
49 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PkPackage, g_object_unref)
50 #endif
51
52 struct _PkPackage
53 {
54 PkSource parent;
55 PkPackagePrivate *priv;
56 };
57
58 struct _PkPackageClass
59 {
60 PkSourceClass parent_class;
61
62 /* signals */
63 void (* changed) (PkPackage *package);
64 /* padding for future expansion */
65 void (*_pk_reserved1) (void);
66 void (*_pk_reserved2) (void);
67 void (*_pk_reserved3) (void);
68 void (*_pk_reserved4) (void);
69 void (*_pk_reserved5) (void);
70 };
71
72 GType pk_package_get_type (void);
73 PkPackage *pk_package_new (void);
74
75 gboolean pk_package_set_id (PkPackage *package,
76 const gchar *package_id,
77 GError **error);
78 gboolean pk_package_parse (PkPackage *package,
79 const gchar *data,
80 GError **error);
81 void pk_package_print (PkPackage *package);
82 gboolean pk_package_equal (PkPackage *package1,
83 PkPackage *package2);
84 gboolean pk_package_equal_id (PkPackage *package1,
85 PkPackage *package2);
86
87 /* accessors */
88 const gchar *pk_package_get_id (PkPackage *package);
89 PkInfoEnum pk_package_get_info (PkPackage *package);
90 void pk_package_set_info (PkPackage *package,
91 PkInfoEnum info);
92 const gchar *pk_package_get_summary (PkPackage *package);
93 void pk_package_set_summary (PkPackage *package,
94 const gchar *summary);
95 const gchar *pk_package_get_name (PkPackage *package);
96 const gchar *pk_package_get_version (PkPackage *package);
97 const gchar *pk_package_get_arch (PkPackage *package);
98 const gchar *pk_package_get_data (PkPackage *package);
99 PkInfoEnum pk_package_get_update_severity (PkPackage *package);
100 void pk_package_set_update_severity (PkPackage *package,
101 PkInfoEnum update_severity);
102 G_END_DECLS
103
104 #endif /* __PK_PACKAGE_H */
105