GCC Code Coverage Report


Directory: ./
File: shell/cc-panel.h
Date: 2024-05-03 09:46:52
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 3 6 50.0%
Branches: 3 7 42.9%

Line Branch Exec Source
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
2 *
3 * Copyright (C) 2010 Red Hat, Inc.
4 * Copyright (C) 2010 Intel, Inc
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 *
19 * Authors: William Jon McCann <jmccann@redhat.com>
20 * Thomas Wood <thomas.wood@intel.com>
21 */
22
23 #pragma once
24
25 #include <adwaita.h>
26
27 /**
28 * Utility macro used to register panels
29 *
30 * use: CC_PANEL_REGISTER (PluginName, plugin_name)
31 */
32 #define CC_PANEL_REGISTER(PluginName, plugin_name) G_DEFINE_TYPE (PluginName, plugin_name, CC_TYPE_PANEL)
33
34 /**
35 * CcPanelStaticInitFunc:
36 *
37 * Function that statically allocates resources and initializes
38 * any data that the panel will make use of during runtime.
39 *
40 * If panels represent hardware that can potentially not exist,
41 * e.g. the Wi-Fi panel, these panels can use this function to
42 * show or hide themselves without needing to have an instance
43 * created and running.
44 */
45 typedef void (*CcPanelStaticInitFunc) (void);
46
47
48 #define CC_TYPE_PANEL (cc_panel_get_type())
49
3/7
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 22 times.
✓ Branch 3 taken 22 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 22 times.
68 G_DECLARE_DERIVABLE_TYPE (CcPanel, cc_panel, CC, PANEL, AdwNavigationPage)
50
51 /**
52 * CcPanelVisibility:
53 *
54 * @CC_PANEL_HIDDEN: Panel is hidden from search and sidebar, and not reachable.
55 * @CC_PANEL_VISIBLE_IN_SEARCH: Panel is hidden from main view, but can be accessed from search.
56 * @CC_PANEL_VISIBLE: Panel is visible everywhere.
57 */
58 typedef enum
59 {
60 CC_PANEL_HIDDEN,
61 CC_PANEL_VISIBLE_IN_SEARCH,
62 CC_PANEL_VISIBLE,
63 } CcPanelVisibility;
64
65 /* cc-shell.h requires CcPanel, so make sure it is defined first */
66 #include "cc-shell.h"
67
68 G_BEGIN_DECLS
69
70 /**
71 * CcPanelClass:
72 *
73 * The contents of this struct are private and should not be accessed directly.
74 */
75 struct _CcPanelClass
76 {
77 /*< private >*/
78 AdwNavigationPageClass parent_class;
79
80 const gchar* (*get_help_uri) (CcPanel *panel);
81 };
82
83 CcShell* cc_panel_get_shell (CcPanel *panel);
84
85 GPermission* cc_panel_get_permission (CcPanel *panel);
86
87 const gchar* cc_panel_get_help_uri (CcPanel *panel);
88
89 GCancellable *cc_panel_get_cancellable (CcPanel *panel);
90
91 void cc_panel_deactivate (CcPanel *panel);
92
93 G_END_DECLS
94