blob: a6c4066ea59b9d50be49999d01695b1829d30e0c [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"
Dan Sinclair65ecca42017-09-21 15:25:32 -040013#include "core/fxcrt/observable.h"
Dan Sinclairaee0db02017-09-21 16:53:58 -040014#include "core/fxcrt/unowned_ptr.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
Dan Sinclair65ecca42017-09-21 15:25:32 -040025class CPDFSDK_Annot : public 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;
jaepark27362762016-08-11 13:10:39 -070042 virtual void SetRect(const CFX_FloatRect& rect);
jaepark27362762016-08-11 13:10:39 -070043
44 UnderlyingPageType* GetUnderlyingPage();
45 CPDF_Page* GetPDFPage();
46#ifdef PDF_ENABLE_XFA
47 CPDFXFA_Page* GetPDFXFAPage();
48#endif // PDF_ENABLE_XFA
49
Tom Sepezd0409af2017-05-25 15:53:57 -070050 CPDFSDK_PageView* GetPageView() const { return m_pPageView.Get(); }
jaepark27362762016-08-11 13:10:39 -070051
jaepark27362762016-08-11 13:10:39 -070052 protected:
Dan Sinclairaee0db02017-09-21 16:53:58 -040053 UnownedPtr<CPDFSDK_PageView> const m_pPageView;
jaepark27362762016-08-11 13:10:39 -070054};
55
dsinclair114e46a2016-09-29 17:18:21 -070056#endif // FPDFSDK_CPDFSDK_ANNOT_H_