jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 1 | // Copyright 2014 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 | |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 7 | #ifndef FPDFSDK_CPDFSDK_BAANNOT_H_ |
| 8 | #define FPDFSDK_CPDFSDK_BAANNOT_H_ |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 9 | |
dsinclair | 1727aee | 2016-09-29 13:12:56 -0700 | [diff] [blame] | 10 | #include "core/fpdfdoc/cpdf_aaction.h" |
| 11 | #include "core/fpdfdoc/cpdf_action.h" |
| 12 | #include "core/fpdfdoc/cpdf_annot.h" |
| 13 | #include "core/fpdfdoc/cpdf_defaultappearance.h" |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 14 | #include "core/fxcrt/fx_coordinates.h" |
| 15 | #include "core/fxcrt/fx_string.h" |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 16 | #include "fpdfsdk/cfx_systemhandler.h" |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 17 | #include "fpdfsdk/cpdfsdk_annot.h" |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 18 | |
| 19 | class CFX_Matrix; |
| 20 | class CFX_RenderDevice; |
| 21 | class CPDF_Dictionary; |
| 22 | class CPDF_RenderOptions; |
| 23 | class CPDFSDK_PageView; |
| 24 | |
| 25 | class CPDFSDK_BAAnnot : public CPDFSDK_Annot { |
| 26 | public: |
| 27 | CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); |
| 28 | ~CPDFSDK_BAAnnot() override; |
| 29 | |
| 30 | // CPDFSDK_Annot |
jaepark | 956553e | 2016-08-31 06:49:27 -0700 | [diff] [blame] | 31 | CPDF_Annot::Subtype GetAnnotSubtype() const override; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 32 | void SetRect(const CFX_FloatRect& rect) override; |
| 33 | CFX_FloatRect GetRect() const override; |
| 34 | CPDF_Annot* GetPDFAnnot() const override; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 35 | |
| 36 | CPDF_Dictionary* GetAnnotDict() const; |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 37 | CPDF_Annot* GetPDFPopupAnnot() const; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 38 | |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 39 | CPDF_Dictionary* GetAPDict() const; |
| 40 | |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 41 | void SetContents(const WideString& sContents); |
| 42 | WideString GetContents() const; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 43 | |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 44 | void SetAnnotName(const WideString& sName); |
| 45 | WideString GetAnnotName() const; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 46 | |
| 47 | void SetModifiedDate(const FX_SYSTEMTIME& st); |
| 48 | FX_SYSTEMTIME GetModifiedDate() const; |
| 49 | |
| 50 | void SetFlags(uint32_t nFlags); |
| 51 | uint32_t GetFlags() const; |
| 52 | |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 53 | void SetAppState(const ByteString& str); |
| 54 | ByteString GetAppState() const; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 55 | |
| 56 | void SetStructParent(int key); |
| 57 | int GetStructParent() const; |
| 58 | |
| 59 | void SetBorderWidth(int nWidth); |
| 60 | int GetBorderWidth() const; |
| 61 | |
| 62 | void SetBorderStyle(BorderStyle nStyle); |
| 63 | BorderStyle GetBorderStyle() const; |
| 64 | |
| 65 | void SetColor(FX_COLORREF color); |
| 66 | void RemoveColor(); |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 67 | bool GetColor(FX_COLORREF& color) const; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 68 | |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 69 | bool IsVisible() const; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 70 | |
| 71 | CPDF_Action GetAction() const; |
| 72 | void SetAction(const CPDF_Action& a); |
| 73 | void RemoveAction(); |
| 74 | |
| 75 | CPDF_AAction GetAAction() const; |
| 76 | void SetAAction(const CPDF_AAction& aa); |
| 77 | void RemoveAAction(); |
| 78 | |
| 79 | virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 80 | virtual bool IsAppearanceValid(); |
| 81 | virtual bool IsAppearanceValid(CPDF_Annot::AppearanceMode mode); |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 82 | virtual void DrawAppearance(CFX_RenderDevice* pDevice, |
Lei Zhang | 8a44940 | 2017-08-17 15:07:47 -0700 | [diff] [blame] | 83 | const CFX_Matrix& mtUser2Device, |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 84 | CPDF_Annot::AppearanceMode mode, |
| 85 | const CPDF_RenderOptions* pOptions); |
| 86 | |
| 87 | void DrawBorder(CFX_RenderDevice* pDevice, |
| 88 | const CFX_Matrix* pUser2Device, |
| 89 | const CPDF_RenderOptions* pOptions); |
| 90 | |
| 91 | void ClearCachedAP(); |
| 92 | |
jaepark | 35512aa | 2016-08-29 17:15:08 -0700 | [diff] [blame] | 93 | void SetOpenState(bool bState); |
| 94 | |
Henrique Nakashima | 89bf9ce | 2017-09-19 16:45:10 -0400 | [diff] [blame] | 95 | int GetLayoutOrder() const override; |
| 96 | |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 97 | protected: |
Dan Sinclair | aee0db0 | 2017-09-21 16:53:58 -0400 | [diff] [blame] | 98 | UnownedPtr<CPDF_Annot> const m_pAnnot; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 99 | }; |
| 100 | |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 101 | #endif // FPDFSDK_CPDFSDK_BAANNOT_H_ |