github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/include/capi/cef_request_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_REQUEST_CAPI_H_
    38  #define CEF_INCLUDE_CAPI_CEF_REQUEST_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  struct _cef_post_data_element_t;
    48  struct _cef_post_data_t;
    49  
    50  ///
    51  // Structure used to represent a web request. The functions of this structure
    52  // may be called on any thread.
    53  ///
    54  typedef struct _cef_request_t {
    55    ///
    56    // Base structure.
    57    ///
    58    cef_base_t base;
    59  
    60    ///
    61    // Returns true (1) if this object is read-only.
    62    ///
    63    int (CEF_CALLBACK *is_read_only)(struct _cef_request_t* self);
    64  
    65    ///
    66    // Get the fully qualified URL.
    67    ///
    68    // The resulting string must be freed by calling cef_string_userfree_free().
    69    cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self);
    70  
    71    ///
    72    // Set the fully qualified URL.
    73    ///
    74    void (CEF_CALLBACK *set_url)(struct _cef_request_t* self,
    75        const cef_string_t* url);
    76  
    77    ///
    78    // Get the request function type. The value will default to POST if post data
    79    // is provided and GET otherwise.
    80    ///
    81    // The resulting string must be freed by calling cef_string_userfree_free().
    82    cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self);
    83  
    84    ///
    85    // Set the request function type.
    86    ///
    87    void (CEF_CALLBACK *set_method)(struct _cef_request_t* self,
    88        const cef_string_t* method);
    89  
    90    ///
    91    // Get the post data.
    92    ///
    93    struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)(
    94        struct _cef_request_t* self);
    95  
    96    ///
    97    // Set the post data.
    98    ///
    99    void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self,
   100        struct _cef_post_data_t* postData);
   101  
   102    ///
   103    // Get the header values.
   104    ///
   105    void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self,
   106        cef_string_multimap_t headerMap);
   107  
   108    ///
   109    // Set the header values.
   110    ///
   111    void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self,
   112        cef_string_multimap_t headerMap);
   113  
   114    ///
   115    // Set all values at one time.
   116    ///
   117    void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url,
   118        const cef_string_t* method, struct _cef_post_data_t* postData,
   119        cef_string_multimap_t headerMap);
   120  
   121    ///
   122    // Get the flags used in combination with cef_urlrequest_t. See
   123    // cef_urlrequest_flags_t for supported values.
   124    ///
   125    int (CEF_CALLBACK *get_flags)(struct _cef_request_t* self);
   126  
   127    ///
   128    // Set the flags used in combination with cef_urlrequest_t.  See
   129    // cef_urlrequest_flags_t for supported values.
   130    ///
   131    void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self, int flags);
   132  
   133    ///
   134    // Set the URL to the first party for cookies used in combination with
   135    // cef_urlrequest_t.
   136    ///
   137    // The resulting string must be freed by calling cef_string_userfree_free().
   138    cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)(
   139        struct _cef_request_t* self);
   140  
   141    ///
   142    // Get the URL to the first party for cookies used in combination with
   143    // cef_urlrequest_t.
   144    ///
   145    void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self,
   146        const cef_string_t* url);
   147  
   148    ///
   149    // Get the resource type for this request. Accurate resource type information
   150    // may only be available in the browser process.
   151    ///
   152    cef_resource_type_t (CEF_CALLBACK *get_resource_type)(
   153        struct _cef_request_t* self);
   154  
   155    ///
   156    // Get the transition type for this request. Only available in the browser
   157    // process and only applies to requests that represent a main frame or sub-
   158    // frame navigation.
   159    ///
   160    cef_transition_type_t (CEF_CALLBACK *get_transition_type)(
   161        struct _cef_request_t* self);
   162  } cef_request_t;
   163  
   164  
   165  ///
   166  // Create a new cef_request_t object.
   167  ///
   168  CEF_EXPORT cef_request_t* cef_request_create();
   169  
   170  
   171  ///
   172  // Structure used to represent post data for a web request. The functions of
   173  // this structure may be called on any thread.
   174  ///
   175  typedef struct _cef_post_data_t {
   176    ///
   177    // Base structure.
   178    ///
   179    cef_base_t base;
   180  
   181    ///
   182    // Returns true (1) if this object is read-only.
   183    ///
   184    int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_t* self);
   185  
   186    ///
   187    // Returns the number of existing post data elements.
   188    ///
   189    size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self);
   190  
   191    ///
   192    // Retrieve the post data elements.
   193    ///
   194    void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self,
   195        size_t* elementsCount, struct _cef_post_data_element_t** elements);
   196  
   197    ///
   198    // Remove the specified post data element.  Returns true (1) if the removal
   199    // succeeds.
   200    ///
   201    int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self,
   202        struct _cef_post_data_element_t* element);
   203  
   204    ///
   205    // Add the specified post data element.  Returns true (1) if the add succeeds.
   206    ///
   207    int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self,
   208        struct _cef_post_data_element_t* element);
   209  
   210    ///
   211    // Remove all existing post data elements.
   212    ///
   213    void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self);
   214  } cef_post_data_t;
   215  
   216  
   217  ///
   218  // Create a new cef_post_data_t object.
   219  ///
   220  CEF_EXPORT cef_post_data_t* cef_post_data_create();
   221  
   222  
   223  ///
   224  // Structure used to represent a single element in the request post data. The
   225  // functions of this structure may be called on any thread.
   226  ///
   227  typedef struct _cef_post_data_element_t {
   228    ///
   229    // Base structure.
   230    ///
   231    cef_base_t base;
   232  
   233    ///
   234    // Returns true (1) if this object is read-only.
   235    ///
   236    int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_element_t* self);
   237  
   238    ///
   239    // Remove all contents from the post data element.
   240    ///
   241    void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self);
   242  
   243    ///
   244    // The post data element will represent a file.
   245    ///
   246    void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self,
   247        const cef_string_t* fileName);
   248  
   249    ///
   250    // The post data element will represent bytes.  The bytes passed in will be
   251    // copied.
   252    ///
   253    void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self,
   254        size_t size, const void* bytes);
   255  
   256    ///
   257    // Return the type of this post data element.
   258    ///
   259    cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
   260        struct _cef_post_data_element_t* self);
   261  
   262    ///
   263    // Return the file name.
   264    ///
   265    // The resulting string must be freed by calling cef_string_userfree_free().
   266    cef_string_userfree_t (CEF_CALLBACK *get_file)(
   267        struct _cef_post_data_element_t* self);
   268  
   269    ///
   270    // Return the number of bytes.
   271    ///
   272    size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self);
   273  
   274    ///
   275    // Read up to |size| bytes into |bytes| and return the number of bytes
   276    // actually read.
   277    ///
   278    size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self,
   279        size_t size, void* bytes);
   280  } cef_post_data_element_t;
   281  
   282  
   283  ///
   284  // Create a new cef_post_data_element_t object.
   285  ///
   286  CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
   287  
   288  
   289  #ifdef __cplusplus
   290  }
   291  #endif
   292  
   293  #endif  // CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_