1 /*
2  * Copyright (C) 2018, Matthias Clasen
3  *
4  * This file is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation, version 3.0 of the
7  * License.
8  *
9  * This file is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  * SPDX-License-Identifier: LGPL-3.0-only
18  */
19 
20 #pragma once
21 
22 #include <libportal/types.h>
23 
24 G_BEGIN_DECLS
25 
26 /**
27  * XdpUpdateStatus:
28  * @XDP_UPDATE_STATUS_RUNNING: Installation in progress
29  * @XDP_UPDATE_STATUS_EMPTY: Nothing to install
30  * @XDP_UPDATE_STATUS_DONE: Installation finished successfully
31  * @XDP_UPDATE_STATUS_FAILED: Installation failed
32  *
33  * The values of this enum are returned in the
34  * [signal@Portal::update-progress] signal to indicate
35  * the current progress of an installation.
36  */
37 typedef enum {
38   XDP_UPDATE_STATUS_RUNNING,
39   XDP_UPDATE_STATUS_EMPTY,
40   XDP_UPDATE_STATUS_DONE,
41   XDP_UPDATE_STATUS_FAILED
42 } XdpUpdateStatus;
43 
44 typedef enum
45 {
46   XDP_UPDATE_MONITOR_FLAG_NONE = 0,
47 } XdpUpdateMonitorFlags;
48 
49 XDP_PUBLIC
50 void       xdp_portal_update_monitor_start        (XdpPortal              *portal,
51                                                    XdpUpdateMonitorFlags   flags,
52                                                    GCancellable           *cancellable,
53                                                    GAsyncReadyCallback     callback,
54                                                    gpointer                data);
55 
56 XDP_PUBLIC
57 gboolean   xdp_portal_update_monitor_start_finish (XdpPortal              *portal,
58                                                    GAsyncResult           *result,
59                                                    GError                **error);
60 
61 XDP_PUBLIC
62 void       xdp_portal_update_monitor_stop         (XdpPortal              *portal);
63 
64 typedef enum
65 {
66   XDP_UPDATE_INSTALL_FLAG_NONE = 0,
67 } XdpUpdateInstallFlags;
68 
69 XDP_PUBLIC
70 void       xdp_portal_update_install              (XdpPortal              *portal,
71                                                    XdpParent              *parent,
72                                                    XdpUpdateInstallFlags   flags,
73                                                    GCancellable           *cancellable,
74                                                    GAsyncReadyCallback     callback,
75                                                    gpointer                data);
76 
77 XDP_PUBLIC
78 gboolean   xdp_portal_update_install_finish       (XdpPortal              *portal,
79                                                    GAsyncResult           *result,
80                                                    GError                **error);
81 
82 G_END_DECLS
83