7#ifndef FXJS_CJS_RESULT_H_
8#define FXJS_CJS_RESULT_H_
10#include "fxjs/js_resources.h"
11#include "third_party/abseil-cpp/absl/types/optional.h"
12#include "v8/include/v8-forward.h"
41 bool HasError()
const {
return error_.has_value(); }
42 const WideString&
Error()
const {
return error_.value(); }
44 bool HasReturn()
const {
return !return_.IsEmpty(); }
49 explicit CJS_Result(v8::Local<v8::Value>);
50 explicit CJS_Result(
const WideString&);
53 absl::optional<WideString> error_;
54 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)
static void DefineProps(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSPropertySpec > consts)
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 JSPropGetter(const char *prop_name_string, const char *class_name_string, v8::Local< v8::String > property, const v8::PropertyCallbackInfo< v8::Value > &info)
void JSPropSetter(const char *prop_name_string, const char *class_name_string, v8::Local< v8::String > property, v8::Local< v8::Value > value, const v8::PropertyCallbackInfo< void > &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