1 // Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
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
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.
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.
30 // ---------------------------------------------------------------------------
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
37 #ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
38 #define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
41 #include "include/capi/cef_base_capi.h"
49 // Structure used to represent a download item.
51 typedef struct _cef_download_item_t {
58 // Returns true (1) if this object is valid. Do not call any other functions
59 // if this function returns false (0).
61 int (CEF_CALLBACK *is_valid)(struct _cef_download_item_t* self);
64 // Returns true (1) if the download is in progress.
66 int (CEF_CALLBACK *is_in_progress)(struct _cef_download_item_t* self);
69 // Returns true (1) if the download is complete.
71 int (CEF_CALLBACK *is_complete)(struct _cef_download_item_t* self);
74 // Returns true (1) if the download has been canceled or interrupted.
76 int (CEF_CALLBACK *is_canceled)(struct _cef_download_item_t* self);
79 // Returns a simple speed estimate in bytes/s.
81 int64 (CEF_CALLBACK *get_current_speed)(struct _cef_download_item_t* self);
84 // Returns the rough percent complete or -1 if the receive total size is
87 int (CEF_CALLBACK *get_percent_complete)(struct _cef_download_item_t* self);
90 // Returns the total number of bytes.
92 int64 (CEF_CALLBACK *get_total_bytes)(struct _cef_download_item_t* self);
95 // Returns the number of received bytes.
97 int64 (CEF_CALLBACK *get_received_bytes)(struct _cef_download_item_t* self);
100 // Returns the time that the download started.
102 cef_time_t (CEF_CALLBACK *get_start_time)(struct _cef_download_item_t* self);
105 // Returns the time that the download ended.
107 cef_time_t (CEF_CALLBACK *get_end_time)(struct _cef_download_item_t* self);
110 // Returns the full path to the downloaded or downloading file.
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);
117 // Returns the unique identifier for this download.
119 uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self);
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);
129 // Returns the original URL before any redirections.
131 // The resulting string must be freed by calling cef_string_userfree_free().
132 cef_string_userfree_t (CEF_CALLBACK *get_original_url)(
133 struct _cef_download_item_t* self);
136 // Returns the suggested file name.
138 // The resulting string must be freed by calling cef_string_userfree_free().
139 cef_string_userfree_t (CEF_CALLBACK *get_suggested_file_name)(
140 struct _cef_download_item_t* self);
143 // Returns the content disposition.
145 // The resulting string must be freed by calling cef_string_userfree_free().
146 cef_string_userfree_t (CEF_CALLBACK *get_content_disposition)(
147 struct _cef_download_item_t* self);
150 // Returns the mime type.
152 // The resulting string must be freed by calling cef_string_userfree_free().
153 cef_string_userfree_t (CEF_CALLBACK *get_mime_type)(
154 struct _cef_download_item_t* self);
155 } cef_download_item_t;
162 #endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_