summaryrefslogtreecommitdiff
path: root/fpdfsdk/include
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/include')
-rw-r--r--fpdfsdk/include/fsdk_baseannot.h73
-rw-r--r--fpdfsdk/include/fsdk_baseform.h6
2 files changed, 48 insertions, 31 deletions
diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h
index bfeebeb9f3..063ffa078e 100644
--- a/fpdfsdk/include/fsdk_baseannot.h
+++ b/fpdfsdk/include/fsdk_baseannot.h
@@ -68,21 +68,30 @@ class CPDFSDK_DateTime {
class CPDFSDK_Annot {
public:
- CPDFSDK_Annot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView);
- virtual ~CPDFSDK_Annot();
+ CPDFSDK_Annot(CPDFSDK_PageView* pPageView);
+ virtual ~CPDFSDK_Annot(){};
- public:
virtual FX_FLOAT GetMinWidth() const;
virtual FX_FLOAT GetMinHeight() const;
// define layout order to 5.
virtual int GetLayoutOrder() const { return 5; }
- public:
- CPDF_Annot* GetPDFAnnot();
+ virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; }
+
+ virtual CFX_ByteString GetType() const { return ""; }
+ virtual CFX_ByteString GetSubType() const { return ""; }
+
+ virtual void SetRect(const CPDF_Rect& rect) {}
+ virtual CPDF_Rect GetRect() const { return CPDF_Rect(); }
+
+ virtual void Annot_OnDraw(CFX_RenderDevice* pDevice,
+ CPDF_Matrix* pUser2Device,
+ CPDF_RenderOptions* pOptions) {}
+
+ CPDF_Page* GetPDFPage();
- void SetPage(CPDFSDK_PageView* pPageView);
- CPDFSDK_PageView* GetPageView();
- FX_DWORD GetFlags();
+ void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; }
+ CPDFSDK_PageView* GetPageView() const { return m_pPageView; }
// Tab Order
int GetTabOrder();
@@ -92,17 +101,34 @@ class CPDFSDK_Annot {
FX_BOOL IsSelected();
void SetSelected(FX_BOOL bSelected);
- CFX_ByteString GetType() const;
+ protected:
+ CPDF_Annot* m_pAnnot;
+ CPDFSDK_PageView* m_pPageView;
+ FX_BOOL m_bSelected;
+ int m_nTabOrder;
+};
+
+class CPDFSDK_BAAnnot : public CPDFSDK_Annot {
+ public:
+ CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView);
+ virtual ~CPDFSDK_BAAnnot();
+
+ public:
+ virtual CFX_ByteString GetType() const;
virtual CFX_ByteString GetSubType() const;
- CPDF_Page* GetPDFPage();
+ virtual void SetRect(const CPDF_Rect& rect);
+ virtual CPDF_Rect GetRect() const;
+
+ virtual CPDF_Annot* GetPDFAnnot() const;
+
+ virtual void Annot_OnDraw(CFX_RenderDevice* pDevice,
+ CPDF_Matrix* pUser2Device,
+ CPDF_RenderOptions* pOptions);
public:
CPDF_Dictionary* GetAnnotDict() const;
- void SetRect(const CPDF_Rect& rect);
- CPDF_Rect GetRect() const;
-
void SetContents(const CFX_WideString& sContents);
CFX_WideString GetContents() const;
@@ -159,12 +185,12 @@ class CPDFSDK_Annot {
virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT);
public:
- FX_BOOL IsAppearanceValid();
- FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
- void DrawAppearance(CFX_RenderDevice* pDevice,
- const CPDF_Matrix* pUser2Device,
- CPDF_Annot::AppearanceMode mode,
- const CPDF_RenderOptions* pOptions);
+ virtual FX_BOOL IsAppearanceValid();
+ virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
+ virtual void DrawAppearance(CFX_RenderDevice* pDevice,
+ const CPDF_Matrix* pUser2Device,
+ CPDF_Annot::AppearanceMode mode,
+ const CPDF_RenderOptions* pOptions);
void DrawBorder(CFX_RenderDevice* pDevice,
const CPDF_Matrix* pUser2Device,
const CPDF_RenderOptions* pOptions);
@@ -177,20 +203,11 @@ class CPDFSDK_Annot {
const CFX_ByteString& sContents,
const CFX_ByteString& sAPState = "");
- public:
- virtual void Annot_OnDraw(CFX_RenderDevice* pDevice,
- CPDF_Matrix* pUser2Device,
- CPDF_RenderOptions* pOptions);
-
- public:
private:
FX_BOOL CreateFormFiller();
protected:
CPDF_Annot* m_pAnnot;
- CPDFSDK_PageView* m_pPageView;
- FX_BOOL m_bSelected;
- int m_nTabOrder;
};
#endif // FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index f402aae76f..b356d255fe 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -57,7 +57,7 @@ typedef struct _PDFSDK_FieldAction {
FX_BOOL bRC; // in[out]
} PDFSDK_FieldAction;
-class CPDFSDK_Widget : public CPDFSDK_Annot {
+class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
public:
CPDFSDK_Widget(CPDF_Annot* pAnnot,
CPDFSDK_PageView* pPageView,
@@ -67,6 +67,7 @@ class CPDFSDK_Widget : public CPDFSDK_Annot {
// CPDFSDK_Annot
CFX_ByteString GetSubType() const override;
CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override;
+ FX_BOOL IsAppearanceValid() override;
int GetLayoutOrder() const override { return 2; }
@@ -161,9 +162,8 @@ class CPDFSDK_Widget : public CPDFSDK_Annot {
void DrawAppearance(CFX_RenderDevice* pDevice,
const CPDF_Matrix* pUser2Device,
CPDF_Annot::AppearanceMode mode,
- const CPDF_RenderOptions* pOptions);
+ const CPDF_RenderOptions* pOptions) override;
- public:
FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY);
private: