This file is indexed.

/usr/include/libubuntu-app-launch-2/ubuntu-app-launch.h is in libubuntu-app-launch2-dev 0.5+15.10.20150817-0ubuntu3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
/*
 * Copyright 2013 Canonical Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 3, as published
 * by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *     Ted Gould <ted.gould@canonical.com>
 */

#include <glib.h>
#include <mir_toolkit/mir_prompt_session.h>

#ifndef __UBUNTU_APP_LAUNCH_H__
#define __UBUNTU_APP_LAUNCH_H__ 1

#pragma GCC visibility push(default)

#ifdef __cplusplus
extern "C" {
#endif

/**
 * UbuntuAppLaunchAppFailed:
 *
 * Types of failure that we report.
 */
typedef enum { /*< prefix=UBUNTU_APP_LAUNCH_APP_FAILED */
	UBUNTU_APP_LAUNCH_APP_FAILED_CRASH,          /*< nick=crash */
	UBUNTU_APP_LAUNCH_APP_FAILED_START_FAILURE,  /*< nick=start-failure */
} UbuntuAppLaunchAppFailed;

/**
 * UbuntuAppLaunchAppObserver:
 *
 * Function prototype for application observers.
 */
typedef void (*UbuntuAppLaunchAppObserver) (const gchar * appid, gpointer user_data);

/**
 * UbuntuAppLaunchAppFailedObserver:
 *
 * Function prototype for application failed observers.
 */
typedef void (*UbuntuAppLaunchAppFailedObserver) (const gchar * appid, UbuntuAppLaunchAppFailed failure_type, gpointer user_data);

/**
 * UbuntuAppLaunchAppPausedResumedObserver:
 * @appid: App ID of the application being paused
 * @pids: Zero terminated array of PIDs
 *
 * Function prototype for application paused and resumed observers.
 */
typedef void (*UbuntuAppLaunchAppPausedResumedObserver) (const gchar * appid, GPid * pids, gpointer user_data);

/**
 * UbuntuAppLaunchHelperObserver:
 *
 * Function to watch for helpers that are starting and stopping
 */
typedef void (*UbuntuAppLaunchHelperObserver) (const gchar * appid, const gchar * instanceid, const gchar * helpertype, gpointer user_data);

/**
 * ubuntu_app_launch_start_application:
 * @appid: ID of the application to launch
 * @uris: (allow-none) (array zero-terminated=1) (element-type utf8) (transfer none): A NULL terminated list of URIs to send to the application
 *
 * Asks upstart to launch an application.
 *
 * Return value: Whether the launch succeeded (may fail later, but upstart
 *    will report the error in that case.
 */
gboolean   ubuntu_app_launch_start_application         (const gchar *                     appid,
                                                         const gchar * const *             uris);

/**
 * ubuntu_app_launch_start_application_test:
 * @appid: ID of the application to launch
 * @uris: (allow-none) (array zero-terminated=1) (element-type utf8) (transfer none): A NULL terminated list of URIs to send to the application
 *
 * Asks upstart to launch an application with environment variables set
 * to enable testing.  Should only be used in testing.
 *
 * Return value: Whether the launch succeeded (may fail later, but upstart
 *    will report the error in that case.
 */
gboolean   ubuntu_app_launch_start_application_test    (const gchar *                     appid,
                                                         const gchar * const *             uris);

/**
 * ubuntu_app_launch_stop_application:
 * @appid: ID of the application to launch
 *
 * Asks upstart to stop an application.
 *
 * Return value: Whether we were able to ask Ubuntu to stop the process,
 *    used ubuntu_app_launch_observer_add_app_stop() to know when it is
 *    finally stopped.
 */
gboolean   ubuntu_app_launch_stop_application         (const gchar *                     appid);

/**
 * ubuntu_app_launch_pause_application:
 * @appid: ID of the application to pause
 *
 * Sends SIGSTOP to all processes related to the application
 *
 * Return value: Whether we were able to send SIGSTOP to all processes.
 */
gboolean   ubuntu_app_launch_pause_application         (const gchar *                     appid);

/**
 * ubuntu_app_launch_resume_application:
 * @appid: ID of the application to pause
 *
 * Sends SIGCONT to all processes related to the application
 *
 * Return value: Whether we were able to send SIGCONT to all processes.
 */
gboolean   ubuntu_app_launch_resume_application         (const gchar *                     appid);

/**
 * ubuntu_app_launch_application_log_path:
 * @appid: ID of the application
 *
 * Calculates the path for the log file that may be generated by
 * the application.  The log file won't be created until the application
 * prints some output.  Also, this doens't work for legacy applications
 * that are multi-instance, only single instance ones.
 *
 * Return value: Path to a log file or NULL if unavailable
 */
gchar *    ubuntu_app_launch_application_log_path     (const gchar *                     appid);

/**
 * ubuntu_app_launch_application_info:
 * @appid: ID of the application
 * @appdir: (allow-none) (transfer full): Directory for the application
 * @appdesktop: (allow-none) (transfer full): Relative path to desktop file
 *
 * Finds a location for information on an application and the relative
 * directory that it was found in. So this should be used to find icons
 * relating to that desktop file.
 *
 * Return value: Path to a log file or NULL if unavailable
 */
gboolean   ubuntu_app_launch_application_info         (const gchar *                     appid,
                                                       gchar **                          appdir,
                                                       gchar **                          appdesktop);

/**
 * ubuntu_app_launch_observer_add_app_starting:
 * @observer: (scope notified): Callback when an application is about to start
 * @user_data: (closure) (allow-none): Data to pass to the observer
 *
 * Sets up a callback to get called each time an application
 * is about to start.  The application will not start until the
 * function returns.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_app_starting (UbuntuAppLaunchAppObserver       observer,
                                                         gpointer                          user_data);
/**
 * ubuntu_app_launch_observer_add_app_started:
 * @observer: (scope notified): Callback when an application started
 * @user_data: (closure) (allow-none): Data to pass to the observer
 *
 * Sets up a callback to get called each time an application
 * has been started.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_app_started  (UbuntuAppLaunchAppObserver       observer,
                                                         gpointer                          user_data);
/**
 * ubuntu_app_launch_observer_add_app_stop:
 * @observer: (scope notified): Callback when an application stops
 * @user_data: (closure) (allow-none): Data to pass to the observer
 *
 * Sets up a callback to get called each time an application
 * stops.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_app_stop     (UbuntuAppLaunchAppObserver       observer,
                                                         gpointer                          user_data);

/**
 * ubuntu_app_launch_observer_add_app_focus:
 * @observer: (scope notified): Callback when an application is started for the second time
 * @user_data: (closure) (allow-none): Data to pass to the observer
 *
 * Sets up a callback to get called each time an app gets called
 * that is already running, so we request it to be focused again.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_app_focus    (UbuntuAppLaunchAppObserver       observer,
                                                         gpointer                          user_data);

/**
 * ubuntu_app_launch_observer_add_app_resume:
 * @observer: (scope notified): Callback when an application is started and possibly asleep
 * @user_data: (closure) (allow-none): Data to pass to the observer
 *
 * Sets up a callback to get called each time an app gets called
 * that is already running, so we request it to be given CPU time.
 * At the end of the observer running the app as assumed to be active.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_app_resume   (UbuntuAppLaunchAppObserver       observer,
                                                         gpointer                          user_data);

/**
 * ubuntu_app_launch_observer_add_app_failed:
 * @observer: (scope notified): Callback when an application fails
 * @user_data: (allow-none) (closure): Data to pass to the observer
 *
 * Sets up a callback to get called each time an application
 * stops via failure.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_app_failed   (UbuntuAppLaunchAppFailedObserver observer,
                                                         gpointer                          user_data);

/**
 * ubuntu_app_launch_observer_add_app_paused:
 * @observer: (scope notified): Callback when an application is paused
 * @user_data: (allow-none) (closure): Data to pass to the observer
 *
 * Sets up a callback to get called each time an application
 * is paused.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_app_paused   (UbuntuAppLaunchAppPausedResumedObserver observer,
                                                        gpointer                                user_data);

/**
 * ubuntu_app_launch_observer_add_app_resumed:
 * @observer: (scope notified): Callback when an application is resumed
 * @user_data: (allow-none) (closure): Data to pass to the observer
 *
 * Sets up a callback to get called each time an application
 * is resumed. Which is after the SIGCONT has been sent to the pids.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_app_resumed  (UbuntuAppLaunchAppPausedResumedObserver observer,
                                                        gpointer                                user_data);

/**
 * ubuntu_app_launch_observer_delete_app_starting:
 * @observer: (scope notified): Callback to remove
 * @user_data: (closure) (allow-none): Data that was passed to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_app_starting (UbuntuAppLaunchAppObserver       observer,
                                                            gpointer                          user_data);

/**
 * ubuntu_app_launch_observer_delete_app_started:
 * @observer: (scope notified): Callback to remove
 * @user_data: (closure) (allow-none): Data that was passed to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_app_started (UbuntuAppLaunchAppObserver       observer,
                                                         gpointer                          user_data);
/**
 * ubuntu_app_launch_observer_delete_app_stop:
 * @observer: (scope notified): Callback to remove
 * @user_data: (closure) (allow-none): Data that was passed to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_app_stop  (UbuntuAppLaunchAppObserver       observer,
                                                         gpointer                          user_data);

/**
 * ubuntu_app_launch_observer_delete_app_focus:
 * @observer: (scope notified): Callback to remove
 * @user_data: (closure) (allow-none): Data that was passed to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_app_focus    (UbuntuAppLaunchAppObserver       observer,
                                                            gpointer                          user_data);

/**
 * ubuntu_app_launch_observer_delete_app_resume:
 * @observer: (scope notified): Callback to remove
 * @user_data: (closure) (allow-none): Data that was passed to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_app_resume   (UbuntuAppLaunchAppObserver       observer,
                                                            gpointer                          user_data);

/**
 * ubuntu_app_launch_observer_delete_app_failed:
 * @observer: (scope notified): Callback to remove
 * @user_data: (closure) (allow-none): Data to pass to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_app_failed (UbuntuAppLaunchAppFailedObserver        observer,
                                                          gpointer                                 user_data);

/**
 * ubuntu_app_launch_observer_delete_app_paused:
 * @observer: (scope notified): Callback to remove
 * @user_data: (closure) (allow-none): Data to pass to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_app_paused (UbuntuAppLaunchAppPausedResumedObserver observer,
                                                         gpointer                                user_data);

/**
 * ubuntu_app_launch_observer_delete_app_resumed:
 * @observer: (scope notified): Callback to remove
 * @user_data: (closure) (allow-none): Data to pass to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_app_resumed (UbuntuAppLaunchAppPausedResumedObserver  observer,
                                                          gpointer                                 user_data);

/**
 * ubuntu_app_launch_list_running_apps:
 *
 * Gets the Application IDs of all the running applications
 * in the system.
 *
 * Return value: (transfer full): A NULL terminated list of
 *     application IDs.  Should be free'd with g_strfreev().
 */
gchar **   ubuntu_app_launch_list_running_apps         (void);

/**
 * ubuntu_app_launch_get_primary_pid:
 * @appid: ID of the application to look for
 *
 * Checks to see if an application is running and returns its
 * main PID if so.
 *
 * Return Value: Either the PID of the application or 0 if it
 *     is not running.
 */
GPid       ubuntu_app_launch_get_primary_pid           (const gchar *                     appid);

/**
 * ubuntu_app_launch_pid_in_app_id:
 * @pid: Process ID to check on
 * @appid: ID of the application to look in
 *
 * Checks to see if a PID is associated with the current application ID.
 *
 * Currently the implementation just calls ubuntu_app_launch_get_primary_pid()
 * and checks to see if they're the same.  But in the future this will check
 * any PID created in the cgroup to see if it is associated.
 *
 * Return Value: Whether @pid is associated with the @appid
 */
gboolean   ubuntu_app_launch_pid_in_app_id             (GPid                              pid,
                                                         const gchar *                     appid);

/**
 * ubuntu_app_launch_triplet_to_app_id:
 * @pkg: Click package name
 * @app: (allow-none): Application name, see description
 * @version: (allow-none): Specific version or wildcard, see description
 *
 * Constructs an appid from pkg, app, version triple.  Wildcards are allowed
 * for the @app and @version parameters.
 *
 * For the @app parameter the wildcards * "first-listed-app", "last-listed-app"
 * and "only-listed-app" can be used.  A NULL value will default to the
 * first listed app.
 *
 * For the @version parameter only one wildcard is allowed, "current-user-version".
 * If NULL is passed that is the default.
 *
 * Return Value: Either the properly constructed @appid or NULL if it failed 
 *     to construct it.
 */
gchar *     ubuntu_app_launch_triplet_to_app_id        (const gchar *                     pkg,
                                                         const gchar *                     app,
                                                         const gchar *                     version);

/**
 * ubuntu_app_launch_app_id_parse:
 * @appid: Application ID to parse
 * @package: (out) (transfer full) (allow-none): Package section of @appid
 * @application: (out) (transfer full) (allow-none): Application section of @appid
 * @version: (out) (transfer full) (allow-none): Version section of @appid
 *
 * Takes an application ID @appid and breaks it into its component parts.  Each
 * of them can be NULL if those parts aren't desired.  If all are NULL it will
 * still parse to generate a proper return value check if @appid is valid.
 *
 * Return value: Whether @appid is valid
 */
gboolean    ubuntu_app_launch_app_id_parse             (const gchar *                     appid,
                                                         gchar **                          package,
                                                         gchar **                          application,
                                                         gchar **                          version);

/**
 * ubuntu_app_launch_start_helper:
 * @type: Type of helper
 * @appid: App ID of the helper
 * @uris: (allow-none) (array zero-terminated=1) (element-type utf8) (transfer none): A NULL terminated list of URIs to send to the helper
 *
 * Start an untrusted helper for a specific @type on a given
 * @appid.  We don't know how that is done specifically, as Upstart
 * will call a helper for that type.  And then execute it under the
 * AppArmor profile for the helper as defined in its manifest.
 *
 * Return value: Whether the helper was able to be started
 */
gboolean   ubuntu_app_launch_start_helper              (const gchar *                     type,
                                                         const gchar *                     appid,
                                                         const gchar * const *             uris);

/**
 * ubuntu_app_launch_start_multiple_helper:
 * @type: Type of helper
 * @appid: App ID of the helper
 * @uris: (allow-none) (array zero-terminated=1) (element-type utf8) (transfer none): A NULL terminated list of URIs to send to the helper
 *
 * Start an untrusted helper for a specific @type of a given
 * @appid.  We don't know how that is done specifically, as Upstart
 * will call a helper for that type.  And then execute it under the
 * Apparmor profile for that helper type.  This function is different
 * from @ubuntu_app_launch_start_helper in that it works for helpers
 * that aren't single instance and the manager will be managing the
 * instances as well.
 *
 * Return value: The generated instance ID or NULL on failure
 */
gchar *    ubuntu_app_launch_start_multiple_helper     (const gchar *                     type,
                                                         const gchar *                     appid,
                                                         const gchar * const *             uris);

/**
 * ubuntu_app_launch_start_session_helper:
 * @type: Type of helper
 * @session: Mir Trusted Prompt Session to run the helper under
 * @appid: App ID of the helper
 * @uris: (allow-none) (array zero-terminated=1) (element-type utf8) (transfer none): A NULL terminated list of URIs to send to the helper
 *
 * Start an untrusted helper for a specific @type of a given
 * @appid running under a Mir Trusted Prompt Session @session. The
 * helper's MIR_SOCKET environment variable will be set appropriately
 * so that the helper will draw on the correct surfaces. Otherwise this
 * is the same as #ubuntu_app_launch_start_multiple_helper.
 *
 * It is important that all exec tools for @type call the function
 * #ubuntu_app_launch_helper_set_exec to set the exec line.
 *
 * Return value: The generated instance ID or NULL on failure
 */
gchar *    ubuntu_app_launch_start_session_helper  (const gchar *            type,
                                                    MirPromptSession *       session,
                                                    const gchar *            appid,
                                                    const gchar * const *    uris);

/**
 * ubuntu_app_launch_stop_helper:
 * @type: Type of helper
 * @appid: App ID of the helper
 *
 * Asks Upstart to kill a helper.  In general, this should be a last resort
 * as we should ask the helper a better way probably with an in-band protocol
 * of use.
 *
 * Return value: Whether the helper is stopped
 */
gboolean   ubuntu_app_launch_stop_helper               (const gchar *                     type,
                                                         const gchar *                     appid);

/**
 * ubuntu_app_launch_stop_multiple_helper:
 * @type: Type of helper
 * @appid: App ID of the helper
 * @instanceid: The instance ID returned when starting the helper
 *
 * Asks Upstart to kill a helper.  In general, this should be a last resort
 * as we should ask the helper a better way probably with an in-band protocol
 * of use.
 *
 * Return value: Whether the helper is stopped
 */
gboolean   ubuntu_app_launch_stop_multiple_helper      (const gchar *                     type,
                                                         const gchar *                     appid,
                                                         const gchar *                     instanceid);

/**
 * ubuntu_app_launch_list_helpers:
 * @type: Type of helper
 *
 * List all App IDs of helpers of a given @type.
 *
 * Return value: (transfer full): List of application IDs
 */
gchar **   ubuntu_app_launch_list_helpers              (const gchar *                     type);

/**
 * ubuntu_app_launch_list_helper_instances:
 * @type: Type of helper
 * @appid: AppID of helper
 *
 * List all the instances for a particular AppID
 *
 * Return value: (transfer full): List of instance IDs
 */
gchar **   ubuntu_app_launch_list_helper_instances     (const gchar *                     type,
                                                         const gchar *                     appid);


/**
 * ubuntu_app_launch_observer_add_helper_started:
 * @observer: (scope notified): Callback when a helper started
 * @helper_type: (closure) (allow-none): Type of helpers to look for
 * @user_data: (allow-none): Data to pass to the observer
 *
 * Sets up a callback to get called each time a helper of
 * @helper_type has been started.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_helper_started  (UbuntuAppLaunchHelperObserver    observer,
                                                            const gchar *                     helper_type,
                                                            gpointer                          user_data);
/**
 * ubuntu_app_launch_observer_add_helper_stop:
 * @observer: (scope notified): Callback when a helper stops
 * @helper_type: (closure) (allow-none): Type of helpers to look for
 * @user_data: (allow-none): Data to pass to the observer
 *
 * Sets up a callback to get called each time a helper of
 * @helper_type stops.
 *
 * Return value: Whether adding the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_add_helper_stop       (UbuntuAppLaunchHelperObserver    observer,
                                                              const gchar *                     helper_type,
                                                              gpointer                          user_data);
/**
 * ubuntu_app_launch_observer_delete_helper_started:
 * @observer: (scope notified): Callback to remove
 * @helper_type: (closure) (allow-none): Type of helpers it looked for
 * @user_data: (allow-none): Data that was passed to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_helper_started (UbuntuAppLaunchHelperObserver    observer,
                                                              const gchar *                     helper_type,
                                                              gpointer                          user_data);
/**
 * ubuntu_app_launch_observer_delete_helper_stop:
 * @observer: (scope notified): Callback to remove
 * @helper_type: (closure) (allow-none): Type of helpers it looked for
 * @user_data: (allow-none): Data that was passed to the observer
 *
 * Removes a previously registered callback to ensure it no longer
 * gets signaled.
 *
 * Return value: Whether deleting the observer was successful.
 */
gboolean   ubuntu_app_launch_observer_delete_helper_stop    (UbuntuAppLaunchHelperObserver    observer,
                                                              const gchar *                     helper_type,
                                                              gpointer                          user_data);

/**
 * ubuntu_app_launch_helper_set_exec:
 * @execline: Exec line to be executed, in Desktop file format
 * @directory: (allow-none): The directory that the exec line should
 *     be executed in.
 *
 * A function to be called by an untrusted helper exec
 * tool to set the exec line. The exec tool should determine
 * what should be executed from some sort of configuration
 * based on its type (usually a configuration file from a click
 * package). Once it determines the exec line it can set it
 * with this function and exit.
 *
 * Return Value: Whether we were able to set the exec line
 */
gboolean   ubuntu_app_launch_helper_set_exec       (const gchar *            execline,
                                                    const gchar *            directory);

#ifdef __cplusplus
}
#endif

#pragma GCC visibility pop

#endif /* __UBUNTU_APP_LAUNCH_H__ */