github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/include/capi/cef_download_item_capi.h (about)

     1  // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
     2  //
     3  // Redistribution and use in source and binary forms, with or without
     4  // modification, are permitted provided that the following conditions are
     5  // met:
     6  //
     7  //    * Redistributions of source code must retain the above copyright
     8  // notice, this list of conditions and the following disclaimer.
     9  //    * Redistributions in binary form must reproduce the above
    10  // copyright notice, this list of conditions and the following disclaimer
    11  // in the documentation and/or other materials provided with the
    12  // distribution.
    13  //    * Neither the name of Google Inc. nor the name Chromium Embedded
    14  // Framework nor the names of its contributors may be used to endorse
    15  // or promote products derived from this software without specific prior
    16  // written permission.
    17  //
    18  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    19  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    20  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    21  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    22  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    23  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    24  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    25  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    26  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    27  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    28  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    29  //
    30  // ---------------------------------------------------------------------------
    31  //
    32  // This file was generated by the CEF translator tool and should not edited
    33  // by hand. See the translator.README.txt file in the tools directory for
    34  // more information.
    35  //
    36  
    37  #ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
    38  #define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
    39  #pragma once
    40  
    41  #ifdef __cplusplus
    42  extern "C" {
    43  #endif
    44  
    45  #include "include/capi/cef_base_capi.h"
    46  
    47  
    48  ///
    49  // Structure used to represent a download item.
    50  ///
    51  typedef struct _cef_download_item_t {
    52    ///
    53    // Base structure.
    54    ///
    55    cef_base_t base;
    56  
    57    ///
    58    // Returns true (1) if this object is valid. Do not call any other functions
    59    // if this function returns false (0).
    60    ///
    61    int (CEF_CALLBACK *is_valid)(struct _cef_download_item_t* self);
    62  
    63    ///
    64    // Returns true (1) if the download is in progress.
    65    ///
    66    int (CEF_CALLBACK *is_in_progress)(struct _cef_download_item_t* self);
    67  
    68    ///
    69    // Returns true (1) if the download is complete.
    70    ///
    71    int (CEF_CALLBACK *is_complete)(struct _cef_download_item_t* self);
    72  
    73    ///
    74    // Returns true (1) if the download has been canceled or interrupted.
    75    ///
    76    int (CEF_CALLBACK *is_canceled)(struct _cef_download_item_t* self);
    77  
    78    ///
    79    // Returns a simple speed estimate in bytes/s.
    80    ///
    81    int64 (CEF_CALLBACK *get_current_speed)(struct _cef_download_item_t* self);
    82  
    83    ///
    84    // Returns the rough percent complete or -1 if the receive total size is
    85    // unknown.
    86    ///
    87    int (CEF_CALLBACK *get_percent_complete)(struct _cef_download_item_t* self);
    88  
    89    ///
    90    // Returns the total number of bytes.
    91    ///
    92    int64 (CEF_CALLBACK *get_total_bytes)(struct _cef_download_item_t* self);
    93  
    94    ///
    95    // Returns the number of received bytes.
    96    ///
    97    int64 (CEF_CALLBACK *get_received_bytes)(struct _cef_download_item_t* self);
    98  
    99    ///
   100    // Returns the time that the download started.
   101    ///
   102    cef_time_t (CEF_CALLBACK *get_start_time)(struct _cef_download_item_t* self);
   103  
   104    ///
   105    // Returns the time that the download ended.
   106    ///
   107    cef_time_t (CEF_CALLBACK *get_end_time)(struct _cef_download_item_t* self);
   108  
   109    ///
   110    // Returns the full path to the downloaded or downloading file.
   111    ///
   112    // The resulting string must be freed by calling cef_string_userfree_free().
   113    cef_string_userfree_t (CEF_CALLBACK *get_full_path)(
   114        struct _cef_download_item_t* self);
   115  
   116    ///
   117    // Returns the unique identifier for this download.
   118    ///
   119    uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self);
   120  
   121    ///
   122    // Returns the URL.
   123    ///
   124    // The resulting string must be freed by calling cef_string_userfree_free().
   125    cef_string_userfree_t (CEF_CALLBACK *get_url)(
   126        struct _cef_download_item_t* self);
   127  
   128    ///
   129    // Returns the suggested file name.
   130    ///
   131    // The resulting string must be freed by calling cef_string_userfree_free().
   132    cef_string_userfree_t (CEF_CALLBACK *get_suggested_file_name)(
   133        struct _cef_download_item_t* self);
   134  
   135    ///
   136    // Returns the content disposition.
   137    ///
   138    // The resulting string must be freed by calling cef_string_userfree_free().
   139    cef_string_userfree_t (CEF_CALLBACK *get_content_disposition)(
   140        struct _cef_download_item_t* self);
   141  
   142    ///
   143    // Returns the mime type.
   144    ///
   145    // The resulting string must be freed by calling cef_string_userfree_free().
   146    cef_string_userfree_t (CEF_CALLBACK *get_mime_type)(
   147        struct _cef_download_item_t* self);
   148  } cef_download_item_t;
   149  
   150  
   151  #ifdef __cplusplus
   152  }
   153  #endif
   154  
   155  #endif  // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_