summaryrefslogtreecommitdiff
path: root/fpdfsdk/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-02 10:35:27 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-02 10:35:27 -0700
commiteed467dcf3c661cddaecf4f996bc8964e7090cf9 (patch)
tree12eb9093d2760566d920ce2862b61371082e75a6 /fpdfsdk/include
parent56ba4292f1454f259b52a68dd962cc2d8c2027c8 (diff)
downloadpdfium-eed467dcf3c661cddaecf4f996bc8964e7090cf9.tar.xz
Replace XFA_HWIDGET with IXFA_Widget*
A second case of casting willy-nilly between unrelated structures to provide information hiding. Bad Idea. Remove dozens of casts in the process. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1155273002
Diffstat (limited to 'fpdfsdk/include')
-rw-r--r--fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h20
-rw-r--r--fpdfsdk/include/fsdk_annothandler.h8
-rw-r--r--fpdfsdk/include/fsdk_baseannot.h2
-rw-r--r--fpdfsdk/include/fsdk_baseform.h24
-rw-r--r--fpdfsdk/include/fsdk_mgr.h4
5 files changed, 29 insertions, 29 deletions
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
index dc15ec42d8..9158b8236a 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
@@ -45,21 +45,21 @@ public:
//used in dynamic xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
virtual void InvalidateRect(IXFA_PageView* pPageView, const CFX_RectF& rt, FX_DWORD dwFlags = 0);
//used in static xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
- virtual void InvalidateRect(XFA_HWIDGET hWidget, FX_DWORD dwFlags = 0);
+ virtual void InvalidateRect(IXFA_Widget* hWidget, FX_DWORD dwFlags = 0);
//show or hide caret
- virtual void DisplayCaret(XFA_HWIDGET hWidget, FX_BOOL bVisible, const CFX_RectF* pRtAnchor);
+ virtual void DisplayCaret(IXFA_Widget* hWidget, FX_BOOL bVisible, const CFX_RectF* pRtAnchor);
//dwPos: (0:bottom 1:top)
- virtual FX_BOOL GetPopupPos(XFA_HWIDGET hWidget, FX_FLOAT fMinPopup, FX_FLOAT fMaxPopup,
+ virtual FX_BOOL GetPopupPos(IXFA_Widget* hWidget, FX_FLOAT fMinPopup, FX_FLOAT fMaxPopup,
const CFX_RectF &rtAnchor, CFX_RectF &rtPopup);
- virtual FX_BOOL PopupMenu(XFA_HWIDGET hWidget, CFX_PointF ptPopup, const CFX_RectF* pRectExclude = NULL);
+ virtual FX_BOOL PopupMenu(IXFA_Widget* hWidget, CFX_PointF ptPopup, const CFX_RectF* pRectExclude = NULL);
//dwFlags XFA_PAGEVIEWEVENT_Added, XFA_PAGEVIEWEVENT_Removing
virtual void PageViewEvent(IXFA_PageView* pPageView, FX_DWORD dwFlags);
//dwEvent refer to XFA_WIDGETEVENT_XXX
- virtual void WidgetEvent(XFA_HWIDGET hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, FX_LPVOID pParam = NULL, FX_LPVOID pAdditional = NULL);
+ virtual void WidgetEvent(IXFA_Widget* hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, FX_LPVOID pParam = NULL, FX_LPVOID pAdditional = NULL);
//return true if render it.
- virtual FX_BOOL RenderCustomWidget(XFA_HWIDGET hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, const CFX_RectF& rtUI){return FALSE;}
+ virtual FX_BOOL RenderCustomWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, const CFX_RectF& rtUI){return FALSE;}
//host method
virtual FX_INT32 CountPages(IXFA_Doc* hDoc);
@@ -74,14 +74,14 @@ public:
virtual void GotoURL(IXFA_Doc* hDoc, FX_WSTR bsURL, FX_BOOL bAppend = TRUE);
virtual FX_BOOL IsValidationsEnabled(IXFA_Doc* hDoc);
virtual void SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);
- virtual void SetFocusWidget(IXFA_Doc* hDoc, XFA_HWIDGET hWidget);
+ virtual void SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget);
virtual void Print(IXFA_Doc* hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions);
//LayoutPseudo method
virtual FX_INT32 AbsPageCountInBatch(IXFA_Doc* hDoc){return 0;}
- virtual FX_INT32 AbsPageInBatch(IXFA_Doc* hDoc, XFA_HWIDGET hWidget){return 0;}
+ virtual FX_INT32 AbsPageInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget){return 0;}
virtual FX_INT32 SheetCountInBatch(IXFA_Doc* hDoc){return 0;}
- virtual FX_INT32 SheetInBatch(IXFA_Doc* hDoc, XFA_HWIDGET hWidget){return 0;}
+ virtual FX_INT32 SheetInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget){return 0;}
//SignaturePseudoModel method
//TODO:
@@ -93,7 +93,7 @@ public:
//Get document path
virtual void GetURL(IXFA_Doc* hDoc, CFX_WideString &wsDocURL);
virtual FX_ARGB GetHighlightColor(IXFA_Doc* hDoc);
- virtual void AddDoRecord(XFA_HWIDGET hWidget);
+ virtual void AddDoRecord(IXFA_Widget* hWidget);
/**
*Submit data to email, http, ftp.
* @param[in] hDoc The document handler.
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index fa73cd1795..be7b4650e7 100644
--- a/fpdfsdk/include/fsdk_annothandler.h
+++ b/fpdfsdk/include/fsdk_annothandler.h
@@ -36,7 +36,7 @@ public:
virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) = 0;
- virtual CPDFSDK_Annot* NewAnnot(XFA_HWIDGET hWidget, CPDFSDK_PageView* pPage) = 0;
+ virtual CPDFSDK_Annot* NewAnnot(IXFA_Widget* hWidget, CPDFSDK_PageView* pPage) = 0;
virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0;
@@ -110,7 +110,7 @@ public:
virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage);
- virtual CPDFSDK_Annot* NewAnnot(XFA_HWIDGET hWidget, CPDFSDK_PageView* pPage);
+ virtual CPDFSDK_Annot* NewAnnot(IXFA_Widget* hWidget, CPDFSDK_PageView* pPage);
virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) ;
@@ -189,7 +189,7 @@ public:
virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) { return NULL; }
- virtual CPDFSDK_Annot* NewAnnot(XFA_HWIDGET pAnnot, CPDFSDK_PageView* pPage);
+ virtual CPDFSDK_Annot* NewAnnot(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPage);
virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot);
@@ -266,7 +266,7 @@ public:
void UnRegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler);
virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot * pAnnot, CPDFSDK_PageView *pPageView);
- virtual CPDFSDK_Annot* NewAnnot(XFA_HWIDGET pAnnot, CPDFSDK_PageView* pPageView);
+ virtual CPDFSDK_Annot* NewAnnot(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPageView);
virtual void ReleaseAnnot(CPDFSDK_Annot * pAnnot);
virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot);
diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h
index 250ce7f591..d2ce977a6c 100644
--- a/fpdfsdk/include/fsdk_baseannot.h
+++ b/fpdfsdk/include/fsdk_baseannot.h
@@ -83,7 +83,7 @@ public:
virtual int GetLayoutOrder() const { return 5; }
virtual CPDF_Annot* GetPDFAnnot() { return NULL; }
- virtual XFA_HWIDGET GetXFAWidget() { return NULL; }
+ virtual IXFA_Widget* GetXFAWidget() { return NULL; }
virtual CFX_ByteString GetType() const { return ""; }
virtual CFX_ByteString GetSubType() const { return ""; }
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index 333bb30a78..67c67fc37a 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -67,8 +67,8 @@ typedef struct _PDFSDK_FieldAction
class CPDFSDK_Widget:public CPDFSDK_BAAnnot
{
public:
- XFA_HWIDGET GetMixXFAWidget();
- XFA_HWIDGET GetGroupMixXFAWidget();
+ IXFA_Widget* GetMixXFAWidget();
+ IXFA_Widget* GetGroupMixXFAWidget();
IXFA_WidgetHandler* GetXFAWidgetHandler();
FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT);
@@ -78,9 +78,9 @@ public:
void SynchronizeXFAValue();
void SynchronizeXFAItems();
- static void SynchronizeXFAValue(IXFA_DocView* pXFADocView, XFA_HWIDGET hWidget,
+ static void SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget,
CPDF_FormField* pFormField, CPDF_FormControl* pFormControl);
- static void SynchronizeXFAItems(IXFA_DocView* pXFADocView, XFA_HWIDGET hWidget,
+ static void SynchronizeXFAItems(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget,
CPDF_FormField* pFormField, CPDF_FormControl* pFormControl);
public:
@@ -192,19 +192,19 @@ private:
FX_INT32 m_nAppAge;
FX_INT32 m_nValueAge;
- XFA_HWIDGET m_hMixXFAWidget;
+ IXFA_Widget* m_hMixXFAWidget;
IXFA_WidgetHandler* m_pWidgetHandler;
};
class CPDFSDK_XFAWidget : public CPDFSDK_Annot
{
public:
- CPDFSDK_XFAWidget(XFA_HWIDGET pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm);
+ CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm);
virtual ~CPDFSDK_XFAWidget(){}
public:
virtual FX_BOOL IsXFAField();
- virtual XFA_HWIDGET GetXFAWidget() { return m_hXFAWidget; }
+ virtual IXFA_Widget* GetXFAWidget() { return m_hXFAWidget; }
virtual CFX_ByteString GetType() const ;
virtual CFX_ByteString GetSubType() const { return ""; }
@@ -216,11 +216,11 @@ public:
private:
CPDFSDK_InterForm* m_pInterForm;
- XFA_HWIDGET m_hXFAWidget;
+ IXFA_Widget* m_hXFAWidget;
};
#define CPDFSDK_WidgetMap CFX_MapPtrTemplate<CPDF_FormControl*, CPDFSDK_Widget*>
-#define CPDFSDK_XFAWidgetMap CFX_MapPtrTemplate<XFA_HWIDGET, CPDFSDK_XFAWidget*>
+#define CPDFSDK_XFAWidgetMap CFX_MapPtrTemplate<IXFA_Widget*, CPDFSDK_XFAWidget*>
#define CPDFSDK_FieldSynchronizeMap CFX_MapPtrTemplate<CPDF_FormField*, int>
class CPDFSDK_InterForm : public CPDF_FormNotify
@@ -244,9 +244,9 @@ public:
void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget);
void RemoveMap(CPDF_FormControl* pControl);
- void AddXFAMap(XFA_HWIDGET hWidget, CPDFSDK_XFAWidget* pWidget);
- void RemoveXFAMap(XFA_HWIDGET hWidget);
- CPDFSDK_XFAWidget* GetXFAWidget(XFA_HWIDGET hWidget);
+ void AddXFAMap(IXFA_Widget* hWidget, CPDFSDK_XFAWidget* pWidget);
+ void RemoveXFAMap(IXFA_Widget* hWidget);
+ CPDFSDK_XFAWidget* GetXFAWidget(IXFA_Widget* hWidget);
void EnableCalculate(FX_BOOL bEnabled);
FX_BOOL IsCalculateEnabled() const;
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index abcb24dd91..7f68dd9cca 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -782,13 +782,13 @@ public:
CPDFSDK_Annot* AddAnnot(CPDF_Dictionary * pDict);
CPDFSDK_Annot* AddAnnot(FX_LPCSTR lpSubType,CPDF_Dictionary * pDict);
CPDFSDK_Annot* AddAnnot(CPDF_Annot * pPDFAnnot);
- CPDFSDK_Annot* AddAnnot(XFA_HWIDGET pPDFAnnot);
+ CPDFSDK_Annot* AddAnnot(IXFA_Widget* pPDFAnnot);
FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot);
int CountAnnots();
CPDFSDK_Annot* GetAnnot(int nIndex);
CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary * pDict);
- CPDFSDK_Annot* GetAnnotByXFAWidget(XFA_HWIDGET hWidget);
+ CPDFSDK_Annot* GetAnnotByXFAWidget(IXFA_Widget* hWidget);
CPDFXFA_Page* GetPDFXFAPage(){return m_page;}
CPDF_Page* GetPDFPage();
CPDF_Document* GetPDFDocument();