LCOV - code coverage report
Current view: top level - libmogwai-tariff - tariff.h (source / functions) Hit Total Coverage
Test: Code coverage Lines: 1 1 100.0 %
Date: 2022-06-30 20:59:16 Functions: 4 4 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 4 6 66.7 %

           Branch data     Line data    Source code
       1                 :            : /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
       2                 :            :  *
       3                 :            :  * Copyright © 2018 Endless Mobile, 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.1 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 Public
      16                 :            :  * License along with this library; if not, write to the Free Software
      17                 :            :  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
      18                 :            :  *
      19                 :            :  * Authors:
      20                 :            :  *  - Philip Withnall <withnall@endlessm.com>
      21                 :            :  */
      22                 :            : 
      23                 :            : #pragma once
      24                 :            : 
      25                 :            : #include <glib.h>
      26                 :            : #include <glib-object.h>
      27                 :            : #include <libmogwai-tariff/period.h>
      28                 :            : 
      29                 :            : G_BEGIN_DECLS
      30                 :            : 
      31                 :            : /**
      32                 :            :  * MwtTariffError:
      33                 :            :  * @MWT_TARIFF_ERROR_INVALID: Properties for the #MwtTariff are invalid.
      34                 :            :  *
      35                 :            :  * Errors which can be returned by #MwtTariff.
      36                 :            :  *
      37                 :            :  * Since: 0.1.0
      38                 :            :  */
      39                 :            : typedef enum
      40                 :            : {
      41                 :            :   MWT_TARIFF_ERROR_INVALID = 0,
      42                 :            : } MwtTariffError;
      43                 :            : #define MWT_TARIFF_N_ERRORS (MWT_TARIFF_ERROR_INVALID + 1)
      44                 :            : 
      45                 :            : GQuark mwt_tariff_error_quark (void);
      46                 :            : #define MWT_TARIFF_ERROR mwt_tariff_error_quark ()
      47                 :            : 
      48                 :            : #define MWT_TYPE_TARIFF mwt_tariff_get_type ()
      49   [ +  +  +  -  :        557 : G_DECLARE_FINAL_TYPE (MwtTariff, mwt_tariff, MWT, TARIFF, GObject)
                   +  - ]
      50                 :            : 
      51                 :            : gboolean     mwt_tariff_validate         (const gchar  *name,
      52                 :            :                                           GPtrArray    *periods,
      53                 :            :                                           GError      **error);
      54                 :            : 
      55                 :            : MwtTariff   *mwt_tariff_new              (const gchar  *name,
      56                 :            :                                           GPtrArray    *periods);
      57                 :            : 
      58                 :            : const gchar *mwt_tariff_get_name         (MwtTariff    *self);
      59                 :            : GPtrArray   *mwt_tariff_get_periods      (MwtTariff    *self);
      60                 :            : 
      61                 :            : MwtPeriod   *mwt_tariff_lookup_period    (MwtTariff    *self,
      62                 :            :                                           GDateTime    *when);
      63                 :            : GDateTime   *mwt_tariff_get_next_transition (MwtTariff  *self,
      64                 :            :                                              GDateTime  *after,
      65                 :            :                                              MwtPeriod **out_from_period,
      66                 :            :                                              MwtPeriod **out_to_period);
      67                 :            : 
      68                 :            : gboolean     mwt_tariff_validate_name    (const gchar  *name);
      69                 :            : 
      70                 :            : G_END_DECLS

Generated by: LCOV version 1.16