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_logpseudomodel.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_logpseudomodel.h"
8
9#include <vector>
10
11#include "fxjs/xfa/cfxjse_value.h"
12#include "third_party/base/containers/span.h"
13#include "xfa/fxfa/parser/cscript_logpseudomodel.h"
14
15const CJX_MethodSpec CJX_LogPseudoModel::MethodSpecs[] = {
16 {"message", message_static},
17 {"traceEnabled", traceEnabled_static},
18 {"traceActivate", traceActivate_static},
19 {"traceDeactivate", traceDeactivate_static},
20 {"trace", trace_static}};
21
22CJX_LogPseudoModel::CJX_LogPseudoModel(CScript_LogPseudoModel* model)
23 : CJX_Object(model) {
24 DefineMethods(MethodSpecs);
25}
26
27CJX_LogPseudoModel::~CJX_LogPseudoModel() = default;
28
29bool CJX_LogPseudoModel::DynamicTypeIs(TypeTag eType) const {
30 return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
31}
32
33CJS_Result CJX_LogPseudoModel::message(
34 CFXJSE_Engine* runtime,
35 pdfium::span<v8::Local<v8::Value>> params) {
36 // Uncomment to allow using xfa.log.message(""); from JS.
37 // fprintf(stderr, "LOG\n");
38 // for (auto& val : params) {
39 // v8::String::Utf8Value str(runtime->GetIsolate(), val);
40 // fprintf(stderr, " %ls\n", WideString::FromUTF8(*str).c_str());
41 // }
42
44}
45
46CJS_Result CJX_LogPseudoModel::traceEnabled(
47 CFXJSE_Engine* runtime,
48 pdfium::span<v8::Local<v8::Value>> params) {
50}
51
52CJS_Result CJX_LogPseudoModel::traceActivate(
53 CFXJSE_Engine* runtime,
54 pdfium::span<v8::Local<v8::Value>> params) {
56}
57
58CJS_Result CJX_LogPseudoModel::traceDeactivate(
59 CFXJSE_Engine* runtime,
60 pdfium::span<v8::Local<v8::Value>> params) {
62}
63
64CJS_Result CJX_LogPseudoModel::trace(
65 CFXJSE_Engine* runtime,
66 pdfium::span<v8::Local<v8::Value>> params) {
68}
friend class EventParamScope
static CJS_Result Success()
Definition cjs_result.h:27
bool DynamicTypeIs(TypeTag eType) const override
~CJX_LogPseudoModel() override
void DefineMethods(pdfium::span< const CJX_MethodSpec > methods)
virtual bool DynamicTypeIs(TypeTag eType) const