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

Side by Side Diff: core/fpdfdoc/include/fpdf_doc.h

Issue 2006483002: Clean up doc_ocg.cpp. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nit Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « core/fpdfdoc/doc_ocg.cpp ('k') | fpdfsdk/fpdfformfill.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 7 #ifndef CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
8 #define CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 8 #define CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <unordered_map>
12 #include <vector> 13 #include <vector>
13 14
14 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 15 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
15 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" 16 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h"
16 #include "core/fxge/include/fx_dib.h" 17 #include "core/fxge/include/fx_dib.h"
17 18
18 class CFDF_Document; 19 class CFDF_Document;
19 class CFieldTree; 20 class CFieldTree;
20 class CPDF_AAction; 21 class CPDF_AAction;
21 class CPDF_Action; 22 class CPDF_Action;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 FX_FLOAT GetParam(int index); 118 FX_FLOAT GetParam(int index);
118 119
119 protected: 120 protected:
120 CPDF_Object* m_pObj; 121 CPDF_Object* m_pObj;
121 }; 122 };
122 123
123 class CPDF_OCContext { 124 class CPDF_OCContext {
124 public: 125 public:
125 enum UsageType { View = 0, Design, Print, Export }; 126 enum UsageType { View = 0, Design, Print, Export };
126 127
127 explicit CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View); 128 CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType);
128 ~CPDF_OCContext(); 129 ~CPDF_OCContext();
129 130
130 FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict); 131 bool CheckOCGVisible(const CPDF_Dictionary* pOCGDict);
131 FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj); 132 bool CheckObjectVisible(const CPDF_PageObject* pObj);
132
133 CPDF_Document* GetDocument() const { return m_pDocument; }
134 UsageType GetUsageType() const { return m_eUsageType; }
135
136 void ResetOCContext();
137 133
138 protected: 134 protected:
139 FX_BOOL LoadOCGStateFromConfig(const CFX_ByteString& csConfig, 135 bool LoadOCGStateFromConfig(const CFX_ByteString& csConfig,
140 const CPDF_Dictionary* pOCGDict, 136 const CPDF_Dictionary* pOCGDict) const;
141 FX_BOOL& bValidConfig) const; 137 bool LoadOCGState(const CPDF_Dictionary* pOCGDict) const;
142 FX_BOOL LoadOCGState(const CPDF_Dictionary* pOCGDict) const; 138 bool GetOCGVisible(const CPDF_Dictionary* pOCGDict);
143 FX_BOOL GetOCGVisible(const CPDF_Dictionary* pOCGDict); 139 bool GetOCGVE(CPDF_Array* pExpression, int nLevel);
144 FX_BOOL GetOCGVE(CPDF_Array* pExpression, 140 bool LoadOCMDState(const CPDF_Dictionary* pOCMDDict);
145 FX_BOOL bFromConfig,
146 int nLevel = 0);
147 FX_BOOL LoadOCMDState(const CPDF_Dictionary* pOCMDDict, FX_BOOL bFromConfig);
148 141
149 CPDF_Document* m_pDocument; 142 CPDF_Document* const m_pDocument;
150 UsageType m_eUsageType; 143 const UsageType m_eUsageType;
151 std::map<const CPDF_Dictionary*, FX_BOOL> m_OCGStates; 144 std::unordered_map<const CPDF_Dictionary*, bool> m_OCGStates;
152 }; 145 };
153 146
154 class CPDF_ActionFields { 147 class CPDF_ActionFields {
155 public: 148 public:
156 explicit CPDF_ActionFields(const CPDF_Action* pAction) : m_pAction(pAction) {} 149 explicit CPDF_ActionFields(const CPDF_Action* pAction) : m_pAction(pAction) {}
157 150
158 size_t GetFieldsCount() const; 151 size_t GetFieldsCount() const;
159 std::vector<CPDF_Object*> GetAllFields() const; 152 std::vector<CPDF_Object*> GetAllFields() const;
160 CPDF_Object* GetField(size_t iIndex) const; 153 CPDF_Object* GetField(size_t iIndex) const;
161 154
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 FX_FLOAT fc[4], 1010 FX_FLOAT fc[4],
1018 const CFX_ByteString& csEntry) const; 1011 const CFX_ByteString& csEntry) const;
1019 1012
1020 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const; 1013 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const;
1021 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const; 1014 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const;
1022 1015
1023 CPDF_Dictionary* const m_pDict; 1016 CPDF_Dictionary* const m_pDict;
1024 }; 1017 };
1025 1018
1026 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 1019 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
OLDNEW
« no previous file with comments | « core/fpdfdoc/doc_ocg.cpp ('k') | fpdfsdk/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698