LCOV - code coverage report
Current view: top level - libmalcontent-timer - parent-timer-service.h (source / functions) Coverage Total Hit
Test: 2 coverage DB files Lines: 100.0 % 1 1
Test Date: 2025-09-15 13:55:46 Functions: 100.0 % 2 2
Branches: 50.0 % 6 3

             Branch data     Line data    Source code
       1                 :             : /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
       2                 :             :  *
       3                 :             :  * Copyright 2025 GNOME Foundation, Inc.
       4                 :             :  *
       5                 :             :  * SPDX-License-Identifier: LGPL-2.1-or-later
       6                 :             :  *
       7                 :             :  * This library is free software; you can redistribute it and/or
       8                 :             :  * modify it under the terms of the GNU Lesser General Public
       9                 :             :  * License as published by the Free Software Foundation; either
      10                 :             :  * version 2.1 of the License, or (at your option) any later version.
      11                 :             :  *
      12                 :             :  * This library is distributed in the hope that it will be useful,
      13                 :             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14                 :             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      15                 :             :  * Lesser General Public License for more details.
      16                 :             :  *
      17                 :             :  * You should have received a copy of the GNU Lesser General Public
      18                 :             :  * License along with this library; if not, write to the Free Software
      19                 :             :  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
      20                 :             :  *
      21                 :             :  * Authors:
      22                 :             :  *  - Philip Withnall <pwithnall@gnome.org>
      23                 :             :  */
      24                 :             : 
      25                 :             : #pragma once
      26                 :             : 
      27                 :             : #include <glib.h>
      28                 :             : #include <glib-object.h>
      29                 :             : #include <gio/gio.h>
      30                 :             : #include <libgsystemservice/peer-manager.h>
      31                 :             : #include <libmalcontent/user-manager.h>
      32                 :             : #include <libmalcontent-timer/timer-store.h>
      33                 :             : 
      34                 :             : G_BEGIN_DECLS
      35                 :             : 
      36                 :             : /**
      37                 :             :  * MctParentTimerServiceError:
      38                 :             :  * @MCT_PARENT_TIMER_SERVICE_ERROR_INVALID_QUERY: A query parameter was invalid.
      39                 :             :  * @MCT_PARENT_TIMER_SERVICE_ERROR_STORAGE_ERROR: The database is corrupt or there
      40                 :             :  *   was an I/O error when using it.
      41                 :             :  * @MCT_PARENT_TIMER_SERVICE_ERROR_BUSY: The database is already busy for this username.
      42                 :             :  * @MCT_PARENT_TIMER_SERVICE_ERROR_IDENTIFYING_USER: The calling user could not be
      43                 :             :  *   identified.
      44                 :             :  * @MCT_PARENT_TIMER_SERVICE_ERROR_PERMISSION_DENIED: The calling user does not
      45                 :             :  *   have permission to query usage records for the requested child user.
      46                 :             :  *
      47                 :             :  * Errors which can be returned by [class@Malcontent.ParentTimerService].
      48                 :             :  *
      49                 :             :  * Since: 0.14.0
      50                 :             :  */
      51                 :             : typedef enum
      52                 :             : {
      53                 :             :   MCT_PARENT_TIMER_SERVICE_ERROR_INVALID_QUERY = 0,
      54                 :             :   MCT_PARENT_TIMER_SERVICE_ERROR_STORAGE_ERROR,
      55                 :             :   MCT_PARENT_TIMER_SERVICE_ERROR_BUSY,
      56                 :             :   MCT_PARENT_TIMER_SERVICE_ERROR_IDENTIFYING_USER,
      57                 :             :   MCT_PARENT_TIMER_SERVICE_ERROR_PERMISSION_DENIED,
      58                 :             : } MctParentTimerServiceError;
      59                 :             : #define MCT_PARENT_TIMER_SERVICE_N_ERRORS (MCT_PARENT_TIMER_SERVICE_ERROR_PERMISSION_DENIED + 1)
      60                 :             : 
      61                 :             : GQuark mct_parent_timer_service_error_quark (void);
      62                 :             : #define MCT_PARENT_TIMER_SERVICE_ERROR mct_parent_timer_service_error_quark ()
      63                 :             : 
      64                 :             : #define MCT_TYPE_PARENT_TIMER_SERVICE mct_parent_timer_service_get_type ()
      65   [ -  +  +  -  :          13 : G_DECLARE_FINAL_TYPE (MctParentTimerService, mct_parent_timer_service, MCT,
                   +  - ]
      66                 :             :                       PARENT_TIMER_SERVICE, GObject)
      67                 :             : 
      68                 :             : MctParentTimerService *mct_parent_timer_service_new (GDBusConnection *connection,
      69                 :             :                                                      const char      *object_path,
      70                 :             :                                                      MctTimerStore   *timer_store,
      71                 :             :                                                      MctUserManager  *user_manager,
      72                 :             :                                                      GssPeerManager  *peer_manager);
      73                 :             : 
      74                 :             : gboolean mct_parent_timer_service_register (MctParentTimerService   *self,
      75                 :             :                                             GError                **error);
      76                 :             : void     mct_parent_timer_service_unregister (MctParentTimerService *self);
      77                 :             : 
      78                 :             : gboolean mct_parent_timer_service_get_busy (MctParentTimerService *self);
      79                 :             : 
      80                 :             : G_END_DECLS
        

Generated by: LCOV version 2.0-1