1 // Copyright 2016 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef FPDFSDK_CPDFSDK_ANNOT_H_ 8 #define FPDFSDK_CPDFSDK_ANNOT_H_ 9 10 #include "core/fpdfdoc/cpdf_aaction.h" 11 #include "core/fpdfdoc/cpdf_annot.h" 12 #include "core/fpdfdoc/cpdf_defaultappearance.h" 13 #include "core/fxcrt/observable.h" 14 #include "core/fxcrt/unowned_ptr.h" 15 #include "fpdfsdk/cfx_systemhandler.h" 16 #include "fpdfsdk/fsdk_common.h" 17 #include "fpdfsdk/fsdk_define.h" 18 19 class CFX_Matrix; 20 class CFX_RenderDevice; 21 class CPDF_Page; 22 class CPDF_RenderOptions; 23 class CPDFSDK_PageView; 24 25 class CPDFSDK_Annot : public Observable<CPDFSDK_Annot> { 26 public: 27 explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView); 28 virtual ~CPDFSDK_Annot(); 29 30 #ifdef PDF_ENABLE_XFA 31 virtual bool IsXFAField(); 32 virtual CXFA_FFWidget* GetXFAWidget() const; 33 #endif // PDF_ENABLE_XFA 34 35 virtual float GetMinWidth() const; 36 virtual float GetMinHeight() const; 37 virtual int GetLayoutOrder() const; 38 virtual CPDF_Annot* GetPDFAnnot() const; 39 virtual CPDF_Annot::Subtype GetAnnotSubtype() const; 40 virtual bool IsSignatureWidget() const; 41 virtual CFX_FloatRect GetRect() const; 42 virtual void SetRect(const CFX_FloatRect& rect); 43 44 UnderlyingPageType* GetUnderlyingPage(); 45 CPDF_Page* GetPDFPage(); 46 #ifdef PDF_ENABLE_XFA 47 CPDFXFA_Page* GetPDFXFAPage(); 48 #endif // PDF_ENABLE_XFA 49 GetPageView()50 CPDFSDK_PageView* GetPageView() const { return m_pPageView.Get(); } 51 52 protected: 53 UnownedPtr<CPDFSDK_PageView> const m_pPageView; 54 }; 55 56 #endif // FPDFSDK_CPDFSDK_ANNOT_H_ 57