7#ifndef FXJS_CJS_RESULT_H_
8#define FXJS_CJS_RESULT_H_
12#include "fxjs/js_resources.h"
13#include "v8/include/v8-forward.h"
42 bool HasError()
const {
return error_.has_value(); }
45 bool HasReturn()
const {
return !return_.IsEmpty(); }
50 explicit CJS_Result(v8::Local<v8::Value>);
55 v8::Local<v8::Value> return_;
void Error(const WideString &message)
static uint32_t GetObjDefnID()
static void DefineJSObjects(CFXJS_Engine *pEngine)
void SetSDKAnnot(CPDFSDK_BAAnnot *annot)
CJS_Annot(v8::Local< v8::Object > pObject, CJS_Runtime *pRuntime)
v8::Local< v8::Value > Return() const
static CJS_Result Success()
CJS_Result(const CJS_Result &)
static CJS_Result Failure(JSMessage id)
static CJS_Result Success(v8::Local< v8::Value > value)
const WideString & Error() const
static CJS_Result Failure(const WideString &str)
WideString GetAnnotName() const
void SetAnnotName(const WideString &sName)
CPDF_Annot::Subtype GetAnnotSubtype() const override
void SetFlags(uint32_t nFlags)
uint32_t GetFlags() const
static ByteString AnnotSubtypeToString(Subtype nSubtype)
bool IsExpandedParamKnown(v8::Local< v8::Value > value)
void JSDestructor(v8::Local< v8::Object > obj)
v8::LocalVector< v8::Value > ExpandKeywordParams(CJS_Runtime *pRuntime, pdfium::span< v8::Local< v8::Value > > originals, size_t nKeywords,...)
void JSPropSetter(const char *prop_name_string, const char *class_name_string, v8::Local< v8::Name > property, v8::Local< v8::Value > value, const v8::PropertyCallbackInfo< void > &info)
void JSPropGetter(const char *prop_name_string, const char *class_name_string, v8::Local< v8::Name > property, const v8::PropertyCallbackInfo< v8::Value > &info)
void JSMethod(const char *method_name_string, const char *class_name_string, const v8::FunctionCallbackInfo< v8::Value > &info)
UnownedPtr< C > JSGetObject(v8::Isolate *isolate, v8::Local< v8::Object > obj)
double JS_DateParse(v8::Isolate *pIsolate, const WideString &str)
#define JS_STATIC_PROP(err_name, prop_name, class_name)
static void JSConstructor(CFXJS_Engine *pEngine, v8::Local< v8::Object > obj, v8::Local< v8::Object > proxy)
WideString JSFormatErrorString(const char *class_name, const char *property_name, const WideString &details)
constexpr uint32_t kNoView
constexpr uint32_t kHidden
constexpr uint32_t kPrint
constexpr uint32_t kInvisible
fxcrt::WideString WideString