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

Side by Side Diff: fpdfsdk/include/cpdfsdk_baannot.h

Issue 2236743002: Move CPDFSDK_Annot, CPDFSDK_BAAnnot and CPDFSDK_DateTime to their own files. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Move CPDFSDK_Annot, CPDFSDK_BAAnnot and CPDFSDK_DateTime to their own files. Created 4 years, 4 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 | « fpdfsdk/include/cpdfsdk_annot.h ('k') | fpdfsdk/include/cpdfsdk_datetime.h » ('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 FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ 7 #ifndef FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_
8 #define FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ 8 #define FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_
9
10 #if _FX_OS_ == _FX_ANDROID_
11 #include "time.h"
12 #else
13 #include <ctime>
14 #endif
15 9
16 #include "core/fpdfdoc/include/cpdf_aaction.h" 10 #include "core/fpdfdoc/include/cpdf_aaction.h"
11 #include "core/fpdfdoc/include/cpdf_action.h"
17 #include "core/fpdfdoc/include/cpdf_annot.h" 12 #include "core/fpdfdoc/include/cpdf_annot.h"
18 #include "core/fpdfdoc/include/cpdf_defaultappearance.h" 13 #include "core/fpdfdoc/include/cpdf_defaultappearance.h"
19 #include "core/fxcrt/include/fx_basic.h" 14 #include "core/fxcrt/include/fx_coordinates.h"
15 #include "core/fxcrt/include/fx_string.h"
20 #include "fpdfsdk/cfx_systemhandler.h" 16 #include "fpdfsdk/cfx_systemhandler.h"
21 #include "fpdfsdk/include/fsdk_common.h" 17 #include "fpdfsdk/include/cpdfsdk_annot.h"
22 #include "fpdfsdk/include/fsdk_define.h"
23 18
19 class CFX_Matrix;
20 class CFX_RenderDevice;
21 class CPDF_Dictionary;
22 class CPDF_RenderOptions;
24 class CPDFSDK_PageView; 23 class CPDFSDK_PageView;
25 class CPDF_Page;
26 class CFX_Matrix;
27 class CPDF_RenderOptions;
28 class CFX_RenderDevice;
29
30 class CPDFSDK_DateTime {
31 public:
32 CPDFSDK_DateTime();
33 explicit CPDFSDK_DateTime(const CFX_ByteString& dtStr);
34 explicit CPDFSDK_DateTime(const FX_SYSTEMTIME& st);
35 CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime);
36
37 CPDFSDK_DateTime& operator=(const CPDFSDK_DateTime& datetime);
38 CPDFSDK_DateTime& operator=(const FX_SYSTEMTIME& st);
39 bool operator==(const CPDFSDK_DateTime& datetime) const;
40 bool operator!=(const CPDFSDK_DateTime& datetime) const;
41
42 CPDFSDK_DateTime& FromPDFDateTimeString(const CFX_ByteString& dtStr);
43 CFX_ByteString ToCommonDateTimeString();
44 CFX_ByteString ToPDFDateTimeString();
45 void ToSystemTime(FX_SYSTEMTIME& st);
46 time_t ToTime_t() const;
47 CPDFSDK_DateTime ToGMT() const;
48 CPDFSDK_DateTime& AddDays(short days);
49 CPDFSDK_DateTime& AddSeconds(int seconds);
50
51 void ResetDateTime();
52
53 struct FX_DATETIME {
54 int16_t year;
55 uint8_t month;
56 uint8_t day;
57 uint8_t hour;
58 uint8_t minute;
59 uint8_t second;
60 int8_t tzHour;
61 uint8_t tzMinute;
62 } dt;
63 };
64
65 class CPDFSDK_Annot {
66 public:
67 explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView);
68 virtual ~CPDFSDK_Annot();
69
70 #ifdef PDF_ENABLE_XFA
71 virtual FX_BOOL IsXFAField();
72 virtual CXFA_FFWidget* GetXFAWidget() const;
73 #endif // PDF_ENABLE_XFA
74
75 virtual FX_FLOAT GetMinWidth() const;
76 virtual FX_FLOAT GetMinHeight() const;
77 // define layout order to 5.
78 virtual int GetLayoutOrder() const;
79 virtual CPDF_Annot* GetPDFAnnot() const;
80 virtual CFX_ByteString GetType() const;
81 virtual CFX_ByteString GetSubType() const;
82 virtual CFX_FloatRect GetRect() const;
83
84 virtual void SetRect(const CFX_FloatRect& rect);
85 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice,
86 CFX_Matrix* pUser2Device,
87 CPDF_RenderOptions* pOptions);
88
89 UnderlyingPageType* GetUnderlyingPage();
90 CPDF_Page* GetPDFPage();
91 #ifdef PDF_ENABLE_XFA
92 CPDFXFA_Page* GetPDFXFAPage();
93 #endif // PDF_ENABLE_XFA
94
95 void SetPage(CPDFSDK_PageView* pPageView);
96 CPDFSDK_PageView* GetPageView() const { return m_pPageView; }
97
98 // Tab Order
99 int GetTabOrder();
100 void SetTabOrder(int iTabOrder);
101
102 // Selection
103 FX_BOOL IsSelected();
104 void SetSelected(FX_BOOL bSelected);
105
106 protected:
107 CPDFSDK_PageView* m_pPageView;
108 FX_BOOL m_bSelected;
109 int m_nTabOrder;
110 };
111 24
112 class CPDFSDK_BAAnnot : public CPDFSDK_Annot { 25 class CPDFSDK_BAAnnot : public CPDFSDK_Annot {
113 public: 26 public:
114 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); 27 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView);
115 ~CPDFSDK_BAAnnot() override; 28 ~CPDFSDK_BAAnnot() override;
116 29
117 // CPDFSDK_Annot 30 // CPDFSDK_Annot
118 CFX_ByteString GetType() const override; 31 CFX_ByteString GetType() const override;
119 CFX_ByteString GetSubType() const override; 32 CFX_ByteString GetSubType() const override;
120 void SetRect(const CFX_FloatRect& rect) override; 33 void SetRect(const CFX_FloatRect& rect) override;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 void WriteAppearance(const CFX_ByteString& sAPType, 94 void WriteAppearance(const CFX_ByteString& sAPType,
182 const CFX_FloatRect& rcBBox, 95 const CFX_FloatRect& rcBBox,
183 const CFX_Matrix& matrix, 96 const CFX_Matrix& matrix,
184 const CFX_ByteString& sContents, 97 const CFX_ByteString& sContents,
185 const CFX_ByteString& sAPState = ""); 98 const CFX_ByteString& sAPState = "");
186 99
187 protected: 100 protected:
188 CPDF_Annot* m_pAnnot; 101 CPDF_Annot* m_pAnnot;
189 }; 102 };
190 103
191 #endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ 104 #endif // FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_
OLDNEW
« no previous file with comments | « fpdfsdk/include/cpdfsdk_annot.h ('k') | fpdfsdk/include/cpdfsdk_datetime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698