GCC Code Coverage Report


Directory: ./
File: src/ppd-action.h
Date: 2024-09-13 00:56:02
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 1 1 100.0%
Branches: 12 15 80.0%

Line Branch Exec Source
1 /*
2 * Copyright (c) 2020 Bastien Nocera <hadess@hadess.net>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3 as published by
6 * the Free Software Foundation.
7 *
8 */
9
10 #pragma once
11
12 #include <glib-object.h>
13 #include "ppd-profile.h"
14
15 #define PPD_TYPE_ACTION (ppd_action_get_type ())
16
12/15
✓ Branch 0 taken 18 times.
✓ Branch 1 taken 164 times.
✓ Branch 2 taken 254 times.
✓ Branch 3 taken 44 times.
✓ Branch 4 taken 300 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 668 times.
✓ Branch 7 taken 134 times.
✓ Branch 8 taken 402 times.
✓ Branch 9 taken 2502 times.
✓ Branch 10 taken 402 times.
✓ Branch 11 taken 2502 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2502 times.
✗ Branch 14 not taken.
5156 G_DECLARE_DERIVABLE_TYPE (PpdAction, ppd_action, PPD, ACTION, GObject)
17
18 /**
19 * PpdActionClass:
20 * @parent_class: The parent class.
21 * @probe: Called by the daemon on startup.
22 * @activate_profile: Called by the daemon when the profile changes.
23 * @power_changed: Called by the daemon when the power source changes.
24 * @battery_changed: Called by the daemon when the battery level changes.
25 *
26 * New profile actions should derive from #PpdAction and implement
27 * at least @activate_profile.
28 */
29 struct _PpdActionClass
30 {
31 GObjectClass parent_class;
32
33 PpdProbeResult (* probe) (PpdAction *action);
34 gboolean (* activate_profile) (PpdAction *action,
35 PpdProfile profile,
36 GError **error);
37 gboolean (* power_changed) (PpdAction *action,
38 PpdPowerChangedReason reason,
39 GError **error);
40 gboolean (* battery_changed) (PpdAction *action,
41 gdouble val,
42 GError **error);
43
44 };
45
46 #ifndef __GTK_DOC_IGNORE__
47 PpdProbeResult ppd_action_probe (PpdAction *action);
48 gboolean ppd_action_activate_profile (PpdAction *action, PpdProfile profile, GError **error);
49 gboolean ppd_action_power_changed (PpdAction *action, PpdPowerChangedReason reason, GError **error);
50 gboolean ppd_action_battery_changed (PpdAction *action, gdouble val, GError **error);
51 const char *ppd_action_get_action_name (PpdAction *action);
52 #endif
53