Debian Codegraph @

lib/packagekit-glib2/pk-results.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_RESULTS_H
27 #define __PK_RESULTS_H
28
29 #include <glib-object.h>
30 #include <packagekit-glib2/pk-bitfield.h>
31 #include <packagekit-glib2/pk-category.h>
32 #include <packagekit-glib2/pk-details.h>
33 #include <packagekit-glib2/pk-distro-upgrade.h>
34 #include <packagekit-glib2/pk-enum.h>
35 #include <packagekit-glib2/pk-error.h>
36 #include <packagekit-glib2/pk-eula-required.h>
37 #include <packagekit-glib2/pk-files.h>
38 #include <packagekit-glib2/pk-media-change-required.h>
39 #include <packagekit-glib2/pk-package-sack.h>
40 #include <packagekit-glib2/pk-repo-detail.h>
41 #include <packagekit-glib2/pk-repo-signature-required.h>
42 #include <packagekit-glib2/pk-require-restart.h>
43 #include <packagekit-glib2/pk-transaction-past.h>
44 #include <packagekit-glib2/pk-update-detail.h>
45
46 G_BEGIN_DECLS
47
48 #define PK_TYPE_RESULTS (pk_results_get_type ())
49 #define PK_RESULTS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_RESULTS, PkResults))
50 #define PK_RESULTS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_RESULTS, PkResultsClass))
51 #define PK_IS_RESULTS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_RESULTS))
52 #define PK_IS_RESULTS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_RESULTS))
53 #define PK_RESULTS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_RESULTS, PkResultsClass))
54 #define PK_RESULTS_TYPE_ERROR (pk_results_error_get_type ())
55
56 typedef struct _PkResultsPrivate PkResultsPrivate;
57 typedef struct _PkResults PkResults;
58 typedef struct _PkResultsClass PkResultsClass;
59
60 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
61 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PkResults, g_object_unref)
62 #endif
63
64 struct _PkResults
65 {
66 GObject parent;
67 PkResultsPrivate *priv;
68 };
69
70 struct _PkResultsClass
71 {
72 GObjectClass parent_class;
73 /* padding for future expansion */
74 void (*_pk_reserved1) (void);
75 void (*_pk_reserved2) (void);
76 void (*_pk_reserved3) (void);
77 void (*_pk_reserved4) (void);
78 void (*_pk_reserved5) (void);
79 };
80
81 GType pk_results_get_type (void);
82 PkResults *pk_results_new (void);
83
84 /* set */
85 gboolean pk_results_set_exit_code (PkResults *results,
86 PkExitEnum exit_enum);
87 gboolean pk_results_set_role (PkResults *results,
88 PkRoleEnum role);
89 gboolean pk_results_set_error_code (PkResults *results,
90 PkError *item);
91
92 /* add */
93 gboolean pk_results_add_package (PkResults *results,
94 PkPackage *item);
95 gboolean pk_results_add_details (PkResults *results,
96 PkDetails *item);
97 gboolean pk_results_add_update_detail (PkResults *results,
98 PkUpdateDetail *item);
99 gboolean pk_results_add_category (PkResults *results,
100 PkCategory *item);
101 gboolean pk_results_add_distro_upgrade (PkResults *results,
102 PkDistroUpgrade *item);
103 gboolean pk_results_add_require_restart (PkResults *results,
104 PkRequireRestart *item);
105 gboolean pk_results_add_transaction (PkResults *results,
106 PkTransactionPast *item);
107 gboolean pk_results_add_files (PkResults *results,
108 PkFiles *item);
109 gboolean pk_results_add_repo_signature_required (PkResults *results,
110 PkRepoSignatureRequired *item);
111 gboolean pk_results_add_eula_required (PkResults *results,
112 PkEulaRequired *item);
113 gboolean pk_results_add_media_change_required (PkResults *results,
114 PkMediaChangeRequired *item);
115 gboolean pk_results_add_repo_detail (PkResults *results,
116 PkRepoDetail *item);
117
118 /* get single data */
119 PkExitEnum pk_results_get_exit_code (PkResults *results);
120 PkPackageSack *pk_results_get_package_sack (PkResults *results);
121 PkError *pk_results_get_error_code (PkResults *results);
122 PkRoleEnum pk_results_get_role (PkResults *results);
123 PkBitfield pk_results_get_transaction_flags (PkResults *results);
124 PkRestartEnum pk_results_get_require_restart_worst (PkResults *results);
125
126 /* get array objects */
127 GPtrArray *pk_results_get_package_array (PkResults *results);
128 GPtrArray *pk_results_get_details_array (PkResults *results);
129 GPtrArray *pk_results_get_update_detail_array (PkResults *results);
130 GPtrArray *pk_results_get_category_array (PkResults *results);
131 GPtrArray *pk_results_get_distro_upgrade_array (PkResults *results);
132 GPtrArray *pk_results_get_require_restart_array (PkResults *results);
133 GPtrArray *pk_results_get_transaction_array (PkResults *results);
134 GPtrArray *pk_results_get_files_array (PkResults *results);
135 GPtrArray *pk_results_get_repo_signature_required_array (PkResults *results);
136 GPtrArray *pk_results_get_eula_required_array (PkResults *results);
137 GPtrArray *pk_results_get_media_change_required_array (PkResults *results);
138 GPtrArray *pk_results_get_repo_detail_array (PkResults *results);
139
140 G_END_DECLS
141
142 #endif /* __PK_RESULTS_H */
143