Debian Codegraph @

lib/packagekit-glib2/pk-offline.h

raw
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2014 Richard Hughes <[email protected]>
4 *
5 * Licensed under the GNU General Public License Version 2
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program 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
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; 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_OFFLINE_H
27 #define __PK_OFFLINE_H
28
29 #include <glib.h>
30 #include <gio/gio.h>
31
32 #include "pk-package-sack.h"
33 #include "pk-results.h"
34
35 G_BEGIN_DECLS
36
37 #define PK_OFFLINE_ERROR (pk_offline_error_quark ())
38
39 /**
40 * PkOfflineAction:
41 * @PK_OFFLINE_ACTION_UNKNOWN: Unknown
42 * @PK_OFFLINE_ACTION_REBOOT: Reboot
43 * @PK_OFFLINE_ACTION_POWER_OFF: Power-off
44 * @PK_OFFLINE_ACTION_UNSET: No action set
45 *
46 * Actions that can be taken after an offline operation.
47 */
48 typedef enum {
49 PK_OFFLINE_ACTION_UNKNOWN,
50 PK_OFFLINE_ACTION_REBOOT,
51 PK_OFFLINE_ACTION_POWER_OFF,
52 PK_OFFLINE_ACTION_UNSET,
53 /*< private >*/
54 PK_OFFLINE_ACTION_LAST
55 } PkOfflineAction;
56
57 /**
58 * PkOfflineError:
59 * @PK_OFFLINE_ERROR_FAILED: No specific reason
60 * @PK_OFFLINE_ERROR_INVALID_VALUE: An invalid value was specified
61 * @PK_OFFLINE_ERROR_NO_DATA: No data was available
62 *
63 * Errors that can be thrown
64 */
65 typedef enum
66 {
67 PK_OFFLINE_ERROR_FAILED,
68 PK_OFFLINE_ERROR_INVALID_VALUE,
69 PK_OFFLINE_ERROR_NO_DATA,
70 /*< private >*/
71 PK_OFFLINE_ERROR_LAST
72 } PkOfflineError;
73
74 /**
75 * PkOfflineFlags:
76 * @PK_OFFLINE_FLAGS_NONE: No specific flag
77 * @PK_OFFLINE_FLAGS_INTERACTIVE: Run the action in an interactive mode, allowing polkit authentication dialogs
78 *
79 * Flags to be used for the method invocations.
80 *
81 * Since: 1.2.5
82 */
83 typedef enum
84 {
85 PK_OFFLINE_FLAGS_NONE = 0,
86 PK_OFFLINE_FLAGS_INTERACTIVE = 1 << 0
87 } PkOfflineFlags;
88
89 GQuark pk_offline_error_quark (void);
90 const gchar *pk_offline_action_to_string (PkOfflineAction action);
91 PkOfflineAction pk_offline_action_from_string (const gchar *action);
92 PkOfflineAction pk_offline_get_action (GError **error);
93 gchar **pk_offline_get_prepared_ids (GError **error);
94 gchar *pk_offline_get_prepared_upgrade_name
95 (GError **error);
96 gchar *pk_offline_get_prepared_upgrade_version
97 (GError **error);
98 PkPackageSack *pk_offline_get_prepared_sack (GError **error);
99 GFileMonitor *pk_offline_get_prepared_monitor(GCancellable *cancellable,
100 GError **error);
101 GFileMonitor *pk_offline_get_prepared_upgrade_monitor
102 (GCancellable *cancellable,
103 GError **error);
104 GFileMonitor *pk_offline_get_action_monitor (GCancellable *cancellable,
105 GError **error);
106 PkResults *pk_offline_get_results (GError **error);
107 guint64 pk_offline_get_results_mtime (GError **error);
108 gboolean pk_offline_cancel (GCancellable *cancellable,
109 GError **error);
110 gboolean pk_offline_cancel_with_flags (PkOfflineFlags flags,
111 GCancellable *cancellable,
112 GError **error);
113 gboolean pk_offline_clear_results (GCancellable *cancellable,
114 GError **error);
115 gboolean pk_offline_clear_results_with_flags
116 (PkOfflineFlags flags,
117 GCancellable *cancellable,
118 GError **error);
119 gboolean pk_offline_trigger (PkOfflineAction action,
120 GCancellable *cancellable,
121 GError **error);
122 gboolean pk_offline_trigger_with_flags (PkOfflineAction action,
123 PkOfflineFlags flags,
124 GCancellable *cancellable,
125 GError **error);
126 gboolean pk_offline_trigger_upgrade (PkOfflineAction action,
127 GCancellable *cancellable,
128 GError **error);
129 gboolean pk_offline_trigger_upgrade_with_flags
130 (PkOfflineAction action,
131 PkOfflineFlags flags,
132 GCancellable *cancellable,
133 GError **error);
134
135 G_END_DECLS
136
137 #endif /* __PK_OFFLINE_H */