GCC Code Coverage Report


Directory: ./
File: panels/privacy/bolt/bolt-client.h
Date: 2024-05-04 07:58:27
Exec Total Coverage
Lines: 0 1 0.0%
Functions: 0 2 0.0%
Branches: 0 6 0.0%

Line Branch Exec Source
1 /*
2 * Copyright © 2017 Red Hat, Inc
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but 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 library. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authors:
18 * Christian J. Kellner <christian@kellner.me>
19 */
20
21 #pragma once
22
23 #include "bolt-enums.h"
24 #include "bolt-device.h"
25 #include "bolt-proxy.h"
26
27 G_BEGIN_DECLS
28
29 #define BOLT_TYPE_CLIENT bolt_client_get_type ()
30 G_DECLARE_FINAL_TYPE (BoltClient, bolt_client, BOLT, CLIENT, BoltProxy);
31
32 BoltClient * bolt_client_new (GError **error);
33
34 void bolt_client_new_async (GCancellable *cancellable,
35 GAsyncReadyCallback callback,
36 gpointer user_data);
37 BoltClient * bolt_client_new_finish (GAsyncResult *res,
38 GError **error);
39
40 GPtrArray * bolt_client_list_devices (BoltClient *client,
41 GCancellable *cancellable,
42 GError **error);
43
44 BoltDevice * bolt_client_get_device (BoltClient *client,
45 const char *uid,
46 GCancellable *cancellable,
47 GError **error);
48
49 BoltDevice * bolt_client_enroll_device (BoltClient *client,
50 const char *uid,
51 BoltPolicy policy,
52 BoltAuthCtrl flags,
53 GError **error);
54
55 void bolt_client_enroll_device_async (BoltClient *client,
56 const char *uid,
57 BoltPolicy policy,
58 BoltAuthCtrl flags,
59 GCancellable *cancellable,
60 GAsyncReadyCallback callback,
61 gpointer user_data);
62
63 gboolean bolt_client_enroll_device_finish (BoltClient *client,
64 GAsyncResult *res,
65 char **path,
66 GError **error);
67
68 void bolt_client_enroll_all_async (BoltClient *client,
69 GPtrArray *uuids,
70 BoltPolicy policy,
71 BoltAuthCtrl flags,
72 GCancellable *cancellable,
73 GAsyncReadyCallback callback,
74 gpointer user_data);
75
76 gboolean bolt_client_enroll_all_finish (BoltClient *client,
77 GAsyncResult *res,
78 GError **error);
79
80 void bolt_client_authorize_all_async (BoltClient *client,
81 GPtrArray *uuids,
82 BoltAuthCtrl flags,
83 GCancellable *cancellable,
84 GAsyncReadyCallback callback,
85 gpointer user_data);
86
87 gboolean bolt_client_authorize_all_finish (BoltClient *client,
88 GAsyncResult *res,
89 GError **error);
90
91 void bolt_client_connect_all_async (BoltClient *client,
92 GPtrArray *devices,
93 BoltPolicy policy,
94 BoltAuthCtrl flags,
95 GCancellable *cancellable,
96 GAsyncReadyCallback callback,
97 gpointer user_data);
98
99 gboolean bolt_client_connect_all_finish (BoltClient *client,
100 GAsyncResult *res,
101 GError **error);
102
103
104 gboolean bolt_client_forget_device (BoltClient *client,
105 const char *uid,
106 GError **error);
107
108 void bolt_client_forget_device_async (BoltClient *client,
109 const char *uid,
110 GCancellable *cancellable,
111 GAsyncReadyCallback callback,
112 gpointer user_data);
113
114 gboolean bolt_client_forget_device_finish (BoltClient *client,
115 GAsyncResult *res,
116 GError **error);
117
118 /* getter */
119 guint bolt_client_get_version (BoltClient *client);
120
121 gboolean bolt_client_is_probing (BoltClient *client);
122
123 BoltSecurity bolt_client_get_security (BoltClient *client);
124
125 BoltAuthMode bolt_client_get_authmode (BoltClient *client);
126
127 /* setter */
128
129 void bolt_client_set_authmode_async (BoltClient *client,
130 BoltAuthMode mode,
131 GCancellable *cancellable,
132 GAsyncReadyCallback callback,
133 gpointer user_data);
134
135 gboolean bolt_client_set_authmode_finish (BoltClient *client,
136 GAsyncResult *res,
137 GError **error);
138
139 /* utility functions */
140 void bolt_devices_sort_by_syspath (GPtrArray *devices,
141 gboolean reverse);
142
143 G_END_DECLS
144