summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/doc_utils.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-14 13:35:12 -0400
committerDan Sinclair <dsinclair@chromium.org>2016-03-14 13:35:12 -0400
commit764ec513eecbebd12781bcc96ce81ed5e736ee92 (patch)
tree12763fde4be1f10ea1183d92185917b2b587e00b /core/fpdfdoc/doc_utils.h
parent97da97662417085774f75c26e535c6fbe70266ae (diff)
downloadpdfium-764ec513eecbebd12781bcc96ce81ed5e736ee92.tar.xz
Move core/src/ up to core/.
This CL moves the core/src/ files up to core/ and fixes up the include guards, includes and build files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1800523005 .
Diffstat (limited to 'core/fpdfdoc/doc_utils.h')
-rw-r--r--core/fpdfdoc/doc_utils.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/core/fpdfdoc/doc_utils.h b/core/fpdfdoc/doc_utils.h
new file mode 100644
index 0000000000..ed687943da
--- /dev/null
+++ b/core/fpdfdoc/doc_utils.h
@@ -0,0 +1,80 @@
+// Copyright 2015 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 CORE_FPDFDOC_DOC_UTILS_H_
+#define CORE_FPDFDOC_DOC_UTILS_H_
+
+#include <vector>
+
+#include "core/include/fpdfapi/cpdf_parser.h"
+#include "core/include/fpdfapi/fpdf_resource.h"
+
+class CPDF_Dictionary;
+class CPDF_FormField;
+
+class CPDF_NumberTree {
+ public:
+ CPDF_NumberTree(CPDF_Dictionary* pRoot) : m_pRoot(pRoot) {}
+ CPDF_Object* LookupValue(int num) const;
+
+ protected:
+ CPDF_Dictionary* const m_pRoot;
+};
+
+CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
+void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument);
+FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict,
+ CPDF_Document* pDocument,
+ FX_DWORD index,
+ CFX_ByteString& csNameTag);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict,
+ CPDF_Document* pDocument,
+ CFX_ByteString csNameTag);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict,
+ CPDF_Document* pDocument,
+ CFX_ByteString csFontName,
+ CFX_ByteString& csNameTag);
+CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict,
+ CPDF_Document* pDocument,
+ uint8_t charSet,
+ CFX_ByteString& csNameTag);
+CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict,
+ CPDF_Document* pDocument,
+ CFX_ByteString& csNameTag);
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict,
+ const CPDF_Font* pFont,
+ CFX_ByteString& csNameTag);
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict,
+ CPDF_Document* pDocument,
+ CFX_ByteString csFontName,
+ CPDF_Font*& pFont,
+ CFX_ByteString& csNameTag);
+void AddInterFormFont(CPDF_Dictionary*& pFormDict,
+ CPDF_Document* pDocument,
+ const CPDF_Font* pFont,
+ CFX_ByteString& csNameTag);
+CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict,
+ CPDF_Document* pDocument,
+ uint8_t charSet,
+ CFX_ByteString& csNameTag);
+CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict,
+ CPDF_Document* pDocument,
+ CFX_ByteString& csNameTag);
+void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont);
+void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag);
+CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict,
+ CPDF_Document* pDocument);
+void SetDefaultInterFormFont(CPDF_Dictionary*& pFormDict,
+ CPDF_Document* pDocument,
+ const CPDF_Font* pFont);
+std::vector<bool> SaveCheckedFieldStatus(CPDF_FormField* pField);
+FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName);
+FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0);
+void EncodeFieldName(const CFX_WideString& csName, CFX_ByteString& csT);
+void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int nLevel = 0);
+
+#endif // CORE_FPDFDOC_DOC_UTILS_H_