github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/include/capi/cef_values_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_VALUES_CAPI_H_
    38  #define CEF_INCLUDE_CAPI_CEF_VALUES_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_dictionary_value_t;
    48  struct _cef_list_value_t;
    49  
    50  ///
    51  // Structure representing a binary value. Can be used on any process and thread.
    52  ///
    53  typedef struct _cef_binary_value_t {
    54    ///
    55    // Base structure.
    56    ///
    57    cef_base_t base;
    58  
    59    ///
    60    // Returns true (1) if this object is valid. Do not call any other functions
    61    // if this function returns false (0).
    62    ///
    63    int (CEF_CALLBACK *is_valid)(struct _cef_binary_value_t* self);
    64  
    65    ///
    66    // Returns true (1) if this object is currently owned by another object.
    67    ///
    68    int (CEF_CALLBACK *is_owned)(struct _cef_binary_value_t* self);
    69  
    70    ///
    71    // Returns a copy of this object. The data in this object will also be copied.
    72    ///
    73    struct _cef_binary_value_t* (CEF_CALLBACK *copy)(
    74        struct _cef_binary_value_t* self);
    75  
    76    ///
    77    // Returns the data size.
    78    ///
    79    size_t (CEF_CALLBACK *get_size)(struct _cef_binary_value_t* self);
    80  
    81    ///
    82    // Read up to |buffer_size| number of bytes into |buffer|. Reading begins at
    83    // the specified byte |data_offset|. Returns the number of bytes read.
    84    ///
    85    size_t (CEF_CALLBACK *get_data)(struct _cef_binary_value_t* self,
    86        void* buffer, size_t buffer_size, size_t data_offset);
    87  } cef_binary_value_t;
    88  
    89  
    90  ///
    91  // Creates a new object that is not owned by any other object. The specified
    92  // |data| will be copied.
    93  ///
    94  CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data,
    95      size_t data_size);
    96  
    97  
    98  ///
    99  // Structure representing a dictionary value. Can be used on any process and
   100  // thread.
   101  ///
   102  typedef struct _cef_dictionary_value_t {
   103    ///
   104    // Base structure.
   105    ///
   106    cef_base_t base;
   107  
   108    ///
   109    // Returns true (1) if this object is valid. Do not call any other functions
   110    // if this function returns false (0).
   111    ///
   112    int (CEF_CALLBACK *is_valid)(struct _cef_dictionary_value_t* self);
   113  
   114    ///
   115    // Returns true (1) if this object is currently owned by another object.
   116    ///
   117    int (CEF_CALLBACK *is_owned)(struct _cef_dictionary_value_t* self);
   118  
   119    ///
   120    // Returns true (1) if the values of this object are read-only. Some APIs may
   121    // expose read-only objects.
   122    ///
   123    int (CEF_CALLBACK *is_read_only)(struct _cef_dictionary_value_t* self);
   124  
   125    ///
   126    // Returns a writable copy of this object. If |exclude_NULL_children| is true
   127    // (1) any NULL dictionaries or lists will be excluded from the copy.
   128    ///
   129    struct _cef_dictionary_value_t* (CEF_CALLBACK *copy)(
   130        struct _cef_dictionary_value_t* self, int exclude_empty_children);
   131  
   132    ///
   133    // Returns the number of values.
   134    ///
   135    size_t (CEF_CALLBACK *get_size)(struct _cef_dictionary_value_t* self);
   136  
   137    ///
   138    // Removes all values. Returns true (1) on success.
   139    ///
   140    int (CEF_CALLBACK *clear)(struct _cef_dictionary_value_t* self);
   141  
   142    ///
   143    // Returns true (1) if the current dictionary has a value for the given key.
   144    ///
   145    int (CEF_CALLBACK *has_key)(struct _cef_dictionary_value_t* self,
   146        const cef_string_t* key);
   147  
   148    ///
   149    // Reads all keys for this dictionary into the specified vector.
   150    ///
   151    int (CEF_CALLBACK *get_keys)(struct _cef_dictionary_value_t* self,
   152        cef_string_list_t keys);
   153  
   154    ///
   155    // Removes the value at the specified key. Returns true (1) is the value was
   156    // removed successfully.
   157    ///
   158    int (CEF_CALLBACK *remove)(struct _cef_dictionary_value_t* self,
   159        const cef_string_t* key);
   160  
   161    ///
   162    // Returns the value type for the specified key.
   163    ///
   164    cef_value_type_t (CEF_CALLBACK *get_type)(
   165        struct _cef_dictionary_value_t* self, const cef_string_t* key);
   166  
   167    ///
   168    // Returns the value at the specified key as type bool.
   169    ///
   170    int (CEF_CALLBACK *get_bool)(struct _cef_dictionary_value_t* self,
   171        const cef_string_t* key);
   172  
   173    ///
   174    // Returns the value at the specified key as type int.
   175    ///
   176    int (CEF_CALLBACK *get_int)(struct _cef_dictionary_value_t* self,
   177        const cef_string_t* key);
   178  
   179    ///
   180    // Returns the value at the specified key as type double.
   181    ///
   182    double (CEF_CALLBACK *get_double)(struct _cef_dictionary_value_t* self,
   183        const cef_string_t* key);
   184  
   185    ///
   186    // Returns the value at the specified key as type string.
   187    ///
   188    // The resulting string must be freed by calling cef_string_userfree_free().
   189    cef_string_userfree_t (CEF_CALLBACK *get_string)(
   190        struct _cef_dictionary_value_t* self, const cef_string_t* key);
   191  
   192    ///
   193    // Returns the value at the specified key as type binary.
   194    ///
   195    struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)(
   196        struct _cef_dictionary_value_t* self, const cef_string_t* key);
   197  
   198    ///
   199    // Returns the value at the specified key as type dictionary.
   200    ///
   201    struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)(
   202        struct _cef_dictionary_value_t* self, const cef_string_t* key);
   203  
   204    ///
   205    // Returns the value at the specified key as type list.
   206    ///
   207    struct _cef_list_value_t* (CEF_CALLBACK *get_list)(
   208        struct _cef_dictionary_value_t* self, const cef_string_t* key);
   209  
   210    ///
   211    // Sets the value at the specified key as type null. Returns true (1) if the
   212    // value was set successfully.
   213    ///
   214    int (CEF_CALLBACK *set_null)(struct _cef_dictionary_value_t* self,
   215        const cef_string_t* key);
   216  
   217    ///
   218    // Sets the value at the specified key as type bool. Returns true (1) if the
   219    // value was set successfully.
   220    ///
   221    int (CEF_CALLBACK *set_bool)(struct _cef_dictionary_value_t* self,
   222        const cef_string_t* key, int value);
   223  
   224    ///
   225    // Sets the value at the specified key as type int. Returns true (1) if the
   226    // value was set successfully.
   227    ///
   228    int (CEF_CALLBACK *set_int)(struct _cef_dictionary_value_t* self,
   229        const cef_string_t* key, int value);
   230  
   231    ///
   232    // Sets the value at the specified key as type double. Returns true (1) if the
   233    // value was set successfully.
   234    ///
   235    int (CEF_CALLBACK *set_double)(struct _cef_dictionary_value_t* self,
   236        const cef_string_t* key, double value);
   237  
   238    ///
   239    // Sets the value at the specified key as type string. Returns true (1) if the
   240    // value was set successfully.
   241    ///
   242    int (CEF_CALLBACK *set_string)(struct _cef_dictionary_value_t* self,
   243        const cef_string_t* key, const cef_string_t* value);
   244  
   245    ///
   246    // Sets the value at the specified key as type binary. Returns true (1) if the
   247    // value was set successfully. If |value| is currently owned by another object
   248    // then the value will be copied and the |value| reference will not change.
   249    // Otherwise, ownership will be transferred to this object and the |value|
   250    // reference will be invalidated.
   251    ///
   252    int (CEF_CALLBACK *set_binary)(struct _cef_dictionary_value_t* self,
   253        const cef_string_t* key, struct _cef_binary_value_t* value);
   254  
   255    ///
   256    // Sets the value at the specified key as type dict. Returns true (1) if the
   257    // value was set successfully. After calling this function the |value| object
   258    // will no longer be valid. If |value| is currently owned by another object
   259    // then the value will be copied and the |value| reference will not change.
   260    // Otherwise, ownership will be transferred to this object and the |value|
   261    // reference will be invalidated.
   262    ///
   263    int (CEF_CALLBACK *set_dictionary)(struct _cef_dictionary_value_t* self,
   264        const cef_string_t* key, struct _cef_dictionary_value_t* value);
   265  
   266    ///
   267    // Sets the value at the specified key as type list. Returns true (1) if the
   268    // value was set successfully. After calling this function the |value| object
   269    // will no longer be valid. If |value| is currently owned by another object
   270    // then the value will be copied and the |value| reference will not change.
   271    // Otherwise, ownership will be transferred to this object and the |value|
   272    // reference will be invalidated.
   273    ///
   274    int (CEF_CALLBACK *set_list)(struct _cef_dictionary_value_t* self,
   275        const cef_string_t* key, struct _cef_list_value_t* value);
   276  } cef_dictionary_value_t;
   277  
   278  
   279  ///
   280  // Creates a new object that is not owned by any other object.
   281  ///
   282  CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create();
   283  
   284  
   285  ///
   286  // Structure representing a list value. Can be used on any process and thread.
   287  ///
   288  typedef struct _cef_list_value_t {
   289    ///
   290    // Base structure.
   291    ///
   292    cef_base_t base;
   293  
   294    ///
   295    // Returns true (1) if this object is valid. Do not call any other functions
   296    // if this function returns false (0).
   297    ///
   298    int (CEF_CALLBACK *is_valid)(struct _cef_list_value_t* self);
   299  
   300    ///
   301    // Returns true (1) if this object is currently owned by another object.
   302    ///
   303    int (CEF_CALLBACK *is_owned)(struct _cef_list_value_t* self);
   304  
   305    ///
   306    // Returns true (1) if the values of this object are read-only. Some APIs may
   307    // expose read-only objects.
   308    ///
   309    int (CEF_CALLBACK *is_read_only)(struct _cef_list_value_t* self);
   310  
   311    ///
   312    // Returns a writable copy of this object.
   313    ///
   314    struct _cef_list_value_t* (CEF_CALLBACK *copy)(
   315        struct _cef_list_value_t* self);
   316  
   317    ///
   318    // Sets the number of values. If the number of values is expanded all new
   319    // value slots will default to type null. Returns true (1) on success.
   320    ///
   321    int (CEF_CALLBACK *set_size)(struct _cef_list_value_t* self, size_t size);
   322  
   323    ///
   324    // Returns the number of values.
   325    ///
   326    size_t (CEF_CALLBACK *get_size)(struct _cef_list_value_t* self);
   327  
   328    ///
   329    // Removes all values. Returns true (1) on success.
   330    ///
   331    int (CEF_CALLBACK *clear)(struct _cef_list_value_t* self);
   332  
   333    ///
   334    // Removes the value at the specified index.
   335    ///
   336    int (CEF_CALLBACK *remove)(struct _cef_list_value_t* self, int index);
   337  
   338    ///
   339    // Returns the value type at the specified index.
   340    ///
   341    cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_list_value_t* self,
   342        int index);
   343  
   344    ///
   345    // Returns the value at the specified index as type bool.
   346    ///
   347    int (CEF_CALLBACK *get_bool)(struct _cef_list_value_t* self, int index);
   348  
   349    ///
   350    // Returns the value at the specified index as type int.
   351    ///
   352    int (CEF_CALLBACK *get_int)(struct _cef_list_value_t* self, int index);
   353  
   354    ///
   355    // Returns the value at the specified index as type double.
   356    ///
   357    double (CEF_CALLBACK *get_double)(struct _cef_list_value_t* self, int index);
   358  
   359    ///
   360    // Returns the value at the specified index as type string.
   361    ///
   362    // The resulting string must be freed by calling cef_string_userfree_free().
   363    cef_string_userfree_t (CEF_CALLBACK *get_string)(
   364        struct _cef_list_value_t* self, int index);
   365  
   366    ///
   367    // Returns the value at the specified index as type binary.
   368    ///
   369    struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)(
   370        struct _cef_list_value_t* self, int index);
   371  
   372    ///
   373    // Returns the value at the specified index as type dictionary.
   374    ///
   375    struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)(
   376        struct _cef_list_value_t* self, int index);
   377  
   378    ///
   379    // Returns the value at the specified index as type list.
   380    ///
   381    struct _cef_list_value_t* (CEF_CALLBACK *get_list)(
   382        struct _cef_list_value_t* self, int index);
   383  
   384    ///
   385    // Sets the value at the specified index as type null. Returns true (1) if the
   386    // value was set successfully.
   387    ///
   388    int (CEF_CALLBACK *set_null)(struct _cef_list_value_t* self, int index);
   389  
   390    ///
   391    // Sets the value at the specified index as type bool. Returns true (1) if the
   392    // value was set successfully.
   393    ///
   394    int (CEF_CALLBACK *set_bool)(struct _cef_list_value_t* self, int index,
   395        int value);
   396  
   397    ///
   398    // Sets the value at the specified index as type int. Returns true (1) if the
   399    // value was set successfully.
   400    ///
   401    int (CEF_CALLBACK *set_int)(struct _cef_list_value_t* self, int index,
   402        int value);
   403  
   404    ///
   405    // Sets the value at the specified index as type double. Returns true (1) if
   406    // the value was set successfully.
   407    ///
   408    int (CEF_CALLBACK *set_double)(struct _cef_list_value_t* self, int index,
   409        double value);
   410  
   411    ///
   412    // Sets the value at the specified index as type string. Returns true (1) if
   413    // the value was set successfully.
   414    ///
   415    int (CEF_CALLBACK *set_string)(struct _cef_list_value_t* self, int index,
   416        const cef_string_t* value);
   417  
   418    ///
   419    // Sets the value at the specified index as type binary. Returns true (1) if
   420    // the value was set successfully. After calling this function the |value|
   421    // object will no longer be valid. If |value| is currently owned by another
   422    // object then the value will be copied and the |value| reference will not
   423    // change. Otherwise, ownership will be transferred to this object and the
   424    // |value| reference will be invalidated.
   425    ///
   426    int (CEF_CALLBACK *set_binary)(struct _cef_list_value_t* self, int index,
   427        struct _cef_binary_value_t* value);
   428  
   429    ///
   430    // Sets the value at the specified index as type dict. Returns true (1) if the
   431    // value was set successfully. After calling this function the |value| object
   432    // will no longer be valid. If |value| is currently owned by another object
   433    // then the value will be copied and the |value| reference will not change.
   434    // Otherwise, ownership will be transferred to this object and the |value|
   435    // reference will be invalidated.
   436    ///
   437    int (CEF_CALLBACK *set_dictionary)(struct _cef_list_value_t* self, int index,
   438        struct _cef_dictionary_value_t* value);
   439  
   440    ///
   441    // Sets the value at the specified index as type list. Returns true (1) if the
   442    // value was set successfully. After calling this function the |value| object
   443    // will no longer be valid. If |value| is currently owned by another object
   444    // then the value will be copied and the |value| reference will not change.
   445    // Otherwise, ownership will be transferred to this object and the |value|
   446    // reference will be invalidated.
   447    ///
   448    int (CEF_CALLBACK *set_list)(struct _cef_list_value_t* self, int index,
   449        struct _cef_list_value_t* value);
   450  } cef_list_value_t;
   451  
   452  
   453  ///
   454  // Creates a new object that is not owned by any other object.
   455  ///
   456  CEF_EXPORT cef_list_value_t* cef_list_value_create();
   457  
   458  
   459  #ifdef __cplusplus
   460  }
   461  #endif
   462  
   463  #endif  // CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_