diff options
Diffstat (limited to 'fpdfsdk/include')
21 files changed, 0 insertions, 1967 deletions
diff --git a/fpdfsdk/include/cba_annotiterator.h b/fpdfsdk/include/cba_annotiterator.h deleted file mode 100644 index 38332db718..0000000000 --- a/fpdfsdk/include/cba_annotiterator.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ -#define FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ - -#include <vector> - -#include "core/fpdfdoc/cpdf_annot.h" -#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_string.h" - -class CPDFSDK_Annot; -class CPDFSDK_PageView; - -class CBA_AnnotIterator { - public: - enum TabOrder { STRUCTURE = 0, ROW, COLUMN }; - - CBA_AnnotIterator(CPDFSDK_PageView* pPageView, - CPDF_Annot::Subtype nAnnotSubtype); - ~CBA_AnnotIterator(); - - CPDFSDK_Annot* GetFirstAnnot(); - CPDFSDK_Annot* GetLastAnnot(); - CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot); - CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot); - - private: - void GenerateResults(); - static CFX_FloatRect GetAnnotRect(const CPDFSDK_Annot* pAnnot); - - // Function signature compatible with std::sort(). - static bool CompareByLeftAscending(const CPDFSDK_Annot* p1, - const CPDFSDK_Annot* p2); - static bool CompareByTopDescending(const CPDFSDK_Annot* p1, - const CPDFSDK_Annot* p2); - - TabOrder m_eTabOrder; - CPDFSDK_PageView* m_pPageView; - CPDF_Annot::Subtype m_nAnnotSubtype; - std::vector<CPDFSDK_Annot*> m_Annots; -}; - -#endif // FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ diff --git a/fpdfsdk/include/cpdfsdk_annot.h b/fpdfsdk/include/cpdfsdk_annot.h deleted file mode 100644 index b7b7399373..0000000000 --- a/fpdfsdk/include/cpdfsdk_annot.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_ANNOT_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_ANNOT_H_ - -#include "core/fpdfdoc/cpdf_aaction.h" -#include "core/fpdfdoc/cpdf_annot.h" -#include "core/fpdfdoc/cpdf_defaultappearance.h" -#include "core/fxcrt/cfx_observable.h" -#include "core/fxcrt/fx_basic.h" -#include "fpdfsdk/cfx_systemhandler.h" -#include "fpdfsdk/include/fsdk_common.h" -#include "fpdfsdk/include/fsdk_define.h" - -class CFX_Matrix; -class CFX_RenderDevice; -class CPDF_Page; -class CPDF_RenderOptions; -class CPDFSDK_PageView; - -class CPDFSDK_Annot : public CFX_Observable<CPDFSDK_Annot> { - public: - explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView); - virtual ~CPDFSDK_Annot(); - -#ifdef PDF_ENABLE_XFA - virtual FX_BOOL IsXFAField(); - virtual CXFA_FFWidget* GetXFAWidget() const; -#endif // PDF_ENABLE_XFA - - virtual FX_FLOAT GetMinWidth() const; - virtual FX_FLOAT GetMinHeight() const; - virtual int GetLayoutOrder() const; - virtual CPDF_Annot* GetPDFAnnot() const; - virtual CPDF_Annot::Subtype GetAnnotSubtype() const; - virtual bool IsSignatureWidget() const; - virtual CFX_FloatRect GetRect() const; - - virtual void SetRect(const CFX_FloatRect& rect); - virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - CPDF_RenderOptions* pOptions); - - UnderlyingPageType* GetUnderlyingPage(); - CPDF_Page* GetPDFPage(); -#ifdef PDF_ENABLE_XFA - CPDFXFA_Page* GetPDFXFAPage(); -#endif // PDF_ENABLE_XFA - - void SetPage(CPDFSDK_PageView* pPageView); - CPDFSDK_PageView* GetPageView() const { return m_pPageView; } - - FX_BOOL IsSelected(); - void SetSelected(FX_BOOL bSelected); - - protected: - CPDFSDK_PageView* m_pPageView; - FX_BOOL m_bSelected; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_ANNOT_H_ diff --git a/fpdfsdk/include/cpdfsdk_annothandlermgr.h b/fpdfsdk/include/cpdfsdk_annothandlermgr.h deleted file mode 100644 index 717f87fcef..0000000000 --- a/fpdfsdk/include/cpdfsdk_annothandlermgr.h +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ - -#include <map> -#include <memory> - -#include "core/fpdfdoc/cpdf_annot.h" -#include "core/fxcrt/fx_basic.h" -#include "core/fxcrt/fx_coordinates.h" -#include "fpdfsdk/include/cpdfsdk_annot.h" - -class CFX_Matrix; -class CFX_RenderDevice; -class CPDFSDK_Environment; -class CPDFSDK_BAAnnotHandler; -class CPDFSDK_WidgetHandler; -class CPDFSDK_PageView; -class IPDFSDK_AnnotHandler; - -#ifdef PDF_ENABLE_XFA -class CPDFSDK_XFAWidgetHandler; -class CXFA_FFWidget; -#endif // PDF_ENABLE_XFA - -class CPDFSDK_AnnotHandlerMgr { - public: - explicit CPDFSDK_AnnotHandlerMgr(CPDFSDK_Environment* pApp); - ~CPDFSDK_AnnotHandlerMgr(); - - CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); -#ifdef PDF_ENABLE_XFA - CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot, CPDFSDK_PageView* pPageView); -#endif // PDF_ENABLE_XFA - void ReleaseAnnot(CPDFSDK_Annot* pAnnot); - - void Annot_OnCreate(CPDFSDK_Annot* pAnnot); - void Annot_OnLoad(CPDFSDK_Annot* pAnnot); - - IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; - void Annot_OnDraw(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - bool bDrawAnnots); - - void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags); - void Annot_OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags); - FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point); - FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point); - FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point); - FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point); - FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - short zDelta, - const CFX_FloatPoint& point); - FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point); - FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point); - FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags); - FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); - FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); - - FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag); - FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag); - -#ifdef PDF_ENABLE_XFA - FX_BOOL Annot_OnChangeFocus(CPDFSDK_Annot::ObservedPtr* pSetAnnot, - CPDFSDK_Annot::ObservedPtr* pKillAnnot); -#endif // PDF_ENABLE_XFA - - CFX_FloatRect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot); - FX_BOOL Annot_OnHitTest(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point); - - private: - IPDFSDK_AnnotHandler* GetAnnotHandler(CPDF_Annot::Subtype nSubtype) const; - CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, FX_BOOL bNext); - - std::unique_ptr<CPDFSDK_BAAnnotHandler> m_pBAAnnotHandler; - std::unique_ptr<CPDFSDK_WidgetHandler> m_pWidgetHandler; -#ifdef PDF_ENABLE_XFA - std::unique_ptr<CPDFSDK_XFAWidgetHandler> m_pXFAWidgetHandler; -#endif // PDF_ENABLE_XFA - - CPDFSDK_Environment* m_pEnv; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ diff --git a/fpdfsdk/include/cpdfsdk_annotiterator.h b/fpdfsdk/include/cpdfsdk_annotiterator.h deleted file mode 100644 index f0fb872817..0000000000 --- a/fpdfsdk/include/cpdfsdk_annotiterator.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_ANNOTITERATOR_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_ANNOTITERATOR_H_ - -#include <vector> - -class CPDFSDK_Annot; -class CPDFSDK_PageView; - -class CPDFSDK_AnnotIterator { - public: - CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView, bool bReverse); - ~CPDFSDK_AnnotIterator(); - - CPDFSDK_Annot* Next(); - - private: - CPDFSDK_Annot* NextAnnot(); - CPDFSDK_Annot* PrevAnnot(); - - std::vector<CPDFSDK_Annot*> m_iteratorAnnotList; - const bool m_bReverse; - std::size_t m_pos; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_ANNOTITERATOR_H_ diff --git a/fpdfsdk/include/cpdfsdk_baannot.h b/fpdfsdk/include/cpdfsdk_baannot.h deleted file mode 100644 index dea717a5e0..0000000000 --- a/fpdfsdk/include/cpdfsdk_baannot.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_ - -#include "core/fpdfdoc/cpdf_aaction.h" -#include "core/fpdfdoc/cpdf_action.h" -#include "core/fpdfdoc/cpdf_annot.h" -#include "core/fpdfdoc/cpdf_defaultappearance.h" -#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_string.h" -#include "fpdfsdk/cfx_systemhandler.h" -#include "fpdfsdk/include/cpdfsdk_annot.h" - -class CFX_Matrix; -class CFX_RenderDevice; -class CPDF_Dictionary; -class CPDF_RenderOptions; -class CPDFSDK_PageView; - -class CPDFSDK_BAAnnot : public CPDFSDK_Annot { - public: - CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView); - ~CPDFSDK_BAAnnot() override; - - // CPDFSDK_Annot - CPDF_Annot::Subtype GetAnnotSubtype() const override; - void SetRect(const CFX_FloatRect& rect) override; - CFX_FloatRect GetRect() const override; - CPDF_Annot* GetPDFAnnot() const override; - void Annot_OnDraw(CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - CPDF_RenderOptions* pOptions) override; - - CPDF_Dictionary* GetAnnotDict() const; - CPDF_Annot* GetPDFPopupAnnot() const; - - void SetContents(const CFX_WideString& sContents); - CFX_WideString GetContents() const; - - void SetAnnotName(const CFX_WideString& sName); - CFX_WideString GetAnnotName() const; - - void SetModifiedDate(const FX_SYSTEMTIME& st); - FX_SYSTEMTIME GetModifiedDate() const; - - void SetFlags(uint32_t nFlags); - uint32_t GetFlags() const; - - void SetAppState(const CFX_ByteString& str); - CFX_ByteString GetAppState() const; - - void SetStructParent(int key); - int GetStructParent() const; - - void SetBorderWidth(int nWidth); - int GetBorderWidth() const; - - void SetBorderStyle(BorderStyle nStyle); - BorderStyle GetBorderStyle() const; - - void SetColor(FX_COLORREF color); - void RemoveColor(); - FX_BOOL GetColor(FX_COLORREF& color) const; - - FX_BOOL IsVisible() const; - - CPDF_Action GetAction() const; - void SetAction(const CPDF_Action& a); - void RemoveAction(); - - CPDF_AAction GetAAction() const; - void SetAAction(const CPDF_AAction& aa); - void RemoveAAction(); - - virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); - virtual FX_BOOL IsAppearanceValid(); - virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode); - virtual void DrawAppearance(CFX_RenderDevice* pDevice, - const CFX_Matrix* pUser2Device, - CPDF_Annot::AppearanceMode mode, - const CPDF_RenderOptions* pOptions); - - void DrawBorder(CFX_RenderDevice* pDevice, - const CFX_Matrix* pUser2Device, - const CPDF_RenderOptions* pOptions); - - void ClearCachedAP(); - - void WriteAppearance(const CFX_ByteString& sAPType, - const CFX_FloatRect& rcBBox, - const CFX_Matrix& matrix, - const CFX_ByteString& sContents, - const CFX_ByteString& sAPState = ""); - - void SetOpenState(bool bState); - - protected: - CPDF_Annot* m_pAnnot; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_BAANNOT_H_ diff --git a/fpdfsdk/include/cpdfsdk_baannothandler.h b/fpdfsdk/include/cpdfsdk_baannothandler.h deleted file mode 100644 index 44e0cbb0b7..0000000000 --- a/fpdfsdk/include/cpdfsdk_baannothandler.h +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_BAANNOTHANDLER_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_BAANNOTHANDLER_H_ - -#include "core/fxcrt/fx_basic.h" -#include "core/fxcrt/fx_coordinates.h" -#include "fpdfsdk/include/ipdfsdk_annothandler.h" - -class CFFL_InteractiveFormFiller; -class CFX_Matrix; -class CFX_RenderDevice; -class CPDF_Annot; -class CPDFSDK_Environment; -class CPDFSDK_Annot; -class CPDFSDK_PageView; - -#ifdef PDF_ENABLE_XFA -class CXFA_FFWidget; -#endif // PDF_ENABLE_XFA - -class CPDFSDK_BAAnnotHandler : public IPDFSDK_AnnotHandler { - public: - CPDFSDK_BAAnnotHandler(); - ~CPDFSDK_BAAnnotHandler() override; - - FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; - CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; -#ifdef PDF_ENABLE_XFA - CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, - CPDFSDK_PageView* pPage) override; -#endif // PDF_ENABLE_XFA - void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; - void DeleteAnnot(CPDFSDK_Annot* pAnnot) override; - CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) override; - FX_BOOL HitTest(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) override; - void OnDraw(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - bool bDrawAnnots) override; - void OnCreate(CPDFSDK_Annot* pAnnot) override; - void OnLoad(CPDFSDK_Annot* pAnnot) override; - void OnDelete(CPDFSDK_Annot* pAnnot) override; - void OnRelease(CPDFSDK_Annot* pAnnot) override; - - void OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - void OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - short zDelta, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, - uint32_t nChar, - uint32_t nFlags) override; - FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; - FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; - void OnDeSelected(CPDFSDK_Annot* pAnnot) override; - void OnSelected(CPDFSDK_Annot* pAnnot) override; - FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; -#ifdef PDF_ENABLE_XFA - FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, - CPDFSDK_Annot::ObservedPtr* pNewAnnot) override; -#endif // PDF_ENABLE_XFA -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_BAANNOTHANDLER_H_ diff --git a/fpdfsdk/include/cpdfsdk_datetime.h b/fpdfsdk/include/cpdfsdk_datetime.h deleted file mode 100644 index 564ebbeeb4..0000000000 --- a/fpdfsdk/include/cpdfsdk_datetime.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_DATETIME_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_DATETIME_H_ - -#if _FX_OS_ == _FX_ANDROID_ -#include "time.h" -#else -#include <ctime> -#endif - -#include "fpdfsdk/cfx_systemhandler.h" - -class CPDFSDK_DateTime { - public: - CPDFSDK_DateTime(); - explicit CPDFSDK_DateTime(const CFX_ByteString& dtStr); - explicit CPDFSDK_DateTime(const FX_SYSTEMTIME& st); - CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime); - - bool operator==(const CPDFSDK_DateTime& datetime) const; - bool operator!=(const CPDFSDK_DateTime& datetime) const; - - CPDFSDK_DateTime& FromPDFDateTimeString(const CFX_ByteString& dtStr); - CFX_ByteString ToCommonDateTimeString(); - CFX_ByteString ToPDFDateTimeString(); - void ToSystemTime(FX_SYSTEMTIME& st); - time_t ToTime_t() const; - CPDFSDK_DateTime ToGMT() const; - CPDFSDK_DateTime& AddDays(short days); - CPDFSDK_DateTime& AddSeconds(int seconds); - void ResetDateTime(); - - private: - int16_t m_year; - uint8_t m_month; - uint8_t m_day; - uint8_t m_hour; - uint8_t m_minute; - uint8_t m_second; - int8_t m_tzHour; - uint8_t m_tzMinute; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_DATETIME_H_ diff --git a/fpdfsdk/include/cpdfsdk_document.h b/fpdfsdk/include/cpdfsdk_document.h deleted file mode 100644 index fe6ac94c12..0000000000 --- a/fpdfsdk/include/cpdfsdk_document.h +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_DOCUMENT_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_DOCUMENT_H_ - -#include <map> -#include <memory> - -#include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fxcrt/cfx_observable.h" -#include "fpdfsdk/include/cpdfsdk_annot.h" -#include "fpdfsdk/include/fsdk_define.h" -#include "public/fpdf_formfill.h" - -class CPDF_OCContext; -class CPDFSDK_Environment; -class CPDFSDK_InterForm; -class CPDFSDK_PageView; -class IJS_Runtime; - -class CPDFSDK_Document : public CFX_Observable<CPDFSDK_Document> { - public: - static CPDFSDK_Document* FromFPDFFormHandle(FPDF_FORMHANDLE hHandle); - - CPDFSDK_Document(UnderlyingDocumentType* pDoc, CPDFSDK_Environment* pEnv); - ~CPDFSDK_Document(); - - CPDFSDK_InterForm* GetInterForm(); - - // Gets the document object for the next layer down; for master this is - // a CPDF_Document, but for XFA it is a CPDFXFA_Document. - UnderlyingDocumentType* GetUnderlyingDocument() const { -#ifdef PDF_ENABLE_XFA - return GetXFADocument(); -#else // PDF_ENABLE_XFA - return GetPDFDocument(); -#endif // PDF_ENABLE_XFA - } - - // Gets the CPDF_Document, either directly in master, or from the - // CPDFXFA_Document for XFA. - CPDF_Document* GetPDFDocument() const { -#ifdef PDF_ENABLE_XFA - return m_pDoc ? m_pDoc->GetPDFDoc() : nullptr; -#else // PDF_ENABLE_XFA - return m_pDoc; -#endif // PDF_ENABLE_XFA - } - -#ifdef PDF_ENABLE_XFA - // Gets the XFA document directly (XFA-only). - CPDFXFA_Document* GetXFADocument() const { return m_pDoc; } - - int GetPageViewCount() const { return m_pageMap.size(); } -#endif // PDF_ENABLE_XFA - - CPDFSDK_PageView* GetPageView(UnderlyingPageType* pPage, bool ReNew); - CPDFSDK_PageView* GetPageView(int nIndex); - CPDFSDK_PageView* GetCurrentView(); - void RemovePageView(UnderlyingPageType* pPage); - void UpdateAllViews(CPDFSDK_PageView* pSender, CPDFSDK_Annot* pAnnot); - - CPDFSDK_Annot* GetFocusAnnot(); - - IJS_Runtime* GetJsRuntime(); - - FX_BOOL SetFocusAnnot(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag = 0); - FX_BOOL KillFocusAnnot(uint32_t nFlag = 0); - - FX_BOOL ExtractPages(const std::vector<uint16_t>& arrExtraPages, - CPDF_Document* pDstDoc); - FX_BOOL InsertPages(int nInsertAt, - const CPDF_Document* pSrcDoc, - const std::vector<uint16_t>& arrSrcPages); - FX_BOOL ReplacePages(int nPage, - const CPDF_Document* pSrcDoc, - const std::vector<uint16_t>& arrSrcPages); - - void OnCloseDocument(); - - int GetPageCount() { return m_pDoc->GetPageCount(); } - FX_BOOL GetPermissions(int nFlag); - FX_BOOL GetChangeMark() { return m_bChangeMask; } - void SetChangeMark() { m_bChangeMask = TRUE; } - void ClearChangeMark() { m_bChangeMask = FALSE; } - CFX_WideString GetPath(); - UnderlyingPageType* GetPage(int nIndex); - CPDFSDK_Environment* GetEnv() { return m_pEnv; } - void ProcJavascriptFun(); - FX_BOOL ProcOpenAction(); - CPDF_OCContext* GetOCContext(); - - private: - std::map<UnderlyingPageType*, CPDFSDK_PageView*> m_pageMap; - UnderlyingDocumentType* m_pDoc; - std::unique_ptr<CPDFSDK_InterForm> m_pInterForm; - CPDFSDK_Annot::ObservedPtr m_pFocusAnnot; - CPDFSDK_Environment* m_pEnv; - std::unique_ptr<CPDF_OCContext> m_pOccontent; - FX_BOOL m_bChangeMask; - FX_BOOL m_bBeingDestroyed; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_DOCUMENT_H_ diff --git a/fpdfsdk/include/cpdfsdk_environment.h b/fpdfsdk/include/cpdfsdk_environment.h deleted file mode 100644 index 1bf541e870..0000000000 --- a/fpdfsdk/include/cpdfsdk_environment.h +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_ENVIRONMENT_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_ENVIRONMENT_H_ - -#include <memory> - -#include "core/fpdfapi/fpdf_page/cpdf_page.h" -#include "core/fpdfapi/fpdf_parser/cpdf_document.h" -#include "core/fpdfdoc/cpdf_occontext.h" -#include "core/fxcrt/cfx_observable.h" -#include "fpdfsdk/cfx_systemhandler.h" -#include "fpdfsdk/include/fsdk_define.h" -#include "public/fpdf_formfill.h" -#include "public/fpdf_fwlevent.h" - -class CFFL_InteractiveFormFiller; -class CFX_SystemHandler; -class CPDFSDK_ActionHandler; -class CPDFSDK_AnnotHandlerMgr; -class CPDFSDK_Document; -class IJS_Runtime; - -class CPDFSDK_Environment final { - public: - CPDFSDK_Environment(UnderlyingDocumentType* pDoc, FPDF_FORMFILLINFO* pFFinfo); - ~CPDFSDK_Environment(); - - void Invalidate(FPDF_PAGE page, - double left, - double top, - double right, - double bottom); - void OutputSelectedRect(FPDF_PAGE page, - double left, - double top, - double right, - double bottom); - - void SetCursor(int nCursorType); - int SetTimer(int uElapse, TimerCallback lpTimerFunc); - void KillTimer(int nTimerID); - FX_SYSTEMTIME GetLocalTime() const; - - void OnChange(); - FX_BOOL IsSHIFTKeyDown(uint32_t nFlag) const; - FX_BOOL IsCTRLKeyDown(uint32_t nFlag) const; - FX_BOOL IsALTKeyDown(uint32_t nFlag) const; - - FPDF_PAGE GetPage(FPDF_DOCUMENT document, int nPageIndex); - FPDF_PAGE GetCurrentPage(FPDF_DOCUMENT document); - - void ExecuteNamedAction(const FX_CHAR* namedAction); - void OnSetFieldInputFocus(FPDF_WIDESTRING focusText, - FPDF_DWORD nTextLen, - FX_BOOL bFocus); - void DoURIAction(const FX_CHAR* bsURI); - void DoGoToAction(int nPageIndex, - int zoomMode, - float* fPosArray, - int sizeOfArray); - -#ifdef PDF_ENABLE_XFA - void DisplayCaret(FPDF_PAGE page, - FPDF_BOOL bVisible, - double left, - double top, - double right, - double bottom); - int GetCurrentPageIndex(FPDF_DOCUMENT document); - void SetCurrentPage(FPDF_DOCUMENT document, int iCurPage); - - // TODO(dsinclair): This should probably change to PDFium? - CFX_WideString FFI_GetAppName() const { return CFX_WideString(L"Acrobat"); } - - CFX_WideString GetPlatform(); - void GotoURL(FPDF_DOCUMENT document, const CFX_WideStringC& wsURL); - void GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect); - FX_BOOL PopupMenu(FPDF_PAGE page, - FPDF_WIDGET hWidget, - int menuFlag, - CFX_PointF pt); - - void Alert(FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon); - void EmailTo(FPDF_FILEHANDLER* fileHandler, - FPDF_WIDESTRING pTo, - FPDF_WIDESTRING pSubject, - FPDF_WIDESTRING pCC, - FPDF_WIDESTRING pBcc, - FPDF_WIDESTRING pMsg); - void UploadTo(FPDF_FILEHANDLER* fileHandler, - int fileFlag, - FPDF_WIDESTRING uploadTo); - FPDF_FILEHANDLER* OpenFile(int fileType, - FPDF_WIDESTRING wsURL, - const char* mode); - IFX_FileRead* DownloadFromURL(const FX_WCHAR* url); - CFX_WideString PostRequestURL(const FX_WCHAR* wsURL, - const FX_WCHAR* wsData, - const FX_WCHAR* wsContentType, - const FX_WCHAR* wsEncode, - const FX_WCHAR* wsHeader); - FPDF_BOOL PutRequestURL(const FX_WCHAR* wsURL, - const FX_WCHAR* wsData, - const FX_WCHAR* wsEncode); - CFX_WideString GetLanguage(); - - void PageEvent(int iPageCount, uint32_t dwEventType) const; -#endif // PDF_ENABLE_XFA - - int JS_appAlert(const FX_WCHAR* Msg, - const FX_WCHAR* Title, - uint32_t Type, - uint32_t Icon); - int JS_appResponse(const FX_WCHAR* Question, - const FX_WCHAR* Title, - const FX_WCHAR* Default, - const FX_WCHAR* cLabel, - FPDF_BOOL bPassword, - void* response, - int length); - void JS_appBeep(int nType); - CFX_WideString JS_fieldBrowse(); - CFX_WideString JS_docGetFilePath(); - void JS_docSubmitForm(void* formData, int length, const FX_WCHAR* URL); - void JS_docmailForm(void* mailData, - int length, - FPDF_BOOL bUI, - const FX_WCHAR* To, - const FX_WCHAR* Subject, - const FX_WCHAR* CC, - const FX_WCHAR* BCC, - const FX_WCHAR* Msg); - void JS_docprint(FPDF_BOOL bUI, - int nStart, - int nEnd, - FPDF_BOOL bSilent, - FPDF_BOOL bShrinkToFit, - FPDF_BOOL bPrintAsImage, - FPDF_BOOL bReverse, - FPDF_BOOL bAnnotations); - void JS_docgotoPage(int nPageNum); - - FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; } - void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; } - CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; } - UnderlyingDocumentType* GetUnderlyingDocument() const { - return m_pUnderlyingDoc; - } - CFX_ByteString GetAppName() const { return ""; } - CFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } - FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } - - // Creates if not present. - CFFL_InteractiveFormFiller* GetInteractiveFormFiller(); - CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. - IJS_Runtime* GetJSRuntime(); // Creates if not present. - CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. - - private: - std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; - std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; - std::unique_ptr<IJS_Runtime> m_pJSRuntime; - FPDF_FORMFILLINFO* const m_pInfo; - // Ownership of |m_pSDKDoc| depends on if this is XFA. If we're in XFA then - // the object is owned by the CPDFXFA_Document. In non-xfa then we own - // the pointer. - CPDFSDK_Document* m_pSDKDoc; - UnderlyingDocumentType* const m_pUnderlyingDoc; - std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller; - std::unique_ptr<CFX_SystemHandler> m_pSysHandler; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_ENVIRONMENT_H_ diff --git a/fpdfsdk/include/cpdfsdk_interform.h b/fpdfsdk/include/cpdfsdk_interform.h deleted file mode 100644 index 133fe90341..0000000000 --- a/fpdfsdk/include/cpdfsdk_interform.h +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_INTERFORM_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_INTERFORM_H_ - -#include <map> -#include <vector> - -#include "core/fpdfdoc/cpdf_action.h" -#include "core/fpdfdoc/ipdf_formnotify.h" -#include "core/fxcrt/fx_basic.h" -#include "core/fxge/fx_dib.h" - -class CPDF_Dictionary; -class CPDF_FormControl; -class CPDF_FormField; -class CPDF_InterForm; -class CPDF_Object; -class CPDFSDK_Document; -class CPDFSDK_Widget; - -#ifdef PDF_ENABLE_XFA -class CPDFSDK_XFAWidget; -class CXFA_FFWidget; -#endif // PDF_ENABLE_XFA - -class CPDFSDK_InterForm : public IPDF_FormNotify { - public: - explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); - ~CPDFSDK_InterForm() override; - - CPDF_InterForm* GetInterForm() const { return m_pInterForm.get(); } - CPDFSDK_Document* GetDocument() const { return m_pDocument; } - - FX_BOOL HighlightWidgets(); - - CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; - CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl, - bool createIfNeeded) const; - void GetWidgets(const CFX_WideString& sFieldName, - std::vector<CPDFSDK_Widget*>* widgets) const; - void GetWidgets(CPDF_FormField* pField, - std::vector<CPDFSDK_Widget*>* widgets) const; - - void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); - void RemoveMap(CPDF_FormControl* pControl); - - void EnableCalculate(FX_BOOL bEnabled); - FX_BOOL IsCalculateEnabled() const; - -#ifdef PDF_ENABLE_XFA - void AddXFAMap(CXFA_FFWidget* hWidget, CPDFSDK_XFAWidget* pWidget); - void RemoveXFAMap(CXFA_FFWidget* hWidget); - CPDFSDK_XFAWidget* GetXFAWidget(CXFA_FFWidget* hWidget); - void XfaEnableCalculate(FX_BOOL bEnabled); - FX_BOOL IsXfaCalculateEnabled() const; - FX_BOOL IsXfaValidationsEnabled(); - void XfaSetValidationsEnabled(FX_BOOL bEnabled); - void SynchronizeField(CPDF_FormField* pFormField, FX_BOOL bSynchronizeElse); -#endif // PDF_ENABLE_XFA - - FX_BOOL OnKeyStrokeCommit(CPDF_FormField* pFormField, - const CFX_WideString& csValue); - FX_BOOL OnValidate(CPDF_FormField* pFormField, const CFX_WideString& csValue); - void OnCalculate(CPDF_FormField* pFormField = nullptr); - CFX_WideString OnFormat(CPDF_FormField* pFormField, FX_BOOL& bFormatted); - - void ResetFieldAppearance(CPDF_FormField* pFormField, - const CFX_WideString* sValue, - FX_BOOL bValueChanged); - void UpdateField(CPDF_FormField* pFormField); - - FX_BOOL DoAction_Hide(const CPDF_Action& action); - FX_BOOL DoAction_SubmitForm(const CPDF_Action& action); - FX_BOOL DoAction_ResetForm(const CPDF_Action& action); - FX_BOOL DoAction_ImportData(const CPDF_Action& action); - - std::vector<CPDF_FormField*> GetFieldFromObjects( - const std::vector<CPDF_Object*>& objects) const; - FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict); - FX_BOOL SubmitFields(const CFX_WideString& csDestination, - const std::vector<CPDF_FormField*>& fields, - bool bIncludeOrExclude, - bool bUrlEncoded); - FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); - FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); - FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields, - bool bIncludeOrExclude, - CFX_ByteTextBuf& textBuf); - CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); - - FX_BOOL IsNeedHighLight(int nFieldType); - void RemoveAllHighLight(); - void SetHighlightAlpha(uint8_t alpha) { m_iHighlightAlpha = alpha; } - uint8_t GetHighlightAlpha() { return m_iHighlightAlpha; } - void SetHighlightColor(FX_COLORREF clr, int nFieldType); - FX_COLORREF GetHighlightColor(int nFieldType); - - private: - // IPDF_FormNotify: - int BeforeValueChange(CPDF_FormField* pField, - const CFX_WideString& csValue) override; - void AfterValueChange(CPDF_FormField* pField) override; - int BeforeSelectionChange(CPDF_FormField* pField, - const CFX_WideString& csValue) override; - void AfterSelectionChange(CPDF_FormField* pField) override; - void AfterCheckedStatusChange(CPDF_FormField* pField) override; - int BeforeFormReset(CPDF_InterForm* pForm) override; - void AfterFormReset(CPDF_InterForm* pForm) override; - int BeforeFormImportData(CPDF_InterForm* pForm) override; - void AfterFormImportData(CPDF_InterForm* pForm) override; - - FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, - CFX_WideString csTxtFile); - FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); - int GetPageIndexByAnnotDict(CPDF_Document* pDocument, - CPDF_Dictionary* pAnnotDict) const; - - using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; - - CPDFSDK_Document* m_pDocument; - std::unique_ptr<CPDF_InterForm> m_pInterForm; - CPDFSDK_WidgetMap m_Map; -#ifdef PDF_ENABLE_XFA - std::map<CXFA_FFWidget*, CPDFSDK_XFAWidget*> m_XFAMap; - FX_BOOL m_bXfaCalculate; - FX_BOOL m_bXfaValidationsEnabled; - static const int kNumFieldTypes = 7; -#else // PDF_ENABLE_XFA - static const int kNumFieldTypes = 6; -#endif // PDF_ENABLE_XFA - FX_BOOL m_bCalculate; - FX_BOOL m_bBusy; - - FX_COLORREF m_aHighlightColor[kNumFieldTypes]; - uint8_t m_iHighlightAlpha; - FX_BOOL m_bNeedHightlight[kNumFieldTypes]; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_INTERFORM_H_ diff --git a/fpdfsdk/include/cpdfsdk_pageview.h b/fpdfsdk/include/cpdfsdk_pageview.h deleted file mode 100644 index c31f6d3fb1..0000000000 --- a/fpdfsdk/include/cpdfsdk_pageview.h +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_PAGEVIEW_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_PAGEVIEW_H_ - -#include <memory> -#include <vector> - -#include "core/fpdfapi/fpdf_page/cpdf_page.h" -#include "core/fxcrt/fx_system.h" -#include "fpdfsdk/include/cpdfsdk_annot.h" -#include "fpdfsdk/include/cpdfsdk_document.h" - -class CFX_RenderDevice; -class CPDF_AnnotList; -class CPDF_RenderOptions; - -class CPDFSDK_PageView final : public CPDF_Page::View { - public: - CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); - ~CPDFSDK_PageView(); - -#ifdef PDF_ENABLE_XFA - void PageView_OnDraw(CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - CPDF_RenderOptions* pOptions, - const FX_RECT& pClip); -#else // PDF_ENABLE_XFA - void PageView_OnDraw(CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - CPDF_RenderOptions* pOptions); -#endif // PDF_ENABLE_XFA - - const CPDF_Annot* GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); - CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); - const CPDF_Annot* GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); - CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); - CPDFSDK_Annot* GetFocusAnnot(); - void SetFocusAnnot(CPDFSDK_Annot::ObservedPtr* pSDKAnnot, - uint32_t nFlag = 0) { - m_pSDKDoc->SetFocusAnnot(pSDKAnnot, nFlag); - } - FX_BOOL KillFocusAnnot(uint32_t nFlag = 0) { - return m_pSDKDoc->KillFocusAnnot(nFlag); - } - void KillFocusAnnotIfNeeded(); - - CPDFSDK_Annot* AddAnnot(CPDF_Dictionary* pDict); - CPDFSDK_Annot* AddAnnot(const FX_CHAR* lpSubType, CPDF_Dictionary* pDict); - CPDFSDK_Annot* AddAnnot(CPDF_Annot* pPDFAnnot); - - FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot); - size_t CountAnnots() const; - CPDFSDK_Annot* GetAnnot(size_t nIndex); - CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary* pDict); - -#ifdef PDF_ENABLE_XFA - CPDFSDK_Annot* AddAnnot(CXFA_FFWidget* pPDFAnnot); - CPDFSDK_Annot* GetAnnotByXFAWidget(CXFA_FFWidget* hWidget); - CPDFXFA_Page* GetPDFXFAPage() { return m_page; } -#endif // PDF_ENABLE_XFA - - CPDF_Page* GetPDFPage() const; - CPDF_Document* GetPDFDocument(); - CPDFSDK_Document* GetSDKDocument() { return m_pSDKDoc; } - FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); - FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); -#ifdef PDF_ENABLE_XFA - FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, uint32_t nFlag); - FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag); -#endif // PDF_ENABLE_XFA - FX_BOOL OnChar(int nChar, uint32_t nFlag); - FX_BOOL OnKeyDown(int nKeyCode, int nFlag); - FX_BOOL OnKeyUp(int nKeyCode, int nFlag); - - FX_BOOL OnMouseMove(const CFX_FloatPoint& point, int nFlag); - FX_BOOL OnMouseWheel(double deltaX, - double deltaY, - const CFX_FloatPoint& point, - int nFlag); - bool IsValidAnnot(const CPDF_Annot* p) const; - void GetCurrentMatrix(CFX_Matrix& matrix) { matrix = m_curMatrix; } - void UpdateRects(const std::vector<CFX_FloatRect>& rects); - void UpdateView(CPDFSDK_Annot* pAnnot); - const std::vector<CPDFSDK_Annot*>& GetAnnotList() const { - return m_fxAnnotArray; - } - - int GetPageIndex() const; - void LoadFXAnnots(); - void ClearFXAnnots(); - void SetValid(FX_BOOL bValid) { m_bValid = bValid; } - FX_BOOL IsValid() { return m_bValid; } - void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; } - FX_BOOL IsLocked() { return m_bLocked; } -#ifndef PDF_ENABLE_XFA - bool OwnsPage() const { return m_bOwnsPage; } - void TakePageOwnership() { m_bOwnsPage = true; } -#endif // PDF_ENABLE_XFA - - private: - int GetPageIndexForStaticPDF() const; - - CFX_Matrix m_curMatrix; - UnderlyingPageType* const m_page; - std::unique_ptr<CPDF_AnnotList> m_pAnnotList; - std::vector<CPDFSDK_Annot*> m_fxAnnotArray; - CPDFSDK_Document* const m_pSDKDoc; - CPDFSDK_Annot::ObservedPtr m_pCaptureWidget; -#ifndef PDF_ENABLE_XFA - bool m_bOwnsPage; -#endif // PDF_ENABLE_XFA - FX_BOOL m_bEnterWidget; - FX_BOOL m_bExitWidget; - FX_BOOL m_bOnWidget; - FX_BOOL m_bValid; - FX_BOOL m_bLocked; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_PAGEVIEW_H_ diff --git a/fpdfsdk/include/cpdfsdk_widget.h b/fpdfsdk/include/cpdfsdk_widget.h deleted file mode 100644 index 8c10a21b9c..0000000000 --- a/fpdfsdk/include/cpdfsdk_widget.h +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ - -#include <set> - -#include "core/fpdfdoc/cpdf_aaction.h" -#include "core/fpdfdoc/cpdf_action.h" -#include "core/fpdfdoc/cpdf_annot.h" -#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_string.h" -#include "fpdfsdk/include/cpdfsdk_baannot.h" -#include "fpdfsdk/include/pdfsdk_fieldaction.h" -#include "fpdfsdk/pdfwindow/PWL_Wnd.h" - -class CFX_RenderDevice; -class CPDF_Annot; -class CPDF_Dictionary; -class CPDF_FormControl; -class CPDF_FormField; -class CPDF_RenderOptions; -class CPDF_Stream; -class CPDFSDK_InterForm; -class CPDFSDK_PageView; - -#ifdef PDF_ENABLE_XFA -class CXFA_FFWidget; -class CXFA_FFWidgetHandler; -#endif // PDF_ENABLE_XFA - -class CPDFSDK_Widget : public CPDFSDK_BAAnnot { - public: -#ifdef PDF_ENABLE_XFA - CXFA_FFWidget* GetMixXFAWidget() const; - CXFA_FFWidget* GetGroupMixXFAWidget(); - CXFA_FFWidgetHandler* GetXFAWidgetHandler() const; - - FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT); - FX_BOOL OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, - PDFSDK_FieldAction& data, - CPDFSDK_PageView* pPageView); - - void Synchronize(FX_BOOL bSynchronizeElse); - void SynchronizeXFAValue(); - void SynchronizeXFAItems(); - - static void SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, - CXFA_FFWidget* hWidget, - CPDF_FormField* pFormField, - CPDF_FormControl* pFormControl); - static void SynchronizeXFAItems(CXFA_FFDocView* pXFADocView, - CXFA_FFWidget* hWidget, - CPDF_FormField* pFormField, - CPDF_FormControl* pFormControl); -#endif // PDF_ENABLE_XFA - - CPDFSDK_Widget(CPDF_Annot* pAnnot, - CPDFSDK_PageView* pPageView, - CPDFSDK_InterForm* pInterForm); - ~CPDFSDK_Widget() override; - - bool IsSignatureWidget() const override; - CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; - FX_BOOL IsAppearanceValid() override; - - int GetLayoutOrder() const override; - - int GetFieldType() const; - int GetFieldFlags() const; - int GetRotate() const; - - FX_BOOL GetFillColor(FX_COLORREF& color) const; - FX_BOOL GetBorderColor(FX_COLORREF& color) const; - FX_BOOL GetTextColor(FX_COLORREF& color) const; - FX_FLOAT GetFontSize() const; - - int GetSelectedIndex(int nIndex) const; -#ifndef PDF_ENABLE_XFA - CFX_WideString GetValue() const; -#else - CFX_WideString GetValue(FX_BOOL bDisplay = TRUE) const; -#endif // PDF_ENABLE_XFA - CFX_WideString GetDefaultValue() const; - CFX_WideString GetOptionLabel(int nIndex) const; - int CountOptions() const; - FX_BOOL IsOptionSelected(int nIndex) const; - int GetTopVisibleIndex() const; - bool IsChecked() const; - int GetAlignment() const; - int GetMaxLen() const; -#ifdef PDF_ENABLE_XFA - CFX_WideString GetName() const; -#endif // PDF_ENABLE_XFA - CFX_WideString GetAlternateName() const; - - void SetCheck(bool bChecked, bool bNotify); - void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify); - void SetDefaultValue(const CFX_WideString& sValue); - void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify); - void ClearSelection(FX_BOOL bNotify); - void SetTopVisibleIndex(int index); - -#ifdef PDF_ENABLE_XFA - void ResetAppearance(FX_BOOL bValueChanged); -#endif // PDF_ENABLE_XFA - void ResetAppearance(const CFX_WideString* sValue, FX_BOOL bValueChanged); - void ResetFieldAppearance(FX_BOOL bValueChanged); - void UpdateField(); - CFX_WideString OnFormat(FX_BOOL& bFormatted); - - FX_BOOL OnAAction(CPDF_AAction::AActionType type, - PDFSDK_FieldAction& data, - CPDFSDK_PageView* pPageView); - - CPDFSDK_InterForm* GetInterForm() const { return m_pInterForm; } - CPDF_FormField* GetFormField() const; - CPDF_FormControl* GetFormControl() const; - static CPDF_FormControl* GetFormControl(CPDF_InterForm* pInterForm, - const CPDF_Dictionary* pAnnotDict); - - void DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView); - - void SetAppModified(); - void ClearAppModified(); - FX_BOOL IsAppModified() const; - - int32_t GetAppearanceAge() const; - int32_t GetValueAge() const; - - FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); - void DrawAppearance(CFX_RenderDevice* pDevice, - const CFX_Matrix* pUser2Device, - CPDF_Annot::AppearanceMode mode, - const CPDF_RenderOptions* pOptions) override; - - FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); - - private: - void ResetAppearance_PushButton(); - void ResetAppearance_CheckBox(); - void ResetAppearance_RadioButton(); - void ResetAppearance_ComboBox(const CFX_WideString* sValue); - void ResetAppearance_ListBox(); - void ResetAppearance_TextField(const CFX_WideString* sValue); - - CFX_FloatRect GetClientRect() const; - CFX_FloatRect GetRotatedRect() const; - - CFX_ByteString GetBackgroundAppStream() const; - CFX_ByteString GetBorderAppStream() const; - CFX_Matrix GetMatrix() const; - - CPWL_Color GetTextPWLColor() const; - CPWL_Color GetBorderPWLColor() const; - CPWL_Color GetFillPWLColor() const; - - void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage); - void RemoveAppearance(const CFX_ByteString& sAPType); - - CPDFSDK_InterForm* const m_pInterForm; - FX_BOOL m_bAppModified; - int32_t m_nAppAge; - int32_t m_nValueAge; - -#ifdef PDF_ENABLE_XFA - mutable CXFA_FFWidget* m_hMixXFAWidget; - mutable CXFA_FFWidgetHandler* m_pWidgetHandler; -#endif // PDF_ENABLE_XFA -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_WIDGET_H_ diff --git a/fpdfsdk/include/cpdfsdk_widgethandler.h b/fpdfsdk/include/cpdfsdk_widgethandler.h deleted file mode 100644 index ca3da87ff6..0000000000 --- a/fpdfsdk/include/cpdfsdk_widgethandler.h +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_WIDGETHANDLER_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_WIDGETHANDLER_H_ - -#include "core/fxcrt/fx_basic.h" -#include "core/fxcrt/fx_coordinates.h" -#include "fpdfsdk/include/ipdfsdk_annothandler.h" - -class CFFL_InteractiveFormFiller; -class CFX_Matrix; -class CFX_RenderDevice; -class CPDF_Annot; -class CPDFSDK_Annot; -class CPDFSDK_Environment; -class CPDFSDK_PageView; - -#ifdef PDF_ENABLE_XFA -class CXFA_FFWidget; -#endif // PDF_ENABLE_XFA - -class CPDFSDK_WidgetHandler : public IPDFSDK_AnnotHandler { - public: - explicit CPDFSDK_WidgetHandler(CPDFSDK_Environment* pApp); - ~CPDFSDK_WidgetHandler() override; - - FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; - CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; -#ifdef PDF_ENABLE_XFA - CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, - CPDFSDK_PageView* pPage) override; -#endif // PDF_ENABLE_XFA - void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; - void DeleteAnnot(CPDFSDK_Annot* pAnnot) override; - CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) override; - FX_BOOL HitTest(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) override; - void OnDraw(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - bool bDrawAnnots) override; - void OnCreate(CPDFSDK_Annot* pAnnot) override; - void OnLoad(CPDFSDK_Annot* pAnnot) override; - void OnDelete(CPDFSDK_Annot* pAnnot) override; - void OnRelease(CPDFSDK_Annot* pAnnot) override; - - void OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - void OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - short zDelta, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, - uint32_t nChar, - uint32_t nFlags) override; - FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; - FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; - void OnDeSelected(CPDFSDK_Annot* pAnnot) override {} - void OnSelected(CPDFSDK_Annot* pAnnot) override {} - FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; -#ifdef PDF_ENABLE_XFA - FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, - CPDFSDK_Annot::ObservedPtr* pNewAnnot) override; -#endif // PDF_ENABLE_XFA - - void SetFormFiller(CFFL_InteractiveFormFiller* pFiller) { - m_pFormFiller = pFiller; - } - CFFL_InteractiveFormFiller* GetFormFiller() { return m_pFormFiller; } - - private: - CPDFSDK_Environment* m_pEnv; - CFFL_InteractiveFormFiller* m_pFormFiller; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_WIDGETHANDLER_H_ diff --git a/fpdfsdk/include/cpdfsdk_xfawidget.h b/fpdfsdk/include/cpdfsdk_xfawidget.h deleted file mode 100644 index 99309b9684..0000000000 --- a/fpdfsdk/include/cpdfsdk_xfawidget.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGET_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGET_H_ - -#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_string.h" -#include "fpdfsdk/include/cpdfsdk_annot.h" - -class CPDFSDK_InterForm; -class CPDFSDK_PageView; -class CXFA_FFWidget; - -class CPDFSDK_XFAWidget : public CPDFSDK_Annot { - public: - CPDFSDK_XFAWidget(CXFA_FFWidget* pAnnot, - CPDFSDK_PageView* pPageView, - CPDFSDK_InterForm* pInterForm); - ~CPDFSDK_XFAWidget() override {} - - FX_BOOL IsXFAField() override; - CXFA_FFWidget* GetXFAWidget() const override; - CPDF_Annot::Subtype GetAnnotSubtype() const override; - CFX_FloatRect GetRect() const override; - - CPDFSDK_InterForm* GetInterForm() { return m_pInterForm; } - - private: - CPDFSDK_InterForm* m_pInterForm; - CXFA_FFWidget* m_hXFAWidget; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGET_H_ diff --git a/fpdfsdk/include/cpdfsdk_xfawidgethandler.h b/fpdfsdk/include/cpdfsdk_xfawidgethandler.h deleted file mode 100644 index 425c57c03d..0000000000 --- a/fpdfsdk/include/cpdfsdk_xfawidgethandler.h +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGETHANDLER_H_ -#define FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGETHANDLER_H_ - -#include "core/fxcrt/fx_basic.h" -#include "core/fxcrt/fx_coordinates.h" -#include "fpdfsdk/include/ipdfsdk_annothandler.h" - -class CFX_Matrix; -class CFX_RenderDevice; -class CPDF_Annot; -class CPDFSDK_Environment; -class CPDFSDK_Annot; -class CPDFSDK_PageView; -class CXFA_FFWidget; -class CXFA_FFWidgetHandler; - -class CPDFSDK_XFAWidgetHandler : public IPDFSDK_AnnotHandler { - public: - explicit CPDFSDK_XFAWidgetHandler(CPDFSDK_Environment* pApp); - ~CPDFSDK_XFAWidgetHandler() override; - - FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; - CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; - CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot, - CPDFSDK_PageView* pPage) override; - void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; - void DeleteAnnot(CPDFSDK_Annot* pAnnot) override; - CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) override; - FX_BOOL HitTest(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) override; - void OnDraw(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - bool bDrawAnnots) override; - void OnCreate(CPDFSDK_Annot* pAnnot) override; - void OnLoad(CPDFSDK_Annot* pAnnot) override; - void OnDelete(CPDFSDK_Annot* pAnnot) override; - void OnRelease(CPDFSDK_Annot* pAnnot) override; - void OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - void OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - short zDelta, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) override; - FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, - uint32_t nChar, - uint32_t nFlags) override; - FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; - FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; - void OnDeSelected(CPDFSDK_Annot* pAnnot) override; - void OnSelected(CPDFSDK_Annot* pAnnot) override; - FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) override; - FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, - CPDFSDK_Annot::ObservedPtr* pNewAnnot) override; - - private: - CXFA_FFWidgetHandler* GetXFAWidgetHandler(CPDFSDK_Annot* pAnnot); - uint32_t GetFWLFlags(uint32_t dwFlag); - - CPDFSDK_Environment* m_pEnv; -}; - -#endif // FPDFSDK_INCLUDE_CPDFSDK_XFAWIDGETHANDLER_H_ diff --git a/fpdfsdk/include/fsdk_actionhandler.h b/fpdfsdk/include/fsdk_actionhandler.h deleted file mode 100644 index ce15b83295..0000000000 --- a/fpdfsdk/include/fsdk_actionhandler.h +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ -#define FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ - -#include <memory> -#include <set> - -#include "core/fpdfdoc/cpdf_aaction.h" -#include "core/fpdfdoc/cpdf_action.h" -#include "core/fxcrt/fx_string.h" -#include "fpdfsdk/include/pdfsdk_fieldaction.h" - -class CPDFSDK_Annot; -class CPDFSDK_Document; -class CPDF_Bookmark; -class CPDF_Dictionary; -class CPDF_FormField; - -class CPDFSDK_ActionHandler { - public: - FX_BOOL DoAction_DocOpen(const CPDF_Action& action, - CPDFSDK_Document* pDocument); - FX_BOOL DoAction_JavaScript(const CPDF_Action& JsAction, - CFX_WideString csJSName, - CPDFSDK_Document* pDocument); - FX_BOOL DoAction_Page(const CPDF_Action& action, - enum CPDF_AAction::AActionType eType, - CPDFSDK_Document* pDocument); - FX_BOOL DoAction_Document(const CPDF_Action& action, - enum CPDF_AAction::AActionType eType, - CPDFSDK_Document* pDocument); - FX_BOOL DoAction_BookMark(CPDF_Bookmark* pBookMark, - const CPDF_Action& action, - CPDF_AAction::AActionType type, - CPDFSDK_Document* pDocument); - FX_BOOL DoAction_Screen(const CPDF_Action& action, - CPDF_AAction::AActionType type, - CPDFSDK_Document* pDocument, - CPDFSDK_Annot* pScreen); - FX_BOOL DoAction_Link(const CPDF_Action& action, CPDFSDK_Document* pDocument); - FX_BOOL DoAction_Field(const CPDF_Action& action, - CPDF_AAction::AActionType type, - CPDFSDK_Document* pDocument, - CPDF_FormField* pFormField, - PDFSDK_FieldAction& data); - FX_BOOL DoAction_FieldJavaScript(const CPDF_Action& JsAction, - CPDF_AAction::AActionType type, - CPDFSDK_Document* pDocument, - CPDF_FormField* pFormField, - PDFSDK_FieldAction& data); - - private: - FX_BOOL ExecuteDocumentOpenAction(const CPDF_Action& action, - CPDFSDK_Document* pDocument, - std::set<CPDF_Dictionary*>* visited); - FX_BOOL ExecuteDocumentPageAction(const CPDF_Action& action, - CPDF_AAction::AActionType type, - CPDFSDK_Document* pDocument, - std::set<CPDF_Dictionary*>* visited); - FX_BOOL ExecuteFieldAction(const CPDF_Action& action, - CPDF_AAction::AActionType type, - CPDFSDK_Document* pDocument, - CPDF_FormField* pFormField, - PDFSDK_FieldAction& data, - std::set<CPDF_Dictionary*>* visited); - FX_BOOL ExecuteScreenAction(const CPDF_Action& action, - CPDF_AAction::AActionType type, - CPDFSDK_Document* pDocument, - CPDFSDK_Annot* pScreen, - std::set<CPDF_Dictionary*>* visited); - FX_BOOL ExecuteBookMark(const CPDF_Action& action, - CPDFSDK_Document* pDocument, - CPDF_Bookmark* pBookmark, - std::set<CPDF_Dictionary*>* visited); - FX_BOOL ExecuteLinkAction(const CPDF_Action& action, - CPDFSDK_Document* pDocument, - std::set<CPDF_Dictionary*>* visited); - - void DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument); - void RunDocumentPageJavaScript(CPDFSDK_Document* pDocument, - CPDF_AAction::AActionType type, - const CFX_WideString& script); - void RunDocumentOpenJavaScript(CPDFSDK_Document* pDocument, - const CFX_WideString& sScriptName, - const CFX_WideString& script); - void RunFieldJavaScript(CPDFSDK_Document* pDocument, - CPDF_FormField* pFormField, - CPDF_AAction::AActionType type, - PDFSDK_FieldAction& data, - const CFX_WideString& script); - - FX_BOOL IsValidField(CPDFSDK_Document* pDocument, - CPDF_Dictionary* pFieldDict); - FX_BOOL IsValidDocView(CPDFSDK_Document* pDocument); - - void DoAction_GoTo(CPDFSDK_Document* pDocument, const CPDF_Action& action); - void DoAction_GoToR(CPDFSDK_Document* pDocument, const CPDF_Action& action); - void DoAction_Launch(CPDFSDK_Document* pDocument, const CPDF_Action& action); - void DoAction_URI(CPDFSDK_Document* pDocument, const CPDF_Action& action); - void DoAction_Named(CPDFSDK_Document* pDocument, const CPDF_Action& action); - void DoAction_SetOCGState(CPDFSDK_Document* pDocument, - const CPDF_Action& action); - - FX_BOOL DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument); - FX_BOOL DoAction_SubmitForm(const CPDF_Action& action, - CPDFSDK_Document* pDocument); - FX_BOOL DoAction_ResetForm(const CPDF_Action& action, - CPDFSDK_Document* pDocument); - FX_BOOL DoAction_ImportData(const CPDF_Action& action, - CPDFSDK_Document* pDocument); -}; - -#endif // FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ diff --git a/fpdfsdk/include/fsdk_common.h b/fpdfsdk/include/fsdk_common.h deleted file mode 100644 index a33958a08d..0000000000 --- a/fpdfsdk/include/fsdk_common.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_FSDK_COMMON_H_ -#define FPDFSDK_INCLUDE_FSDK_COMMON_H_ - -// for all fields -#define FIELDFLAG_READONLY 1 -#define FIELDFLAG_REQUIRED 2 -#define FIELDFLAG_NOEXPORT 4 -// for text fields -#define FIELDFLAG_MULTILINE (1 << 12) -#define FIELDFLAG_PASSWORD (1 << 13) -#define FIELDFLAG_FILESELECT (1 << 20) -#define FIELDFLAG_DONOTSPELLCHECK (1 << 22) -#define FIELDFLAG_DONOTSCROLL (1 << 23) -#define FIELDFLAG_COMB (1 << 24) -#define FIELDFLAG_RICHTEXT (1 << 25) -// for button fileds -#define FIELDFLAG_NOTOGGLETOOFF (1 << 14) -#define FIELDFLAG_RADIO (1 << 15) -#define FIELDFLAG_PUSHBUTTON (1 << 16) -#define FIELDFLAG_RADIOSINUNISON (1 << 27) -// for choice fields -#define FIELDFLAG_COMBO (1 << 17) -#define FIELDFLAG_EDIT (1 << 18) -#define FIELDFLAG_SORT (1 << 19) -#define FIELDFLAG_MULTISELECT (1 << 21) -#define FIELDFLAG_COMMITONSELCHANGE (1 << 26) - -#endif // FPDFSDK_INCLUDE_FSDK_COMMON_H_ diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h deleted file mode 100644 index d6e98731d8..0000000000 --- a/fpdfsdk/include/fsdk_define.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_ -#define FPDFSDK_INCLUDE_FSDK_DEFINE_H_ - -#include "core/fpdfapi/fpdf_parser/cpdf_parser.h" -#include "core/fxge/fx_dib.h" -#include "public/fpdfview.h" - -#ifdef PDF_ENABLE_XFA -#include "fpdfsdk/fpdfxfa/fpdfxfa_doc.h" -#endif // PDF_ENABLE_XFA - -#ifdef _WIN32 -#include <math.h> -#include <tchar.h> -#endif - -class CPDF_Annot; -class CPDF_Page; -class CPDF_PageRenderContext; -class IFSDK_PAUSE_Adapter; - -class CPDF_CustomAccess final : public IFX_FileRead { - public: - explicit CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); - ~CPDF_CustomAccess() override {} - - // IFX_FileRead - FX_FILESIZE GetSize() override; - void Release() override; - FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; - -#ifdef PDF_ENABLE_XFA - virtual CFX_ByteString GetFullPath(); - virtual FX_BOOL GetByte(uint32_t pos, uint8_t& ch); - virtual FX_BOOL GetBlock(uint32_t pos, uint8_t* pBuf, uint32_t size); -#endif // PDF_ENABLE_XFA - - private: - FPDF_FILEACCESS m_FileAccess; -#ifdef PDF_ENABLE_XFA - uint8_t m_Buffer[512]; - uint32_t m_BufferOffset; -#endif // PDF_ENABLE_XFA -}; - -#ifdef PDF_ENABLE_XFA -class CFPDF_FileStream : public IFX_FileStream { - public: - explicit CFPDF_FileStream(FPDF_FILEHANDLER* pFS); - ~CFPDF_FileStream() override {} - - // IFX_FileStream: - IFX_FileStream* Retain() override; - void Release() override; - FX_FILESIZE GetSize() override; - FX_BOOL IsEOF() override; - FX_FILESIZE GetPosition() override; - FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; - size_t ReadBlock(void* buffer, size_t size) override; - FX_BOOL WriteBlock(const void* buffer, - FX_FILESIZE offset, - size_t size) override; - FX_BOOL Flush() override; - - void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; } - - protected: - FPDF_FILEHANDLER* m_pFS; - FX_FILESIZE m_nCurPos; -}; -#endif // PDF_ENABLE_XFA - -// Object types for public FPDF_ types; these correspond to next layer down -// from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are -// CPDFXFA_ types. -#ifndef PDF_ENABLE_XFA -using UnderlyingDocumentType = CPDF_Document; -using UnderlyingPageType = CPDF_Page; -#else // PDF_ENABLE_XFA -using UnderlyingDocumentType = CPDFXFA_Document; -using UnderlyingPageType = CPDFXFA_Page; -#endif // PDF_ENABLE_XFA - -// Conversions to/from underlying types. -UnderlyingDocumentType* UnderlyingFromFPDFDocument(FPDF_DOCUMENT doc); -FPDF_DOCUMENT FPDFDocumentFromUnderlying(UnderlyingDocumentType* doc); - -UnderlyingPageType* UnderlyingFromFPDFPage(FPDF_PAGE page); - -// Conversions to/from FPDF_ types. -CPDF_Document* CPDFDocumentFromFPDFDocument(FPDF_DOCUMENT doc); -FPDF_DOCUMENT FPDFDocumentFromCPDFDocument(CPDF_Document* doc); - -CPDF_Page* CPDFPageFromFPDFPage(FPDF_PAGE page); - -CFX_DIBitmap* CFXBitmapFromFPDFBitmap(FPDF_BITMAP bitmap); - -void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable); -FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy); -void FPDF_RenderPage_Retail(CPDF_PageRenderContext* pContext, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags, - FX_BOOL bNeedToRestore, - IFSDK_PAUSE_Adapter* pause); - -void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code); -void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); -void ProcessParseError(CPDF_Parser::Error err); - -#endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ diff --git a/fpdfsdk/include/fsdk_pauseadapter.h b/fpdfsdk/include/fsdk_pauseadapter.h deleted file mode 100644 index 4a37f5ce52..0000000000 --- a/fpdfsdk/include/fsdk_pauseadapter.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_FSDK_PAUSEADAPTER_H_ -#define FPDFSDK_INCLUDE_FSDK_PAUSEADAPTER_H_ - -#include "core/fxcrt/fx_basic.h" -#include "core/fxcrt/fx_system.h" -#include "public/fpdf_progressive.h" - -class IFSDK_PAUSE_Adapter : public IFX_Pause { - public: - explicit IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause); - ~IFSDK_PAUSE_Adapter() override; - - FX_BOOL NeedToPauseNow() override; - - private: - IFSDK_PAUSE* const m_IPause; -}; - -#endif // FPDFSDK_INCLUDE_FSDK_PAUSEADAPTER_H_ diff --git a/fpdfsdk/include/ipdfsdk_annothandler.h b/fpdfsdk/include/ipdfsdk_annothandler.h deleted file mode 100644 index 3102cb48db..0000000000 --- a/fpdfsdk/include/ipdfsdk_annothandler.h +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_IPDFSDK_ANNOTHANDLER_H_ -#define FPDFSDK_INCLUDE_IPDFSDK_ANNOTHANDLER_H_ - -#include "core/fxcrt/fx_basic.h" -#include "core/fxcrt/fx_coordinates.h" -#include "fpdfsdk/include/cpdfsdk_annot.h" - -class CFX_Matrix; -class CFX_RenderDevice; -class CPDF_Annot; -class CPDFSDK_PageView; - -#ifdef PDF_ENABLE_XFA -class CXFA_FFWidget; -#endif // PDF_ENABLE_XFA - -class IPDFSDK_AnnotHandler { - public: - virtual ~IPDFSDK_AnnotHandler() {} - - virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) = 0; - virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, - CPDFSDK_PageView* pPage) = 0; - -#ifdef PDF_ENABLE_XFA - virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, - CPDFSDK_PageView* pPage) = 0; -#endif // PDF_ENABLE_XFA - - virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0; - virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) = 0; - virtual CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot) = 0; - virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - const CFX_FloatPoint& point) = 0; - virtual void OnDraw(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot* pAnnot, - CFX_RenderDevice* pDevice, - CFX_Matrix* pUser2Device, - bool bDrawAnnots) = 0; - virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0; - virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0; - virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0; - virtual void OnRelease(CPDFSDK_Annot* pAnnot) = 0; - - virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) = 0; - virtual void OnMouseExit(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) = 0; - virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) = 0; - virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) = 0; - virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) = 0; - virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) = 0; - virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - short zDelta, - const CFX_FloatPoint& point) = 0; - virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) = 0; - virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) = 0; - virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, - CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlags, - const CFX_FloatPoint& point) = 0; - virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, - uint32_t nChar, - uint32_t nFlags) = 0; - virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; - virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; - virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) = 0; - virtual void OnSelected(CPDFSDK_Annot* pAnnot) = 0; - virtual FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) = 0; - virtual FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, - uint32_t nFlag) = 0; -#ifdef PDF_ENABLE_XFA - virtual FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot::ObservedPtr* pOldAnnot, - CPDFSDK_Annot::ObservedPtr* pNewAnnot) = 0; -#endif // PDF_ENABLE_XFA -}; - -#endif // FPDFSDK_INCLUDE_IPDFSDK_ANNOTHANDLER_H_ diff --git a/fpdfsdk/include/pdfsdk_fieldaction.h b/fpdfsdk/include/pdfsdk_fieldaction.h deleted file mode 100644 index 4ed8b943c9..0000000000 --- a/fpdfsdk/include/pdfsdk_fieldaction.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_INCLUDE_PDFSDK_FIELDACTION_H_ -#define FPDFSDK_INCLUDE_PDFSDK_FIELDACTION_H_ - -#include "core/fxcrt/fx_string.h" - -#ifdef PDF_ENABLE_XFA -typedef enum { - PDFSDK_XFA_Click = 0, - PDFSDK_XFA_Full, - PDFSDK_XFA_PreOpen, - PDFSDK_XFA_PostOpen -} PDFSDK_XFAAActionType; -#endif // PDF_ENABLE_XFA - -struct PDFSDK_FieldAction { - PDFSDK_FieldAction(); - PDFSDK_FieldAction(const PDFSDK_FieldAction& other) = delete; - - FX_BOOL bModifier; - FX_BOOL bShift; - int nCommitKey; - CFX_WideString sChange; - CFX_WideString sChangeEx; - FX_BOOL bKeyDown; - int nSelEnd; - int nSelStart; - CFX_WideString sValue; - FX_BOOL bWillCommit; - FX_BOOL bFieldFull; - FX_BOOL bRC; -}; - -#endif // FPDFSDK_INCLUDE_PDFSDK_FIELDACTION_H_ |