• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
7 #ifndef FPDFSDK_CPDFSDK_BAANNOT_H_
8 #define FPDFSDK_CPDFSDK_BAANNOT_H_
9 
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"
14 #include "core/fxcrt/fx_coordinates.h"
15 #include "core/fxcrt/fx_string.h"
16 #include "fpdfsdk/cfx_systemhandler.h"
17 #include "fpdfsdk/cpdfsdk_annot.h"
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
31   CPDF_Annot::Subtype GetAnnotSubtype() const override;
32   void SetRect(const CFX_FloatRect& rect) override;
33   CFX_FloatRect GetRect() const override;
34   CPDF_Annot* GetPDFAnnot() const override;
35 
36   CPDF_Dictionary* GetAnnotDict() const;
37   CPDF_Annot* GetPDFPopupAnnot() const;
38 
39   CPDF_Dictionary* GetAPDict() const;
40 
41   void SetContents(const WideString& sContents);
42   WideString GetContents() const;
43 
44   void SetAnnotName(const WideString& sName);
45   WideString GetAnnotName() const;
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 
53   void SetAppState(const ByteString& str);
54   ByteString GetAppState() const;
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();
67   bool GetColor(FX_COLORREF& color) const;
68 
69   bool IsVisible() const;
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);
80   virtual bool IsAppearanceValid();
81   virtual bool IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
82   virtual void DrawAppearance(CFX_RenderDevice* pDevice,
83                               const CFX_Matrix& mtUser2Device,
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 
93   void SetOpenState(bool bState);
94 
95   int GetLayoutOrder() const override;
96 
97  protected:
98   UnownedPtr<CPDF_Annot> const m_pAnnot;
99 };
100 
101 #endif  // FPDFSDK_CPDFSDK_BAANNOT_H_
102