Branch data Line data Source code
1 : : /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 : : /*
3 : : * Copyright 2024 GNOME Foundation, Inc.
4 : : *
5 : : * This library is free software; you can redistribute it and/or
6 : : * modify it under the terms of the GNU Lesser General Public
7 : : * License as published by the Free Software Foundation; either
8 : : * version 2 of the License, or (at your option) any later version.
9 : : *
10 : : * This library is distributed in the hope that it will be useful,
11 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 : : * Lesser General Public License for more details.
14 : : *
15 : : * You should have received a copy of the GNU Lesser General
16 : : * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 : : *
18 : : * Authors:
19 : : * - Philip Withnall <pwithnall@gnome.org>
20 : : *
21 : : * SPDX-License-Identifier: GPL-3.0-or-later
22 : : */
23 : :
24 : : #pragma once
25 : :
26 : : #include <adwaita.h>
27 : : #include <glib-object.h>
28 : : #include <gtk/gtk.h>
29 : :
30 : : G_BEGIN_DECLS
31 : :
32 : : #define CC_TYPE_SCREEN_TIME_STATISTICS_ROW (cc_screen_time_statistics_row_get_type())
33 [ # # # # : 0 : G_DECLARE_DERIVABLE_TYPE (CcScreenTimeStatisticsRow, cc_screen_time_statistics_row, CC, SCREEN_TIME_STATISTICS_ROW, AdwActionRow)
# # ]
34 : :
35 : : struct _CcScreenTimeStatisticsRowClass
36 : : {
37 : : AdwActionRowClass parent_class;
38 : :
39 : : void (* load_data_async) (CcScreenTimeStatisticsRow *row,
40 : : GCancellable *cancellable,
41 : : GAsyncReadyCallback callback,
42 : : void *user_data);
43 : : gboolean (* load_data_finish) (CcScreenTimeStatisticsRow *self,
44 : : GAsyncResult *result,
45 : : GDate *out_new_model_start_date,
46 : : size_t *out_new_model_n_days,
47 : : double **out_new_model_screen_time_per_day,
48 : : GError **error);
49 : :
50 : : void *padding[12];
51 : : };
52 : :
53 : : CcScreenTimeStatisticsRow *cc_screen_time_statistics_row_new (void);
54 : :
55 : : GFile *cc_screen_time_statistics_row_get_history_file (CcScreenTimeStatisticsRow *self);
56 : : void cc_screen_time_statistics_row_set_history_file (CcScreenTimeStatisticsRow *self,
57 : : GFile *history_file);
58 : :
59 : : const GDate *cc_screen_time_statistics_row_get_selected_date (CcScreenTimeStatisticsRow *self);
60 : : void cc_screen_time_statistics_row_set_selected_date (CcScreenTimeStatisticsRow *self,
61 : : const GDate *selected_date);
62 : :
63 : : unsigned int cc_screen_time_statistics_row_get_daily_limit (CcScreenTimeStatisticsRow *self);
64 : : void cc_screen_time_statistics_row_set_daily_limit (CcScreenTimeStatisticsRow *self,
65 : : unsigned int daily_limit_minutes);
66 : :
67 : : G_END_DECLS
|