File: mock-snapd.h

package info (click to toggle)
snapd-glib 1.45-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 6,184 kB
  • sloc: ansic: 22,492; cpp: 14,089; sh: 4,667; makefile: 300; xml: 220
file content (400 lines) | stat: -rw-r--r-- 18,643 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
/*
 * Copyright (C) 2017 Canonical Ltd.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2 or version 3 of the License.
 * See http://www.gnu.org/copyleft/lgpl.html the full text of the license.
 */

#ifndef __MOCK_SNAPD_H__
#define __MOCK_SNAPD_H__

#include <glib-object.h>
#include <gio/gio.h>

G_BEGIN_DECLS

#define MOCK_TYPE_SNAPD  (mock_snapd_get_type ())

G_DECLARE_FINAL_TYPE (MockSnapd, mock_snapd, MOCK, SNAPD, GObject)

struct _MockSnapdClass
{
    /*< private >*/
    GObjectClass parent_class;
};

typedef struct _MockAccount MockAccount;
typedef struct _MockAlias MockAlias;
typedef struct _MockApp MockApp;
typedef struct _MockChange MockChange;
typedef struct _MockChannel MockChannel;
typedef struct _MockMedia MockMedia;
typedef struct _MockPlug MockPlug;
typedef struct _MockPrice MockPrice;
typedef struct _MockSlot MockSlot;
typedef struct _MockSnap MockSnap;
typedef struct _MockTask MockTask;
typedef struct _MockTrack MockTrack;

MockSnapd      *mock_snapd_new                    (void);

const gchar    *mock_snapd_get_socket_path        (MockSnapd     *snapd);

void            mock_snapd_set_close_on_request   (MockSnapd     *snapd,
                                                   gboolean       close_on_request);

void            mock_snapd_set_decline_auth       (MockSnapd     *snapd,
                                                   gboolean       decline_auth);

gboolean        mock_snapd_start                  (MockSnapd     *snapd,
                                                   GError       **error);

void            mock_snapd_stop                   (MockSnapd     *snapd);

void            mock_snapd_set_maintenance        (MockSnapd     *snapd,
                                                   const gchar   *type,
                                                   const gchar   *message);

void            mock_snapd_set_build_id           (MockSnapd     *snapd,
                                                   const gchar   *build_id);

void            mock_snapd_set_confinement        (MockSnapd     *snapd,
                                                   const gchar   *confinement);

void            mock_snapd_add_sandbox_feature    (MockSnapd     *snapd,
                                                   const gchar   *backend,
                                                   const gchar   *feature);

void            mock_snapd_set_store              (MockSnapd     *snapd,
                                                   const gchar   *name);

void            mock_snapd_set_managed            (MockSnapd     *snapd,
                                                   gboolean       managed);

void            mock_snapd_set_on_classic         (MockSnapd     *snapd,
                                                   gboolean       on_classic);

void            mock_snapd_set_refresh_hold       (MockSnapd     *snapd,
                                                   const gchar   *refresh_hold);

void            mock_snapd_set_refresh_last       (MockSnapd     *snapd,
                                                   const gchar   *refresh_last);

void            mock_snapd_set_refresh_next       (MockSnapd     *snapd,
                                                   const gchar   *refresh_next);

void            mock_snapd_set_refresh_schedule   (MockSnapd     *snapd,
                                                   const gchar   *schedule);

void            mock_snapd_set_refresh_timer      (MockSnapd     *snapd,
                                                   const gchar   *timer);

void            mock_snapd_set_suggested_currency (MockSnapd     *snapd,
                                                   const gchar   *currency);

void            mock_snapd_set_progress_total     (MockSnapd     *snapd,
                                                   int            total);

void            mock_snapd_set_spawn_time         (MockSnapd     *snapd,
                                                   const gchar   *spawn_time);

void            mock_snapd_set_ready_time         (MockSnapd     *snapd,
                                                   const gchar   *ready_time);

MockAccount    *mock_snapd_add_account            (MockSnapd     *snapd,
                                                   const gchar   *email,
                                                   const gchar   *username,
                                                   const gchar   *password);

void            mock_account_set_terms_accepted   (MockAccount   *account,
                                                   gboolean       terms_accepted);

void            mock_account_set_has_payment_methods (MockAccount   *account,
                                                      gboolean       has_payment_methods);

const gchar    *mock_account_get_macaroon         (MockAccount   *account);

GStrv           mock_account_get_discharges       (MockAccount   *account);

gboolean        mock_account_get_sudoer           (MockAccount   *account);

gboolean        mock_account_get_known            (MockAccount   *account);

void            mock_account_set_otp              (MockAccount   *account,
                                                   const gchar   *otp);

