Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: fpdfsdk/include/javascript/JS_GlobalData.h

Issue 1388023003: Merge to XFA: Make the vast majority of JS headers private to src/javascript. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/javascript/JS_EventHandler.h ('k') | fpdfsdk/include/javascript/JS_Object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/include/javascript/JS_GlobalData.h
diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h
deleted file mode 100644
index 644e0d80fc617ebceda9ef1e45c8865b87468e4b..0000000000000000000000000000000000000000
--- a/fpdfsdk/include/javascript/JS_GlobalData.h
+++ /dev/null
@@ -1,108 +0,0 @@
-// 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_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_
-#define FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_
-
-#include "../../../core/include/fxcrt/fx_basic.h"
-
-#define JS_GLOBALDATA_TYPE_NUMBER 0
-#define JS_GLOBALDATA_TYPE_BOOLEAN 1
-#define JS_GLOBALDATA_TYPE_STRING 2
-#define JS_GLOBALDATA_TYPE_OBJECT 3
-#define JS_GLOBALDATA_TYPE_NULL 4
-
-class CJS_KeyValue;
-class CPDFDoc_Environment;
-
-class CJS_GlobalVariableArray {
- public:
- CJS_GlobalVariableArray();
- virtual ~CJS_GlobalVariableArray();
-
- void Add(CJS_KeyValue* p);
- int Count() const;
- CJS_KeyValue* GetAt(int index) const;
- void Copy(const CJS_GlobalVariableArray& array);
-
- void Empty();
-
- private:
- CFX_ArrayTemplate<CJS_KeyValue*> array;
-};
-
-class CJS_KeyValue {
- public:
- CJS_KeyValue() {}
- virtual ~CJS_KeyValue() {}
-
- CFX_ByteString sKey;
- int nType; // 0:int 1:bool 2:string 3:obj
- double dData;
- bool bData;
- CFX_ByteString sData;
- CJS_GlobalVariableArray objData;
-};
-
-class CJS_GlobalData_Element {
- public:
- CJS_GlobalData_Element() {}
- virtual ~CJS_GlobalData_Element() {}
-
- CJS_KeyValue data;
- FX_BOOL bPersistent;
-};
-
-class CJS_GlobalData {
- public:
- static CJS_GlobalData* GetRetainedInstance(CPDFDoc_Environment* pApp);
- void Release();
-
- void SetGlobalVariableNumber(const FX_CHAR* propname, double dData);
- void SetGlobalVariableBoolean(const FX_CHAR* propname, bool bData);
- void SetGlobalVariableString(const FX_CHAR* propname,
- const CFX_ByteString& sData);
- void SetGlobalVariableObject(const FX_CHAR* propname,
- const CJS_GlobalVariableArray& array);
- void SetGlobalVariableNull(const FX_CHAR* propname);
-
- FX_BOOL SetGlobalVariablePersistent(const FX_CHAR* propname,
- FX_BOOL bPersistent);
- FX_BOOL DeleteGlobalVariable(const FX_CHAR* propname);
-
- int32_t GetSize() const;
- CJS_GlobalData_Element* GetAt(int index) const;
-
- private:
- static CJS_GlobalData* g_Instance;
-
- CJS_GlobalData(CPDFDoc_Environment* pApp);
- ~CJS_GlobalData();
-
- void LoadGlobalPersistentVariables();
- void SaveGlobalPersisitentVariables();
-
- CJS_GlobalData_Element* GetGlobalVariable(const FX_CHAR* propname);
- int FindGlobalVariable(const FX_CHAR* propname);
-
- void LoadFileBuffer(const FX_WCHAR* sFilePath,
- uint8_t*& pBuffer,
- int32_t& nLength);
- void WriteFileBuffer(const FX_WCHAR* sFilePath,
- const FX_CHAR* pBuffer,
- int32_t nLength);
- void MakeByteString(const CFX_ByteString& name,
- CJS_KeyValue* pData,
- CFX_BinaryBuf& sData);
-
- private:
- size_t m_RefCount;
- CFX_ArrayTemplate<CJS_GlobalData_Element*> m_arrayGlobalData;
- CFX_WideString m_sFilePath;
- CPDFDoc_Environment* m_pApp;
-};
-
-#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_
« no previous file with comments | « fpdfsdk/include/javascript/JS_EventHandler.h ('k') | fpdfsdk/include/javascript/JS_Object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698