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_CONTENTMARKITEM_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARKITEM_H_ |
8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARKITEM_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARKITEM_H_ |
9 | 9 |
| 10 #include <memory> |
| 11 |
| 12 #include "core/fxcrt/include/fx_memory.h" |
10 #include "core/fxcrt/include/fx_string.h" | 13 #include "core/fxcrt/include/fx_string.h" |
11 #include "core/fxcrt/include/fx_system.h" | 14 #include "core/fxcrt/include/fx_system.h" |
12 | 15 |
13 class CPDF_Dictionary; | 16 class CPDF_Dictionary; |
14 | 17 |
15 class CPDF_ContentMarkItem { | 18 class CPDF_ContentMarkItem { |
16 public: | 19 public: |
17 enum ParamType { None, PropertiesDict, DirectDict }; | 20 enum ParamType { None, PropertiesDict, DirectDict }; |
18 | 21 |
19 CPDF_ContentMarkItem(); | 22 CPDF_ContentMarkItem(); |
20 CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src); | 23 CPDF_ContentMarkItem(const CPDF_ContentMarkItem& that); |
21 ~CPDF_ContentMarkItem(); | 24 ~CPDF_ContentMarkItem(); |
22 | 25 |
23 const CFX_ByteString& GetName() const { return m_MarkName; } | 26 CPDF_ContentMarkItem& operator=(CPDF_ContentMarkItem&& other) = default; |
| 27 |
| 28 CFX_ByteString GetName() const { return m_MarkName; } |
24 ParamType GetParamType() const { return m_ParamType; } | 29 ParamType GetParamType() const { return m_ParamType; } |
25 CPDF_Dictionary* GetParam() const { return m_pParam; } | 30 CPDF_Dictionary* GetParam() const; |
26 FX_BOOL HasMCID() const; | 31 FX_BOOL HasMCID() const; |
| 32 |
27 void SetName(const CFX_ByteString& name) { m_MarkName = name; } | 33 void SetName(const CFX_ByteString& name) { m_MarkName = name; } |
28 void SetParam(ParamType type, CPDF_Dictionary* param) { | 34 void SetDirectDict( |
29 m_ParamType = type; | 35 std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict); |
30 m_pParam = param; | 36 void SetPropertiesDict(CPDF_Dictionary* pDict); |
31 } | |
32 | 37 |
33 private: | 38 private: |
34 CFX_ByteString m_MarkName; | 39 CFX_ByteString m_MarkName; |
35 ParamType m_ParamType; | 40 ParamType m_ParamType; |
36 CPDF_Dictionary* m_pParam; | 41 CPDF_Dictionary* m_pPropertiesDict; // not owned. |
| 42 std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> |
| 43 m_pDirectDict; |
37 }; | 44 }; |
38 | 45 |
39 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARKITEM_H_ | 46 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARKITEM_H_ |
OLD | NEW |