void            mock_account_set_ssh_keys         (MockAccount   *account,
                                                   GStrv          ssh_keys);

MockAccount    *mock_snapd_find_account_by_username (MockSnapd     *snapd,
                                                     const gchar   *username);

MockAccount    *mock_snapd_find_account_by_email  (MockSnapd     *snapd,
                                                   const gchar   *email);

MockChange     *mock_snapd_add_change             (MockSnapd     *snapd);

MockTask       *mock_change_add_task              (MockChange    *change,
                                                   const gchar   *kind);

void            mock_task_set_snap_name           (MockTask      *task,
                                                   const gchar   *snap_name);

void            mock_task_set_status              (MockTask      *task,
                                                   const gchar   *status);

void            mock_task_set_progress            (MockTask      *task,
                                                   int            done,
                                                   int            total);

void            mock_task_set_spawn_time          (MockTask      *task,
                                                   const gchar   *spawn_time);

void            mock_task_set_ready_time          (MockTask      *task,
                                                   const gchar   *ready_time);

void            mock_change_set_spawn_time        (MockChange    *change,
                                                   const gchar   *spawn_time);

void            mock_change_set_ready_time        (MockChange    *change,
                                                   const gchar   *ready_time);

MockSnap       *mock_account_add_private_snap     (MockAccount   *account,
                                                   const gchar   *name);

MockSnap       *mock_snapd_add_snap               (MockSnapd     *snapd,
                                                   const gchar   *name);

MockSnap       *mock_snapd_find_snap              (MockSnapd     *snapd,
                                                   const gchar   *name);

void            mock_snapd_add_store_section      (MockSnapd     *snapd,
                                                   const gchar   *name);

MockSnap       *mock_snapd_add_store_snap         (MockSnapd     *snapd,
                                                   const gchar   *name);

MockApp        *mock_snap_add_app                 (MockSnap      *snap,
                                                   const gchar   *name);

MockApp        *mock_snap_find_app                (MockSnap      *snap,
                                                   const gchar   *name);

void            mock_app_set_active               (MockApp       *app,
                                                   gboolean       active);

void            mock_app_set_enabled              (MockApp       *app,
                                                   gboolean       enabled);

void            mock_app_set_common_id            (MockApp       *app,
                                                   const gchar   *id);

void            mock_app_set_daemon               (MockApp       *app,
                                                   const gchar   *daemon);

void            mock_app_set_desktop_file         (MockApp       *app,
                                                   const gchar   *desktop_file);

void            mock_app_add_auto_alias           (MockApp       *app,
                                                   const gchar   *alias);

void            mock_app_add_manual_alias         (MockApp       *app,
                                                   const gchar   *alias,
                                                   gboolean       enabled);

MockAlias      *mock_app_find_alias               (MockApp       *app,
                                                   const gchar   *name);

void            mock_snap_set_base                (MockSnap      *snap,
                                                   const gchar   *base);

void            mock_snap_set_broken              (MockSnap      *snap,
                                                   const gchar   *broken);

void            mock_snap_set_channel             (MockSnap      *snap,
                                                   const gchar   *channel);

const gchar    *mock_snap_get_channel             (MockSnap      *snap);

void            mock_snap_add_common_id           (MockSnap      *snap,
                                                   const gchar   *id);

MockTrack      *mock_snap_add_track               (MockSnap      *snap,
                                                   const gchar   *name);

MockChannel    *mock_track_add_channel            (MockTrack     *track,
                                                   const gchar   *risk,
                                                   const gchar   *branch);

void            mock_channel_set_confinement      (MockChannel  *channel,
                                                   const gchar   *confinement);

void            mock_channel_set_branch           (MockChannel  *channel,
                                                   const gchar   *branch);

void            mock_channel_set_epoch            (MockChannel  *channel,
                                                   const gchar   *epoch);

void            mock_channel_set_revision         (MockChannel  *channel,
                                                   const gchar   *revision);

void            mock_channel_set_size             (MockChannel  *channel,
                                                   int           size);

void            mock_channel_set_version          (MockChannel  *channel,
                                                   const gchar   *version);

void            mock_snap_set_confinement         (MockSnap      *snap,
                                                   const gchar   *confinement);

const gchar    *mock_snap_get_confinement         (MockSnap      *snap);

void            mock_snap_set_contact             (MockSnap      *snap,
                                                   const gchar   *contact);

gboolean        mock_snap_get_dangerous           (MockSnap      *snap);

const gchar    *mock_snap_get_data                (MockSnap      *snap);

void            mock_snap_set_description         (MockSnap      *snap,
                                                   const gchar   *description);

void            mock_snap_set_devmode             (MockSnap      *snap,
                                                   gboolean       devmode);

