| 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 { | |
| 39 public: | |
| 40 explicit Observer(CPDFSDK_Widget** pWatchedPtr); | |
| 41 ~Observer(); | |
| 42 | |
| 43 void OnWidgetDestroyed(); | |
| 44 | |
| 45 private: | |
| 46 CPDFSDK_Widget** m_pWatchedPtr; | |
| 47 }; | |
| 48 | |
| 49 #ifdef PDF_ENABLE_XFA | 38 #ifdef PDF_ENABLE_XFA |
| 50 CXFA_FFWidget* GetMixXFAWidget() const; | 39 CXFA_FFWidget* GetMixXFAWidget() const; |
| 51 CXFA_FFWidget* GetGroupMixXFAWidget(); | 40 CXFA_FFWidget* GetGroupMixXFAWidget(); |
| 52 CXFA_FFWidgetHandler* GetXFAWidgetHandler() const; | 41 CXFA_FFWidgetHandler* GetXFAWidgetHandler() const; |
| 53 | 42 |
| 54 FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT); | 43 FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT); |
| 55 FX_BOOL OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, | 44 FX_BOOL OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, |
| 56 PDFSDK_FieldAction& data, | 45 PDFSDK_FieldAction& data, |
| 57 CPDFSDK_PageView* pPageView); | 46 CPDFSDK_PageView* pPageView); |
| 58 | 47 |
| 59 void Synchronize(FX_BOOL bSynchronizeElse); | 48 void Synchronize(FX_BOOL bSynchronizeElse); |
| 60 void SynchronizeXFAValue(); | 49 void SynchronizeXFAValue(); |
| 61 void SynchronizeXFAItems(); | 50 void SynchronizeXFAItems(); |
| 62 | 51 |
| 63 static void SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, | 52 static void SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, |
| 64 CXFA_FFWidget* hWidget, | 53 CXFA_FFWidget* hWidget, |
| 65 CPDF_FormField* pFormField, | 54 CPDF_FormField* pFormField, |
| 66 CPDF_FormControl* pFormControl); | 55 CPDF_FormControl* pFormControl); |
| 67 static void SynchronizeXFAItems(CXFA_FFDocView* pXFADocView, | 56 static void SynchronizeXFAItems(CXFA_FFDocView* pXFADocView, |
| 68 CXFA_FFWidget* hWidget, | 57 CXFA_FFWidget* hWidget, |
| 69 CPDF_FormField* pFormField, | 58 CPDF_FormField* pFormField, |
| 70 CPDF_FormControl* pFormControl); | 59 CPDF_FormControl* pFormControl); |
| 71 #endif // PDF_ENABLE_XFA | 60 #endif // PDF_ENABLE_XFA |
| 72 | 61 |
| 73 CPDFSDK_Widget(CPDF_Annot* pAnnot, | 62 CPDFSDK_Widget(CPDF_Annot* pAnnot, |
| 74 CPDFSDK_PageView* pPageView, | 63 CPDFSDK_PageView* pPageView, |
| 75 CPDFSDK_InterForm* pInterForm); | 64 CPDFSDK_InterForm* pInterForm); |
| 76 ~CPDFSDK_Widget() override; | 65 ~CPDFSDK_Widget() override; |
| 77 | 66 |
| 78 void AddObserver(Observer* observer); | |
| 79 void RemoveObserver(Observer* observer); | |
| 80 | |
| 81 bool IsSignatureWidget() const override; | 67 bool IsSignatureWidget() const override; |
| 82 CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; | 68 CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; |
| 83 FX_BOOL IsAppearanceValid() override; | 69 FX_BOOL IsAppearanceValid() override; |
| 84 | 70 |
| 85 int GetLayoutOrder() const override; | 71 int GetLayoutOrder() const override; |
| 86 | 72 |
| 87 int GetFieldType() const; | 73 int GetFieldType() const; |
| 88 int GetFieldFlags() const; | 74 int GetFieldFlags() const; |
| 89 int GetRotate() const; | 75 int GetRotate() const; |
| 90 | 76 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 CPWL_Color GetBorderPWLColor() const; | 159 CPWL_Color GetBorderPWLColor() const; |
| 174 CPWL_Color GetFillPWLColor() const; | 160 CPWL_Color GetFillPWLColor() const; |
| 175 | 161 |
| 176 void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage); | 162 void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage); |
| 177 void RemoveAppearance(const CFX_ByteString& sAPType); | 163 void RemoveAppearance(const CFX_ByteString& sAPType); |
| 178 | 164 |
| 179 CPDFSDK_InterForm* const m_pInterForm; | 165 CPDFSDK_InterForm* const m_pInterForm; |
| 180 FX_BOOL m_bAppModified; | 166 FX_BOOL m_bAppModified; |
| 181 int32_t m_nAppAge; | 167 int32_t m_nAppAge; |
| 182 int32_t m_nValueAge; | 168 int32_t m_nValueAge; |
| 183 std::set<Observer*> m_Observers; | |
| 184 | 169 |
| 185 #ifdef PDF_ENABLE_XFA | 170 #ifdef PDF_ENABLE_XFA |
| 186 mutable CXFA_FFWidget* m_hMixXFAWidget; | 171 mutable CXFA_FFWidget* m_hMixXFAWidget; |
| 187 mutable CXFA_FFWidgetHandler* m_pWidgetHandler; | 172 mutable CXFA_FFWidgetHandler* m_pWidgetHandler; |
| 188 #endif // PDF_ENABLE_XFA | 173 #endif // PDF_ENABLE_XFA |
| 189 }; | 174 }; |
| 190 | 175 |
| 191 #endif // FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ | 176 #endif // FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ |
| OLD | NEW |