-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessages.g.h
419 lines (337 loc) · 12.6 KB
/
messages.g.h
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
//
// Copyright 2024 Toyota Connected North America
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Autogenerated from Pigeon (v22.6.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#ifndef PIGEON_MESSAGES_G_H_
#define PIGEON_MESSAGES_G_H_
#include <flutter/basic_message_channel.h>
#include <flutter/binary_messenger.h>
#include <flutter/encodable_value.h>
#include <flutter/standard_message_codec.h>
#include <map>
#include <optional>
#include <string>
namespace flatpak_plugin {
// Generated class from Pigeon.
class FlutterError {
public:
explicit FlutterError(const std::string& code)
: code_(code) {}
explicit FlutterError(const std::string& code, const std::string& message)
: code_(code), message_(message) {}
explicit FlutterError(const std::string& code, const std::string& message, const flutter::EncodableValue& details)
: code_(code), message_(message), details_(details) {}
const std::string& code() const { return code_; }
const std::string& message() const { return message_; }
const flutter::EncodableValue& details() const { return details_; }
private:
std::string code_;
std::string message_;
flutter::EncodableValue details_;
};
template<class T> class ErrorOr {
public:
ErrorOr(const T& rhs) : v_(rhs) {}
ErrorOr(const T&& rhs) : v_(std::move(rhs)) {}
ErrorOr(const FlutterError& rhs) : v_(rhs) {}
ErrorOr(const FlutterError&& rhs) : v_(std::move(rhs)) {}
bool has_error() const { return std::holds_alternative<FlutterError>(v_); }
const T& value() const { return std::get<T>(v_); };
const FlutterError& error() const { return std::get<FlutterError>(v_); };
private:
friend class FlatpakApi;
ErrorOr() = default;
T TakeValue() && { return std::get<T>(std::move(v_)); }
std::variant<T, FlutterError> v_;
};
// Generated class from Pigeon that represents data sent in messages.
class Remote {
public:
// Constructs an object setting all fields.
explicit Remote(
const std::string& name,
const std::string& url,
const std::string& collection_id,
const std::string& title,
const std::string& comment,
const std::string& description,
const std::string& homepage,
const std::string& icon,
const std::string& default_branch,
const std::string& main_ref,
const std::string& remote_type,
const std::string& filter,
const std::string& appstream_timestamp,
const std::string& appstream_dir,
bool gpg_verify,
bool no_enumerate,
bool no_deps,
bool disabled,
int64_t prio);
const std::string& name() const;
void set_name(std::string_view value_arg);
const std::string& url() const;
void set_url(std::string_view value_arg);
const std::string& collection_id() const;
void set_collection_id(std::string_view value_arg);
const std::string& title() const;
void set_title(std::string_view value_arg);
const std::string& comment() const;
void set_comment(std::string_view value_arg);
const std::string& description() const;
void set_description(std::string_view value_arg);
const std::string& homepage() const;
void set_homepage(std::string_view value_arg);
const std::string& icon() const;
void set_icon(std::string_view value_arg);
const std::string& default_branch() const;
void set_default_branch(std::string_view value_arg);
const std::string& main_ref() const;
void set_main_ref(std::string_view value_arg);
const std::string& remote_type() const;
void set_remote_type(std::string_view value_arg);
const std::string& filter() const;
void set_filter(std::string_view value_arg);
const std::string& appstream_timestamp() const;
void set_appstream_timestamp(std::string_view value_arg);
const std::string& appstream_dir() const;
void set_appstream_dir(std::string_view value_arg);
bool gpg_verify() const;
void set_gpg_verify(bool value_arg);
bool no_enumerate() const;
void set_no_enumerate(bool value_arg);
bool no_deps() const;
void set_no_deps(bool value_arg);
bool disabled() const;
void set_disabled(bool value_arg);
int64_t prio() const;
void set_prio(int64_t value_arg);
private:
static Remote FromEncodableList(const flutter::EncodableList& list);
flutter::EncodableList ToEncodableList() const;
friend class FlatpakApi;
friend class PigeonInternalCodecSerializer;
std::string name_;
std::string url_;
std::string collection_id_;
std::string title_;
std::string comment_;
std::string description_;
std::string homepage_;
std::string icon_;
std::string default_branch_;
std::string main_ref_;
std::string remote_type_;
std::string filter_;
std::string appstream_timestamp_;
std::string appstream_dir_;
bool gpg_verify_;
bool no_enumerate_;
bool no_deps_;
bool disabled_;
int64_t prio_;
};
// Generated class from Pigeon that represents data sent in messages.
class Application {
public:
// Constructs an object setting all fields.
explicit Application(
const std::string& name,
const std::string& id,
const std::string& summary,
const std::string& version,
const std::string& origin,
const std::string& license,
int64_t installed_size,
const std::string& deploy_dir,
bool is_current,
const std::string& content_rating_type,
const flutter::EncodableMap& content_rating,
const std::string& latest_commit,
const std::string& eol,
const std::string& eol_rebase,
const flutter::EncodableList& subpaths,
const std::string& metadata,
const std::string& appdata);
const std::string& name() const;
void set_name(std::string_view value_arg);
const std::string& id() const;
void set_id(std::string_view value_arg);
const std::string& summary() const;
void set_summary(std::string_view value_arg);
const std::string& version() const;
void set_version(std::string_view value_arg);
const std::string& origin() const;
void set_origin(std::string_view value_arg);
const std::string& license() const;
void set_license(std::string_view value_arg);
int64_t installed_size() const;
void set_installed_size(int64_t value_arg);
const std::string& deploy_dir() const;
void set_deploy_dir(std::string_view value_arg);
bool is_current() const;
void set_is_current(bool value_arg);
const std::string& content_rating_type() const;
void set_content_rating_type(std::string_view value_arg);
const flutter::EncodableMap& content_rating() const;
void set_content_rating(const flutter::EncodableMap& value_arg);
const std::string& latest_commit() const;
void set_latest_commit(std::string_view value_arg);
const std::string& eol() const;
void set_eol(std::string_view value_arg);
const std::string& eol_rebase() const;
void set_eol_rebase(std::string_view value_arg);
const flutter::EncodableList& subpaths() const;
void set_subpaths(const flutter::EncodableList& value_arg);
const std::string& metadata() const;
void set_metadata(std::string_view value_arg);
const std::string& appdata() const;
void set_appdata(std::string_view value_arg);
private:
static Application FromEncodableList(const flutter::EncodableList& list);
flutter::EncodableList ToEncodableList() const;
friend class FlatpakApi;
friend class PigeonInternalCodecSerializer;
std::string name_;
std::string id_;
std::string summary_;
std::string version_;
std::string origin_;
std::string license_;
int64_t installed_size_;
std::string deploy_dir_;
bool is_current_;
std::string content_rating_type_;
flutter::EncodableMap content_rating_;
std::string latest_commit_;
std::string eol_;
std::string eol_rebase_;
flutter::EncodableList subpaths_;
std::string metadata_;
std::string appdata_;
};
// Generated class from Pigeon that represents data sent in messages.
class Installation {
public:
// Constructs an object setting all fields.
explicit Installation(
const std::string& id,
const std::string& display_name,
const std::string& path,
bool no_interaction,
bool is_user,
int64_t priority,
const flutter::EncodableList& default_lanaguages,
const flutter::EncodableList& default_locale,
const flutter::EncodableList& remotes);
const std::string& id() const;
void set_id(std::string_view value_arg);
const std::string& display_name() const;
void set_display_name(std::string_view value_arg);
const std::string& path() const;
void set_path(std::string_view value_arg);
bool no_interaction() const;
void set_no_interaction(bool value_arg);
bool is_user() const;
void set_is_user(bool value_arg);
int64_t priority() const;
void set_priority(int64_t value_arg);
const flutter::EncodableList& default_lanaguages() const;
void set_default_lanaguages(const flutter::EncodableList& value_arg);
const flutter::EncodableList& default_locale() const;
void set_default_locale(const flutter::EncodableList& value_arg);
const flutter::EncodableList& remotes() const;
void set_remotes(const flutter::EncodableList& value_arg);
private:
static Installation FromEncodableList(const flutter::EncodableList& list);
flutter::EncodableList ToEncodableList() const;
friend class FlatpakApi;
friend class PigeonInternalCodecSerializer;
std::string id_;
std::string display_name_;
std::string path_;
bool no_interaction_;
bool is_user_;
int64_t priority_;
flutter::EncodableList default_lanaguages_;
flutter::EncodableList default_locale_;
flutter::EncodableList remotes_;
};
class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer {
public:
PigeonInternalCodecSerializer();
inline static PigeonInternalCodecSerializer& GetInstance() {
static PigeonInternalCodecSerializer sInstance;
return sInstance;
}
void WriteValue(
const flutter::EncodableValue& value,
flutter::ByteStreamWriter* stream) const override;
protected:
flutter::EncodableValue ReadValueOfType(
uint8_t type,
flutter::ByteStreamReader* stream) const override;
};
// Generated interface from Pigeon that represents a handler of messages from Flutter.
class FlatpakApi {
public:
FlatpakApi(const FlatpakApi&) = delete;
FlatpakApi& operator=(const FlatpakApi&) = delete;
virtual ~FlatpakApi() {}
// Get Flatpak version.
virtual ErrorOr<std::string> GetVersion() = 0;
// Get the default flatpak arch
virtual ErrorOr<std::string> GetDefaultArch() = 0;
// Get all arches supported by flatpak
virtual ErrorOr<flutter::EncodableList> GetSupportedArches() = 0;
// Returns a list of Flatpak system installations.
virtual ErrorOr<flutter::EncodableList> GetSystemInstallations() = 0;
// Returns user flatpak installation.
virtual ErrorOr<Installation> GetUserInstallation() = 0;
// Add a remote repository.
virtual ErrorOr<bool> RemoteAdd(const Remote& configuration) = 0;
// Remove Remote configuration.
virtual ErrorOr<bool> RemoteRemove(const std::string& id) = 0;
// Get a list of applications installed on machine.
virtual ErrorOr<flutter::EncodableList> GetApplicationsInstalled() = 0;
// Get list of applications hosted on a remote.
virtual ErrorOr<flutter::EncodableList> GetApplicationsRemote(const std::string& id) = 0;
// Install application of given id.
virtual ErrorOr<bool> ApplicationInstall(const std::string& id) = 0;
// Uninstall application with specified id.
virtual ErrorOr<bool> ApplicationUninstall(const std::string& id) = 0;
// Start application using specified configuration.
virtual ErrorOr<bool> ApplicationStart(
const std::string& id,
const flutter::EncodableMap* configuration) = 0;
// Stop application with given id.
virtual ErrorOr<bool> ApplicationStop(const std::string& id) = 0;
// The codec used by FlatpakApi.
static const flutter::StandardMessageCodec& GetCodec();
// Sets up an instance of `FlatpakApi` to handle messages through the `binary_messenger`.
static void SetUp(
flutter::BinaryMessenger* binary_messenger,
FlatpakApi* api);
static void SetUp(
flutter::BinaryMessenger* binary_messenger,
FlatpakApi* api,
const std::string& message_channel_suffix);
static flutter::EncodableValue WrapError(std::string_view error_message);
static flutter::EncodableValue WrapError(const FlutterError& error);
protected:
FlatpakApi() = default;
};
} // namespace flatpak_plugin
#endif // PIGEON_MESSAGES_G_H_