gboolean        mock_snap_get_devmode             (MockSnap      *snap);

void            mock_snap_set_disabled            (MockSnap      *snap,
                                                   gboolean       disabled);

gboolean        mock_snap_get_disabled            (MockSnap      *snap);

void            mock_snap_set_download_size       (MockSnap      *snap,
                                                   int           download_size);

void            mock_snap_set_error               (MockSnap      *snap,
                                                   const gchar   *error);

void            mock_snap_set_icon                (MockSnap      *snap,
                                                   const gchar   *icon);

void            mock_snap_set_icon_data           (MockSnap      *snap,
                                                   const gchar   *mime_type,
                                                   GBytes        *data);

void            mock_snap_set_id                  (MockSnap      *snap,
                                                   const gchar   *id);

void            mock_snap_set_install_date        (MockSnap      *snap,
                                                   const gchar   *install_date);

void            mock_snap_set_installed_size      (MockSnap      *snap,
                                                   int           installed_size);

void            mock_snap_set_jailmode            (MockSnap      *snap,
                                                   gboolean       jailmode);

gboolean        mock_snap_get_jailmode            (MockSnap      *snap);

void            mock_snap_set_license             (MockSnap      *snap,
                                                   const gchar   *license);

void            mock_snap_set_mounted_from        (MockSnap      *snap,
                                                   const gchar   *mounted_from);

const gchar    *mock_snap_get_path                (MockSnap      *snap);

gboolean        mock_snap_get_preferred           (MockSnap      *snap);

MockPrice      *mock_snap_add_price               (MockSnap      *snap,
                                                   gdouble        amount,
                                                   const gchar   *currency);

void            mock_snap_set_publisher_display_name (MockSnap *snap,
                                                      const gchar *display_name);

void            mock_snap_set_publisher_id        (MockSnap *snap,
                                                   const gchar *id);

void            mock_snap_set_publisher_username  (MockSnap *snap,
                                                   const gchar *username);

void            mock_snap_set_publisher_validation (MockSnap *snap,
                                                    const gchar *validation);

void            mock_snap_set_restart_required    (MockSnap      *snap,
                                                   gboolean       restart_required);

void            mock_snap_set_revision            (MockSnap      *snap,
                                                   const gchar   *revision);

const gchar    *mock_snap_get_revision            (MockSnap      *snap);

void            mock_snap_set_scope_is_wide       (MockSnap      *snap,
                                                   gboolean       scope_is_wide);

MockMedia      *mock_snap_add_media               (MockSnap      *snap,
                                                   const gchar   *type,
                                                   const gchar   *url,
                                                   int            width,
                                                   int            height);

void            mock_snap_set_status              (MockSnap      *snap,
                                                   const gchar   *status);

void            mock_snap_set_summary             (MockSnap      *snap,
                                                   const gchar   *summary);

void            mock_snap_set_title               (MockSnap      *snap,
                                                   const gchar   *title);

void            mock_snap_set_tracking_channel    (MockSnap      *snap,
                                                   const gchar   *channel);

const gchar    *mock_snap_get_tracking_channel    (MockSnap      *snap);

void            mock_snap_set_trymode             (MockSnap      *snap,
                                                   gboolean       trymode);

void            mock_snap_set_type                (MockSnap      *snap,
                                                   const gchar   *type);

void            mock_snap_set_version             (MockSnap      *snap,
                                                   const gchar   *version);

void            mock_snap_add_store_section       (MockSnap      *snap,
                                                   const gchar   *section);

MockPlug       *mock_snap_add_plug                (MockSnap      *snap,
                                                   const gchar   *name);

MockPlug       *mock_snap_find_plug               (MockSnap      *snap,
                                                   const gchar   *name);

MockSlot       *mock_snap_add_slot                (MockSnap      *snap,
                                                   const gchar   *name);

MockSlot       *mock_snap_find_slot               (MockSnap      *snap,
                                                   const gchar   *name);

void            mock_plug_set_connection          (MockPlug      *plug,
                                                   MockSlot      *slot);

MockSlot       *mock_plug_get_connection          (MockPlug      *plug);

void            mock_snapd_add_assertion          (MockSnapd     *snapd,
                                                   const gchar   *assertion);

GList          *mock_snapd_get_assertions         (MockSnapd     *snapd);

const gchar    *mock_snapd_get_last_user_agent    (MockSnapd     *snapd);

const gchar    *mock_snapd_get_last_accept_language (MockSnapd     *snapd);

const gchar    *mock_snapd_get_last_allow_interaction (MockSnapd *snapd);

G_END_DECLS

#endif /* __MOCK_SNAPD_H__ */