| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARK_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARK_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARK_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARK_H_ |
| 9 | 9 |
| 10 #include "core/fpdfapi/fpdf_page/cpdf_contentmarkdata.h" | 10 #include <vector> |
| 11 |
| 12 #include "core/fpdfapi/fpdf_page/cpdf_contentmarkitem.h" |
| 11 #include "core/fxcrt/include/cfx_count_ref.h" | 13 #include "core/fxcrt/include/cfx_count_ref.h" |
| 12 #include "core/fxcrt/include/fx_basic.h" | 14 #include "core/fxcrt/include/fx_basic.h" |
| 15 #include "core/fxcrt/include/fx_system.h" |
| 16 |
| 17 class CPDF_Dictionary; |
| 13 | 18 |
| 14 class CPDF_ContentMark { | 19 class CPDF_ContentMark { |
| 15 public: | 20 public: |
| 16 CPDF_ContentMark(); | 21 CPDF_ContentMark(); |
| 17 CPDF_ContentMark(const CPDF_ContentMark& that); | 22 CPDF_ContentMark(const CPDF_ContentMark& that); |
| 18 ~CPDF_ContentMark(); | 23 ~CPDF_ContentMark(); |
| 19 | 24 |
| 20 void SetNull(); | 25 void SetNull(); |
| 21 | 26 |
| 22 int GetMCID() const; | 27 int GetMCID() const; |
| 23 int CountItems() const; | 28 int CountItems() const; |
| 24 const CPDF_ContentMarkItem& GetItem(int i) const; | 29 const CPDF_ContentMarkItem& GetItem(int i) const; |
| 25 | 30 |
| 26 bool HasMark(const CFX_ByteStringC& mark) const; | 31 bool HasMark(const CFX_ByteStringC& mark) const; |
| 27 bool LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const; | 32 bool LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const; |
| 28 void AddMark(const CFX_ByteString& name, | 33 void AddMark(const CFX_ByteString& name, |
| 29 CPDF_Dictionary* pDict, | 34 CPDF_Dictionary* pDict, |
| 30 FX_BOOL bDirect); | 35 FX_BOOL bDirect); |
| 31 void DeleteLastMark(); | 36 void DeleteLastMark(); |
| 32 | 37 |
| 33 explicit operator bool() const { return !!m_Ref; } | 38 explicit operator bool() const { return !!m_Ref; } |
| 34 | 39 |
| 35 private: | 40 private: |
| 36 CFX_CountRef<CPDF_ContentMarkData> m_Ref; | 41 class MarkData { |
| 42 public: |
| 43 MarkData(); |
| 44 MarkData(const MarkData& src); |
| 45 ~MarkData(); |
| 46 |
| 47 int CountItems() const; |
| 48 CPDF_ContentMarkItem& GetItem(int index); |
| 49 const CPDF_ContentMarkItem& GetItem(int index) const; |
| 50 |
| 51 int GetMCID() const; |
| 52 void AddMark(const CFX_ByteString& name, |
| 53 CPDF_Dictionary* pDict, |
| 54 FX_BOOL bDictNeedClone); |
| 55 void DeleteLastMark(); |
| 56 |
| 57 private: |
| 58 std::vector<CPDF_ContentMarkItem> m_Marks; |
| 59 }; |
| 60 |
| 61 CFX_CountRef<MarkData> m_Ref; |
| 37 }; | 62 }; |
| 38 | 63 |
| 39 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARK_H_ | 64 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARK_H_ |
| OLD | NEW |