1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that 3 // can be found in the LICENSE file. 4 // 5 // --------------------------------------------------------------------------- 6 // 7 // This file was generated by the CEF translator tool. If making changes by 8 // hand only do so within the body of existing method and function 9 // implementations. See the translator.README.txt file in the tools directory 10 // for more information. 11 // 12 // $hash=c9725eb41d50cd0bdbe6f84280e0ed7b62012136$ 13 // 14 15 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ 16 #define CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ 17 #pragma once 18 19 #if !defined(WRAPPING_CEF_SHARED) 20 #error This file can be included wrapper-side only 21 #endif 22 23 #include <vector> 24 #include "include/capi/cef_v8_capi.h" 25 #include "include/cef_v8.h" 26 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" 27 28 // Wrap a C structure with a C++ class. 29 // This class may be instantiated and accessed wrapper-side only. 30 class CefV8ValueCToCpp 31 : public CefCToCppRefCounted<CefV8ValueCToCpp, CefV8Value, cef_v8value_t> { 32 public: 33 CefV8ValueCToCpp(); 34 virtual ~CefV8ValueCToCpp(); 35 36 // CefV8Value methods. 37 bool IsValid() override; 38 bool IsUndefined() override; 39 bool IsNull() override; 40 bool IsBool() override; 41 bool IsInt() override; 42 bool IsUInt() override; 43 bool IsDouble() override; 44 bool IsDate() override; 45 bool IsString() override; 46 bool IsObject() override; 47 bool IsArray() override; 48 bool IsArrayBuffer() override; 49 bool IsFunction() override; 50 bool IsSame(CefRefPtr<CefV8Value> that) override; 51 bool GetBoolValue() override; 52 int32 GetIntValue() override; 53 uint32 GetUIntValue() override; 54 double GetDoubleValue() override; 55 CefTime GetDateValue() override; 56 CefString GetStringValue() override; 57 bool IsUserCreated() override; 58 bool HasException() override; 59 CefRefPtr<CefV8Exception> GetException() override; 60 bool ClearException() override; 61 bool WillRethrowExceptions() override; 62 bool SetRethrowExceptions(bool rethrow) override; 63 bool HasValue(const CefString& key) override; 64 bool HasValue(int index) override; 65 bool DeleteValue(const CefString& key) override; 66 bool DeleteValue(int index) override; 67 CefRefPtr<CefV8Value> GetValue(const CefString& key) override; 68 CefRefPtr<CefV8Value> GetValue(int index) override; 69 bool SetValue(const CefString& key, 70 CefRefPtr<CefV8Value> value, 71 PropertyAttribute attribute) override; 72 bool SetValue(int index, CefRefPtr<CefV8Value> value) override; 73 bool SetValue(const CefString& key, 74 AccessControl settings, 75 PropertyAttribute attribute) override; 76 bool GetKeys(std::vector<CefString>& keys) override; 77 bool SetUserData(CefRefPtr<CefBaseRefCounted> user_data) override; 78 CefRefPtr<CefBaseRefCounted> GetUserData() override; 79 int GetExternallyAllocatedMemory() override; 80 int AdjustExternallyAllocatedMemory(int change_in_bytes) override; 81 int GetArrayLength() override; 82 CefRefPtr<CefV8ArrayBufferReleaseCallback> GetArrayBufferReleaseCallback() 83 override; 84 bool NeuterArrayBuffer() override; 85 CefString GetFunctionName() override; 86 CefRefPtr<CefV8Handler> GetFunctionHandler() override; 87 CefRefPtr<CefV8Value> ExecuteFunction( 88 CefRefPtr<CefV8Value> object, 89 const CefV8ValueList& arguments) override; 90 CefRefPtr<CefV8Value> ExecuteFunctionWithContext( 91 CefRefPtr<CefV8Context> context, 92 CefRefPtr<CefV8Value> object, 93 const CefV8ValueList& arguments) override; 94 }; 95 96 #endif // CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ 97