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 FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ | 7 #ifndef FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ |
8 #define FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ | 8 #define FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 17 matching lines...) Expand all Loading... |
28 class CPDFSDK_InterForm; | 28 class CPDFSDK_InterForm; |
29 class CPDFSDK_PageView; | 29 class CPDFSDK_PageView; |
30 | 30 |
31 #ifdef PDF_ENABLE_XFA | 31 #ifdef PDF_ENABLE_XFA |
32 class CXFA_FFWidget; | 32 class CXFA_FFWidget; |
33 class CXFA_FFWidgetHandler; | 33 class CXFA_FFWidgetHandler; |
34 #endif // PDF_ENABLE_XFA | 34 #endif // PDF_ENABLE_XFA |
35 | 35 |
36 class CPDFSDK_Widget : public CPDFSDK_BAAnnot { | 36 class CPDFSDK_Widget : public CPDFSDK_BAAnnot { |
37 public: | 37 public: |
38 class Observer { | 38 class Observer : public CPDFSDK_Annot::Observer { |
39 public: | 39 public: |
40 explicit Observer(CPDFSDK_Widget** pWatchedPtr); | 40 explicit Observer(CPDFSDK_Widget** pWatchedPtr); |
41 ~Observer(); | 41 ~Observer() override; |
42 | 42 |
43 void OnWidgetDestroyed(); | 43 void OnAnnotDestroyed() override; |
44 | 44 |
45 private: | 45 private: |
46 CPDFSDK_Widget** m_pWatchedPtr; | 46 CPDFSDK_Widget** m_pWatchedPtr; |
47 }; | 47 }; |
48 | 48 |
49 #ifdef PDF_ENABLE_XFA | 49 #ifdef PDF_ENABLE_XFA |
50 CXFA_FFWidget* GetMixXFAWidget() const; | 50 CXFA_FFWidget* GetMixXFAWidget() const; |
51 CXFA_FFWidget* GetGroupMixXFAWidget(); | 51 CXFA_FFWidget* GetGroupMixXFAWidget(); |
52 CXFA_FFWidgetHandler* GetXFAWidgetHandler() const; | 52 CXFA_FFWidgetHandler* GetXFAWidgetHandler() const; |
53 | 53 |
(...skipping 14 matching lines...) Expand all Loading... |
68 CXFA_FFWidget* hWidget, | 68 CXFA_FFWidget* hWidget, |
69 CPDF_FormField* pFormField, | 69 CPDF_FormField* pFormField, |
70 CPDF_FormControl* pFormControl); | 70 CPDF_FormControl* pFormControl); |
71 #endif // PDF_ENABLE_XFA | 71 #endif // PDF_ENABLE_XFA |
72 | 72 |
73 CPDFSDK_Widget(CPDF_Annot* pAnnot, | 73 CPDFSDK_Widget(CPDF_Annot* pAnnot, |
74 CPDFSDK_PageView* pPageView, | 74 CPDFSDK_PageView* pPageView, |
75 CPDFSDK_InterForm* pInterForm); | 75 CPDFSDK_InterForm* pInterForm); |
76 ~CPDFSDK_Widget() override; | 76 ~CPDFSDK_Widget() override; |
77 | 77 |
78 void AddObserver(Observer* observer); | |
79 void RemoveObserver(Observer* observer); | |
80 | |
81 bool IsSignatureWidget() const override; | 78 bool IsSignatureWidget() const override; |
82 CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; | 79 CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; |
83 FX_BOOL IsAppearanceValid() override; | 80 FX_BOOL IsAppearanceValid() override; |
84 | 81 |
85 int GetLayoutOrder() const override; | 82 int GetLayoutOrder() const override; |
86 | 83 |
87 int GetFieldType() const; | 84 int GetFieldType() const; |
88 int GetFieldFlags() const; | 85 int GetFieldFlags() const; |
89 int GetRotate() const; | 86 int GetRotate() const; |
90 | 87 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 CPWL_Color GetBorderPWLColor() const; | 170 CPWL_Color GetBorderPWLColor() const; |
174 CPWL_Color GetFillPWLColor() const; | 171 CPWL_Color GetFillPWLColor() const; |
175 | 172 |
176 void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage); | 173 void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage); |
177 void RemoveAppearance(const CFX_ByteString& sAPType); | 174 void RemoveAppearance(const CFX_ByteString& sAPType); |
178 | 175 |
179 CPDFSDK_InterForm* const m_pInterForm; | 176 CPDFSDK_InterForm* const m_pInterForm; |
180 FX_BOOL m_bAppModified; | 177 FX_BOOL m_bAppModified; |
181 int32_t m_nAppAge; | 178 int32_t m_nAppAge; |
182 int32_t m_nValueAge; | 179 int32_t m_nValueAge; |
183 std::set<Observer*> m_Observers; | |
184 | 180 |
185 #ifdef PDF_ENABLE_XFA | 181 #ifdef PDF_ENABLE_XFA |
186 mutable CXFA_FFWidget* m_hMixXFAWidget; | 182 mutable CXFA_FFWidget* m_hMixXFAWidget; |
187 mutable CXFA_FFWidgetHandler* m_pWidgetHandler; | 183 mutable CXFA_FFWidgetHandler* m_pWidgetHandler; |
188 #endif // PDF_ENABLE_XFA | 184 #endif // PDF_ENABLE_XFA |
189 }; | 185 }; |
190 | 186 |
191 #endif // FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ | 187 #endif // FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ |
OLD | NEW |