LCOV - code coverage report
Current view: top level - src/libvalent/core - valent-transfer.h (source / functions) Coverage Total Hit
Test: Code Coverage Lines: 100.0 % 1 1
Test Date: 2024-05-05 22:34:11 Functions: 100.0 % 1 1
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 50.0 % 16 8

             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 "valent-object.h"
      11                 :             : 
      12                 :             : G_BEGIN_DECLS
      13                 :             : 
      14                 :             : /**
      15                 :             :  * ValentTransferState:
      16                 :             :  * @VALENT_TRANSFER_STATE_PENDING: The transfer is pending
      17                 :             :  * @VALENT_TRANSFER_STATE_ACTIVE: The transfer is in progress
      18                 :             :  * @VALENT_TRANSFER_STATE_COMPLETE: The transfer succeeded
      19                 :             :  * @VALENT_TRANSFER_STATE_FAILED: The transfer failed
      20                 :             :  *
      21                 :             :  * Enumeration of transfer states.
      22                 :             :  *
      23                 :             :  * Since: 1.0
      24                 :             :  */
      25                 :             : typedef enum
      26                 :             : {
      27                 :             :   VALENT_TRANSFER_STATE_PENDING,
      28                 :             :   VALENT_TRANSFER_STATE_ACTIVE,
      29                 :             :   VALENT_TRANSFER_STATE_COMPLETE,
      30                 :             :   VALENT_TRANSFER_STATE_FAILED,
      31                 :             : } ValentTransferState;
      32                 :             : 
      33                 :             : #define VALENT_TYPE_TRANSFER (valent_transfer_get_type())
      34                 :             : 
      35                 :             : VALENT_AVAILABLE_IN_1_0
      36   [ +  -  +  -  :         396 : G_DECLARE_DERIVABLE_TYPE (ValentTransfer, valent_transfer, VALENT, TRANSFER, ValentObject)
          +  -  +  -  +  
          -  +  -  +  -  
                   +  - ]
      37                 :             : 
      38                 :             : struct _ValentTransferClass
      39                 :             : {
      40                 :             :   ValentObjectClass   parent_class;
      41                 :             : 
      42                 :             :   /* virtual functions */
      43                 :             :   void                (*execute)        (ValentTransfer       *transfer,
      44                 :             :                                          GCancellable         *cancellable,
      45                 :             :                                          GAsyncReadyCallback   callback,
      46                 :             :                                          gpointer              user_data);
      47                 :             :   gboolean            (*execute_finish) (ValentTransfer       *transfer,
      48                 :             :                                          GAsyncResult         *result,
      49                 :             :                                          GError              **error);
      50                 :             : 
      51                 :             :   /*< private >*/
      52                 :             :   gpointer            padding[8];
      53                 :             : };
      54                 :             : 
      55                 :             : VALENT_AVAILABLE_IN_1_0
      56                 :             : char                * valent_transfer_dup_id         (ValentTransfer       *transfer);
      57                 :             : VALENT_AVAILABLE_IN_1_0
      58                 :             : double                valent_transfer_get_progress   (ValentTransfer       *transfer);
      59                 :             : VALENT_AVAILABLE_IN_1_0
      60                 :             : void                  valent_transfer_set_progress   (ValentTransfer       *transfer,
      61                 :             :                                                       double                progress);
      62                 :             : VALENT_AVAILABLE_IN_1_0
      63                 :             : ValentTransferState   valent_transfer_get_state      (ValentTransfer       *transfer);
      64                 :             : VALENT_AVAILABLE_IN_1_0
      65                 :             : void                  valent_transfer_execute        (ValentTransfer       *transfer,
      66                 :             :                                                       GCancellable         *cancellable,
      67                 :             :                                                       GAsyncReadyCallback   callback,
      68                 :             :                                                       gpointer              user_data);
      69                 :             : VALENT_AVAILABLE_IN_1_0
      70                 :             : gboolean              valent_transfer_execute_finish (ValentTransfer       *transfer,
      71                 :             :                                                       GAsyncResult         *result,
      72                 :             :                                                       GError              **error);
      73                 :             : VALENT_AVAILABLE_IN_1_0
      74                 :             : void                  valent_transfer_cancel         (ValentTransfer       *transfer);
      75                 :             : VALENT_AVAILABLE_IN_1_0
      76                 :             : gboolean              valent_transfer_check_status   (ValentTransfer       *transfer,
      77                 :             :                                                       GError              **error);
      78                 :             : 
      79                 :             : G_END_DECLS
      80                 :             : 
        

Generated by: LCOV version 2.0-1