blob: 1053c00c13e056278b785ca515dd9e1c2529e54a [file] [log] [blame]
jaepark27362762016-08-11 13:10:39 -07001// 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
dsinclair114e46a2016-09-29 17:18:21 -07007#ifndef FPDFSDK_CPDFSDK_ANNOT_H_
8#define FPDFSDK_CPDFSDK_ANNOT_H_
jaepark27362762016-08-11 13:10:39 -07009
dsinclair1727aee2016-09-29 13:12:56 -070010#include "core/fpdfdoc/cpdf_aaction.h"
11#include "core/fpdfdoc/cpdf_annot.h"
12#include "core/fpdfdoc/cpdf_defaultappearance.h"
dsinclaira52ab742016-09-29 13:59:29 -070013#include "core/fxcrt/cfx_observable.h"
14#include "core/fxcrt/fx_basic.h"
jaepark27362762016-08-11 13:10:39 -070015#include "fpdfsdk/cfx_systemhandler.h"
dsinclair114e46a2016-09-29 17:18:21 -070016#include "fpdfsdk/fsdk_common.h"
17#include "fpdfsdk/fsdk_define.h"
jaepark27362762016-08-11 13:10:39 -070018
19class CFX_Matrix;
20class CFX_RenderDevice;
21class CPDF_Page;
22class CPDF_RenderOptions;
23class CPDFSDK_PageView;
24
tsepez7b68f612016-09-07 14:11:27 -070025class CPDFSDK_Annot : public CFX_Observable<CPDFSDK_Annot> {
jaepark27362762016-08-11 13:10:39 -070026 public:
27 explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView);
28 virtual ~CPDFSDK_Annot();
29
30#ifdef PDF_ENABLE_XFA
tsepez4cf55152016-11-02 14:37:54 -070031 virtual bool IsXFAField();
jaepark27362762016-08-11 13:10:39 -070032 virtual CXFA_FFWidget* GetXFAWidget() const;
33#endif // PDF_ENABLE_XFA
34
Dan Sinclair05df0752017-03-14 14:43:42 -040035 virtual float GetMinWidth() const;
36 virtual float GetMinHeight() const;
jaepark27362762016-08-11 13:10:39 -070037 virtual int GetLayoutOrder() const;
38 virtual CPDF_Annot* GetPDFAnnot() const;
jaepark956553e2016-08-31 06:49:27 -070039 virtual CPDF_Annot::Subtype GetAnnotSubtype() const;
jaepark9ed91372016-08-26 16:16:10 -070040 virtual bool IsSignatureWidget() const;
jaepark27362762016-08-11 13:10:39 -070041 virtual CFX_FloatRect GetRect() const;
42
43 virtual void SetRect(const CFX_FloatRect& rect);
44 virtual void Annot_OnDraw(CFX_RenderDevice* pDevice,
45 CFX_Matrix* pUser2Device,
46 CPDF_RenderOptions* pOptions);
47
48 UnderlyingPageType* GetUnderlyingPage();
49 CPDF_Page* GetPDFPage();
50#ifdef PDF_ENABLE_XFA
51 CPDFXFA_Page* GetPDFXFAPage();
52#endif // PDF_ENABLE_XFA
53
54 void SetPage(CPDFSDK_PageView* pPageView);
55 CPDFSDK_PageView* GetPageView() const { return m_pPageView; }
56
tsepez4cf55152016-11-02 14:37:54 -070057 bool IsSelected();
58 void SetSelected(bool bSelected);
jaepark27362762016-08-11 13:10:39 -070059
60 protected:
61 CPDFSDK_PageView* m_pPageView;
tsepez4cf55152016-11-02 14:37:54 -070062 bool m_bSelected;
jaepark27362762016-08-11 13:10:39 -070063};
64
dsinclair114e46a2016-09-29 17:18:21 -070065#endif // FPDFSDK_CPDFSDK_ANNOT_H_