Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cjx_signaturepseudomodel.cpp
Go to the documentation of this file.
1// Copyright 2017 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "fxjs/xfa/cjx_signaturepseudomodel.h"
8
9#include <vector>
10
11#include "fxjs/js_resources.h"
12#include "fxjs/xfa/cfxjse_engine.h"
13#include "fxjs/xfa/cfxjse_value.h"
14#include "third_party/base/containers/span.h"
15#include "v8/include/v8-primitive.h"
16#include "xfa/fxfa/parser/cscript_signaturepseudomodel.h"
17
18const CJX_MethodSpec CJX_SignaturePseudoModel::MethodSpecs[] = {
19 {"verify", verifySignature_static},
20 {"sign", sign_static},
21 {"enumerate", enumerate_static},
22 {"clear", clear_static}};
23
24CJX_SignaturePseudoModel::CJX_SignaturePseudoModel(
25 CScript_SignaturePseudoModel* model)
26 : CJX_Object(model) {
27 DefineMethods(MethodSpecs);
28}
29
30CJX_SignaturePseudoModel::~CJX_SignaturePseudoModel() = default;
31
32bool CJX_SignaturePseudoModel::DynamicTypeIs(TypeTag eType) const {
33 return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
34}
35
36CJS_Result CJX_SignaturePseudoModel::verifySignature(
37 CFXJSE_Engine* runtime,
38 pdfium::span<v8::Local<v8::Value>> params) {
39 if (params.empty() || params.size() > 4)
41
42 return CJS_Result::Success(runtime->NewNumber(0));
43}
44
45CJS_Result CJX_SignaturePseudoModel::sign(
46 CFXJSE_Engine* runtime,
47 pdfium::span<v8::Local<v8::Value>> params) {
48 if (params.size() < 3 || params.size() > 7)
50
51 return CJS_Result::Success(runtime->NewBoolean(false));
52}
53
54CJS_Result CJX_SignaturePseudoModel::enumerate(
55 CFXJSE_Engine* runtime,
56 pdfium::span<v8::Local<v8::Value>> params) {
57 if (!params.empty())
59
61}
62
63CJS_Result CJX_SignaturePseudoModel::clear(
64 CFXJSE_Engine* runtime,
65 pdfium::span<v8::Local<v8::Value>> params) {
66 if (params.empty() || params.size() > 2)
68
69 return CJS_Result::Success(runtime->NewBoolean(false));
70}
friend class EventParamScope
static CJS_Result Success()
Definition cjs_result.h:27
static CJS_Result Failure(JSMessage id)
Definition cjs_result.h:34
void DefineMethods(pdfium::span< const CJX_MethodSpec > methods)
virtual bool DynamicTypeIs(TypeTag eType) const
~CJX_SignaturePseudoModel() override
bool DynamicTypeIs(TypeTag eType) const override
JSMessage