LCOV - code coverage report
Current view: top level - src/libvalent/device - valent-device.h (source / functions) Coverage Total Hit
Test: Code Coverage Lines: 100.0 % 1 1
Test Date: 2024-05-12 19:03:18 Functions: 100.0 % 1 1
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 75.0 % 16 12

             Branch data     Line data    Source code
       1                 :             : // SPDX-License-Identifier: GPL-3.0-or-later
       2                 :             : // SPDX-FileCopyrightText: Andy Holmes <andrew.g.r.holmes@gmail.com>
       3                 :             : 
       4                 :             : #pragma once
       5                 :             : 
       6                 :             : #if !defined (VALENT_INSIDE) && !defined (VALENT_COMPILATION)
       7                 :             : # error "Only <valent.h> can be included directly."
       8                 :             : #endif
       9                 :             : 
      10                 :             : #include <json-glib/json-glib.h>
      11                 :             : 
      12                 :             : #include "valent-channel.h"
      13                 :             : 
      14                 :             : G_BEGIN_DECLS
      15                 :             : 
      16                 :             : /**
      17                 :             :  * ValentDeviceState:
      18                 :             :  * @VALENT_DEVICE_STATE_NONE: Device is unpaired and disconnected
      19                 :             :  * @VALENT_DEVICE_STATE_CONNECTED: Device is connected
      20                 :             :  * @VALENT_DEVICE_STATE_PAIRED: Device is paired
      21                 :             :  * @VALENT_DEVICE_STATE_PAIR_INCOMING: Pair request received from device
      22                 :             :  * @VALENT_DEVICE_STATE_PAIR_OUTGOING: Pair request sent to device
      23                 :             :  *
      24                 :             :  * Device state flags.
      25                 :             :  *
      26                 :             :  * Since: 1.0
      27                 :             :  */
      28                 :             : typedef enum
      29                 :             : {
      30                 :             :   VALENT_DEVICE_STATE_NONE,
      31                 :             :   VALENT_DEVICE_STATE_CONNECTED     = (1<<0),
      32                 :             :   VALENT_DEVICE_STATE_PAIRED        = (1<<1),
      33                 :             :   VALENT_DEVICE_STATE_PAIR_INCOMING = (1<<2),
      34                 :             :   VALENT_DEVICE_STATE_PAIR_OUTGOING = (1<<3),
      35                 :             : } ValentDeviceState;
      36                 :             : 
      37                 :             : 
      38                 :             : #define VALENT_TYPE_DEVICE (valent_device_get_type())
      39                 :             : 
      40                 :             : VALENT_AVAILABLE_IN_1_0
      41   [ +  -  +  +  :       13163 : G_DECLARE_FINAL_TYPE (ValentDevice, valent_device, VALENT, DEVICE, ValentObject)
          +  +  +  +  +  
          +  +  -  +  +  
                   -  - ]
      42                 :             : 
      43                 :             : VALENT_AVAILABLE_IN_1_0
      44                 :             : ValentDevice      * valent_device_new                (const char           *id);
      45                 :             : VALENT_AVAILABLE_IN_1_0
      46                 :             : ValentChannel     * valent_device_ref_channel        (ValentDevice         *device);
      47                 :             : VALENT_AVAILABLE_IN_1_0
      48                 :             : ValentContext     * valent_device_get_context        (ValentDevice         *device);
      49                 :             : VALENT_AVAILABLE_IN_1_0
      50                 :             : const char        * valent_device_get_icon_name      (ValentDevice         *device);
      51                 :             : VALENT_AVAILABLE_IN_1_0
      52                 :             : const char        * valent_device_get_id             (ValentDevice         *device);
      53                 :             : VALENT_AVAILABLE_IN_1_0
      54                 :             : GMenuModel        * valent_device_get_menu           (ValentDevice         *device);
      55                 :             : VALENT_AVAILABLE_IN_1_0
      56                 :             : const char        * valent_device_get_name           (ValentDevice         *device);
      57                 :             : VALENT_AVAILABLE_IN_1_0
      58                 :             : GStrv               valent_device_get_plugins        (ValentDevice         *device);
      59                 :             : VALENT_AVAILABLE_IN_1_0
      60                 :             : ValentDeviceState   valent_device_get_state          (ValentDevice         *device);
      61                 :             : VALENT_AVAILABLE_IN_1_0
      62                 :             : void                valent_device_send_packet        (ValentDevice         *device,
      63                 :             :                                                       JsonNode             *packet,
      64                 :             :                                                       GCancellable         *cancellable,
      65                 :             :                                                       GAsyncReadyCallback   callback,
      66                 :             :                                                       gpointer              user_data);
      67                 :             : VALENT_AVAILABLE_IN_1_0
      68                 :             : gboolean            valent_device_send_packet_finish (ValentDevice         *device,
      69                 :             :                                                       GAsyncResult         *result,
      70                 :             :                                                       GError              **error);
      71                 :             : VALENT_AVAILABLE_IN_1_0
      72                 :             : char              * valent_device_generate_id        (void);
      73                 :             : VALENT_AVAILABLE_IN_1_0
      74                 :             : gboolean            valent_device_validate_id        (const char           *id);
      75                 :             : VALENT_AVAILABLE_IN_1_0
      76                 :             : gboolean            valent_device_validate_name      (const char           *name);
      77                 :             : 
      78                 :             : G_END_DECLS
      79                 :             : 
        

Generated by: LCOV version 2.0-1