blob: e83cb0fe452b038f66caa3692c1ad00276556319 [file] [log] [blame]
jaepark27362762016-08-11 13:10:39 -07001// 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_INCLUDE_CPDFSDK_BAANNOT_H_
8#define FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_
9
10#include "core/fpdfdoc/include/cpdf_aaction.h"
11#include "core/fpdfdoc/include/cpdf_action.h"
12#include "core/fpdfdoc/include/cpdf_annot.h"
13#include "core/fpdfdoc/include/cpdf_defaultappearance.h"
14#include "core/fxcrt/include/fx_coordinates.h"
15#include "core/fxcrt/include/fx_string.h"
16#include "fpdfsdk/cfx_systemhandler.h"
17#include "fpdfsdk/include/cpdfsdk_annot.h"
18
19class CFX_Matrix;
20class CFX_RenderDevice;
21class CPDF_Dictionary;
22class CPDF_RenderOptions;
23class CPDFSDK_PageView;
24
25class CPDFSDK_BAAnnot : public CPDFSDK_Annot {
26 public:
27 CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView);
28 ~CPDFSDK_BAAnnot() override;
29
30 // CPDFSDK_Annot
jaepark9ed91372016-08-26 16:16:10 -070031 CFX_ByteString GetAnnotSubtype() const override;
jaepark27362762016-08-11 13:10:39 -070032 void SetRect(const CFX_FloatRect& rect) override;
33 CFX_FloatRect GetRect() const override;
34 CPDF_Annot* GetPDFAnnot() const override;
35 void Annot_OnDraw(CFX_RenderDevice* pDevice,
36 CFX_Matrix* pUser2Device,
37 CPDF_RenderOptions* pOptions) override;
38
39 CPDF_Dictionary* GetAnnotDict() const;
40
41 void SetContents(const CFX_WideString& sContents);
42 CFX_WideString GetContents() const;
43
44 void SetAnnotName(const CFX_WideString& sName);
45 CFX_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 CFX_ByteString& str);
54 CFX_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 FX_BOOL GetColor(FX_COLORREF& color) const;
68
69 FX_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 FX_BOOL IsAppearanceValid();
81 virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
82 virtual void DrawAppearance(CFX_RenderDevice* pDevice,
83 const CFX_Matrix* pUser2Device,
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 WriteAppearance(const CFX_ByteString& sAPType,
94 const CFX_FloatRect& rcBBox,
95 const CFX_Matrix& matrix,
96 const CFX_ByteString& sContents,
97 const CFX_ByteString& sAPState = "");
98
99 protected:
100 CPDF_Annot* m_pAnnot;
101};
102
103#endif // FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_