summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/fpdfxfa_app.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-09-29 16:52:30 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-29 16:52:30 -0700
commitbec76925d40d28e6c26ca4bb456368ff5f69a607 (patch)
tree40ce9dfa2bcc76939eda75cfa2b072ec181d4633 /fpdfsdk/fpdfxfa/fpdfxfa_app.h
parent74a34fc71ab02400a4c958709138302a1ab4c0e7 (diff)
downloadpdfium-bec76925d40d28e6c26ca4bb456368ff5f69a607.tar.xz
Move fpdfsdk/fpdfxfa/include to fpdfsdk/fpdfxfa
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2381993002
Diffstat (limited to 'fpdfsdk/fpdfxfa/fpdfxfa_app.h')
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_app.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_app.h b/fpdfsdk/fpdfxfa/fpdfxfa_app.h
new file mode 100644
index 0000000000..c8e00cbe0b
--- /dev/null
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_app.h
@@ -0,0 +1,79 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef FPDFSDK_FPDFXFA_FPDFXFA_APP_H_
+#define FPDFSDK_FPDFXFA_FPDFXFA_APP_H_
+
+#include "xfa/fxfa/include/fxfa.h"
+
+class CPDFSDK_Environment;
+class IFXJS_Runtime;
+
+class CPDFXFA_App : public IXFA_AppProvider {
+ public:
+ static CPDFXFA_App* GetInstance();
+ static void ReleaseInstance();
+
+ CPDFXFA_App();
+ ~CPDFXFA_App() override;
+
+ FX_BOOL Initialize(v8::Isolate* pIsolate);
+ CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); }
+
+ FX_BOOL AddFormFillEnv(CPDFSDK_Environment* pEnv);
+ FX_BOOL RemoveFormFillEnv(CPDFSDK_Environment* pEnv);
+
+ FX_BOOL IsJavaScriptInitialized() const { return m_bJavaScriptInitialized; }
+ void SetJavaScriptInitialized(FX_BOOL bInitialized) {
+ m_bJavaScriptInitialized = bInitialized;
+ }
+
+ v8::Isolate* GetJSERuntime() const { return m_pIsolate; }
+
+ // IFXA_AppProvider:
+ void GetAppType(CFX_WideString& wsAppType) override;
+ void SetAppType(const CFX_WideStringC& wsAppType) override;
+
+ void GetLanguage(CFX_WideString& wsLanguage) override;
+ void GetPlatform(CFX_WideString& wsPlatform) override;
+ void GetVariation(CFX_WideString& wsVariation) override;
+ void GetVersion(CFX_WideString& wsVersion) override;
+ void GetAppName(CFX_WideString& wsName) override;
+
+ void Beep(uint32_t dwType) override;
+ int32_t MsgBox(const CFX_WideString& wsMessage,
+ const CFX_WideString& wsTitle,
+ uint32_t dwIconType,
+ uint32_t dwButtonType) override;
+ CFX_WideString Response(const CFX_WideString& wsQuestion,
+ const CFX_WideString& wsTitle,
+ const CFX_WideString& wsDefaultAnswer,
+ FX_BOOL bMark) override;
+
+ IFX_FileRead* DownloadURL(const CFX_WideString& wsURL) override;
+ FX_BOOL PostRequestURL(const CFX_WideString& wsURL,
+ const CFX_WideString& wsData,
+ const CFX_WideString& wsContentType,
+ const CFX_WideString& wsEncode,
+ const CFX_WideString& wsHeader,
+ CFX_WideString& wsResponse) override;
+ FX_BOOL PutRequestURL(const CFX_WideString& wsURL,
+ const CFX_WideString& wsData,
+ const CFX_WideString& wsEncode) override;
+
+ void LoadString(int32_t iStringID, CFX_WideString& wsString) override;
+ IFWL_AdapterTimerMgr* GetTimerMgr() override;
+
+ CFX_ArrayTemplate<CPDFSDK_Environment*> m_pEnvList;
+
+ protected:
+ FX_BOOL m_bJavaScriptInitialized;
+ std::unique_ptr<CXFA_FFApp> m_pXFAApp;
+ v8::Isolate* m_pIsolate;
+ CFX_WideString m_csAppType;
+};
+
+#endif // FPDFSDK_FPDFXFA_FPDFXFA_APP_H_