diff options
29 files changed, 393 insertions, 386 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(); diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index 8cb0de0e6e..0ae2237d29 100644 --- a/fpdfsdk/src/fpdfformfill.cpp +++ b/fpdfsdk/src/fpdfformfill.cpp @@ -57,7 +57,7 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_ if (!pWidgetHandler) return -1; - XFA_HWIDGET pXFAAnnot = NULL; + IXFA_Widget* pXFAAnnot = NULL; IXFA_WidgetIterator* pWidgetIterator = pPageView->CreateWidgetIterator(XFA_TRAVERSEWAY_Form, XFA_WIDGETFILTER_Viewable|XFA_WIDGETFILTER_AllType); if (!pWidgetIterator) return -1; @@ -352,7 +352,7 @@ DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, FPDF_WIDGET hWid if (pXFAMenuHander == NULL) return; - pXFAMenuHander->Undo((XFA_HWIDGET)hWidget); + pXFAMenuHander->Undo((IXFA_Widget*)hWidget); } DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, FPDF_WIDGET hWidget) @@ -368,7 +368,7 @@ DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, FPDF_WIDGET hWid if (pXFAMenuHander == NULL) return; - pXFAMenuHander->Redo((XFA_HWIDGET)hWidget); + pXFAMenuHander->Redo((IXFA_Widget*)hWidget); } DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, FPDF_WIDGET hWidget) @@ -384,7 +384,7 @@ DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, FPDF_WIDGET if (pXFAMenuHander == NULL) return; - pXFAMenuHander->SelectAll((XFA_HWIDGET)hWidget); + pXFAMenuHander->SelectAll((IXFA_Widget*)hWidget); } DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, FPDF_WIDESTRING wsText, FPDF_DWORD* size) { @@ -400,7 +400,7 @@ DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, FPDF_WIDGET hWid return; CFX_WideString wsCpText; - pXFAMenuHander->Copy((XFA_HWIDGET)hWidget, wsCpText); + pXFAMenuHander->Copy((IXFA_Widget*)hWidget, wsCpText); CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode(); int len = bsCpText.GetLength()/sizeof(unsigned short); @@ -430,7 +430,7 @@ DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, FPDF_WIDGET hWidg return; CFX_WideString wsCpText; - pXFAMenuHander->Cut((XFA_HWIDGET)hWidget, wsCpText); + pXFAMenuHander->Cut((IXFA_Widget*)hWidget, wsCpText); CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode(); int len = bsCpText.GetLength()/sizeof(unsigned short); @@ -461,7 +461,7 @@ DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, FPDF_WIDGET hWi return; CFX_WideString wstr = CFX_WideString::FromUTF16LE(wsText, size); - pXFAMenuHander->Paste((XFA_HWIDGET)hWidget, wstr); + pXFAMenuHander->Paste((IXFA_Widget*)hWidget, wstr); } DLLEXPORT void STDCALL FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, float y, FPDF_BYTESTRING bsText) @@ -481,7 +481,7 @@ DLLEXPORT void STDCALL FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, ptPopup.x = x; ptPopup.y = y; CFX_ByteStringC bs(bsText); - pXFAMenuHander->ReplaceSpellCheckWord((XFA_HWIDGET)hWidget,ptPopup,bs); + pXFAMenuHander->ReplaceSpellCheckWord((IXFA_Widget*)hWidget,ptPopup,bs); } DLLEXPORT void STDCALL FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, float y, FPDF_STRINGHANDLE* stringHandle) @@ -501,7 +501,7 @@ DLLEXPORT void STDCALL FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, FP CFX_PointF ptPopup; ptPopup.x = x; ptPopup.y = y; - pXFAMenuHander->GetSuggestWords((XFA_HWIDGET)hWidget, ptPopup, *sSuggestWords); + pXFAMenuHander->GetSuggestWords((IXFA_Widget*)hWidget, ptPopup, *sSuggestWords); *stringHandle = (FPDF_STRINGHANDLE)sSuggestWords; } DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle) diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp index 9ef8d53ee9..e64bde1a2a 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp @@ -290,7 +290,7 @@ void CPDFXFA_Document::InvalidateRect(IXFA_PageView* pPageView, const CFX_RectF& pEnv->FFI_Invalidate((FPDF_PAGE)pPage, rcPage.left, rcPage.bottom, rcPage.right, rcPage.top);
}
-void CPDFXFA_Document::InvalidateRect(XFA_HWIDGET hWidget, FX_DWORD dwFlags /* = 0 */)
+void CPDFXFA_Document::InvalidateRect(IXFA_Widget* hWidget, FX_DWORD dwFlags /* = 0 */)
{
if (!hWidget)
return;
@@ -314,7 +314,7 @@ void CPDFXFA_Document::InvalidateRect(XFA_HWIDGET hWidget, FX_DWORD dwFlags /* = InvalidateRect(pPageView, rect, dwFlags);
}
-void CPDFXFA_Document::DisplayCaret(XFA_HWIDGET hWidget, FX_BOOL bVisible, const CFX_RectF* pRtAnchor)
+void CPDFXFA_Document::DisplayCaret(IXFA_Widget* hWidget, FX_BOOL bVisible, const CFX_RectF* pRtAnchor)
{
if (!hWidget || pRtAnchor == NULL)
return;
@@ -349,7 +349,7 @@ void CPDFXFA_Document::DisplayCaret(XFA_HWIDGET hWidget, FX_BOOL bVisible, const }
-FX_BOOL CPDFXFA_Document::GetPopupPos(XFA_HWIDGET hWidget, FX_FLOAT fMinPopup, FX_FLOAT fMaxPopup, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup)
+FX_BOOL CPDFXFA_Document::GetPopupPos(IXFA_Widget* hWidget, FX_FLOAT fMinPopup, FX_FLOAT fMaxPopup, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup)
{
if (NULL == hWidget)
{
@@ -510,7 +510,7 @@ FX_BOOL CPDFXFA_Document::GetPopupPos(XFA_HWIDGET hWidget, FX_FLOAT fMinPopup, F return TRUE;
}
-FX_BOOL CPDFXFA_Document::PopupMenu(XFA_HWIDGET hWidget, CFX_PointF ptPopup, const CFX_RectF* pRectExclude)
+FX_BOOL CPDFXFA_Document::PopupMenu(IXFA_Widget* hWidget, CFX_PointF ptPopup, const CFX_RectF* pRectExclude)
{
if (NULL == hWidget)
{
@@ -573,7 +573,7 @@ void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView, FX_DWORD dwFlags) }
}
-void CPDFXFA_Document::WidgetEvent(XFA_HWIDGET hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, FX_LPVOID pParam, FX_LPVOID pAdditional)
+void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, FX_LPVOID pParam, FX_LPVOID pAdditional)
{
if (m_iDocType != DOCTYPE_DYNIMIC_XFA || NULL == hWidget)
return;
@@ -873,7 +873,7 @@ void CPDFXFA_Document::SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled) if (m_pSDKDoc->GetInterForm())
m_pSDKDoc->GetInterForm()->XfaSetValidationsEnabled(bEnabled);
}
-void CPDFXFA_Document::SetFocusWidget(IXFA_Doc* hDoc, XFA_HWIDGET hWidget)
+void CPDFXFA_Document::SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget)
{
if (hDoc != m_pXFADoc)
return;
@@ -943,7 +943,7 @@ FX_ARGB CPDFXFA_Document::GetHighlightColor(IXFA_Doc* hDoc) return 0;
}
-void CPDFXFA_Document::AddDoRecord(XFA_HWIDGET hWidget)
+void CPDFXFA_Document::AddDoRecord(IXFA_Widget* hWidget)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
if (pEnv == NULL)
diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp index a9e21219a1..6b7c60d7af 100644 --- a/fpdfsdk/src/fsdk_annothandler.cpp +++ b/fpdfsdk/src/fsdk_annothandler.cpp @@ -74,7 +74,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot * pAnnot, CPDFSDK_Pa return new CPDFSDK_BAAnnot(pAnnot, pPageView); } -CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(XFA_HWIDGET pAnnot, CPDFSDK_PageView* pPageView) +CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPageView) { ASSERT(pAnnot != NULL); ASSERT(pPageView != NULL); @@ -398,7 +398,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX return NULL; if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget()) pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget()); - XFA_HWIDGET hNextFocus = NULL; + IXFA_Widget* hNextFocus = NULL; hNextFocus = bNext?pWidgetIterator->MoveToNext():pWidgetIterator->MoveToPrevious(); if (hNextFocus == NULL && pSDKAnnot != NULL) hNextFocus = pWidgetIterator->MoveToFirst(); @@ -466,7 +466,7 @@ CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_Pag return pWidget; } -CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(XFA_HWIDGET hWidget, CPDFSDK_PageView* pPage) +CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(IXFA_Widget* hWidget, CPDFSDK_PageView* pPage) { return NULL; } @@ -837,7 +837,7 @@ CPDFSDK_XFAAnnotHandler::CPDFSDK_XFAAnnotHandler(CPDFDoc_Environment* pApp) : } -CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(XFA_HWIDGET pAnnot, CPDFSDK_PageView* pPage) +CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPage) { ASSERT(pPage != NULL); ASSERT(pAnnot != NULL); @@ -879,7 +879,7 @@ void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* CFX_Matrix mt; mt = *(CFX_Matrix*)pUser2Device; - XFA_HWIDGET hWidget = pAnnot->GetXFAWidget(); + IXFA_Widget* hWidget = pAnnot->GetXFAWidget(); ASSERT(hWidget != NULL); FX_BOOL bIsHighlight = FALSE; @@ -1149,10 +1149,8 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, CPD if (pWidgetHandler) { - FX_BOOL bRet = TRUE; /*pWidgetHandler->OnFocusChange(pNewAnnot ? pNewAnnot->GetXFAWidget() : NULL, - pOldAnnot ? pOldAnnot->GetXFAWidget() : NULL); */ - - XFA_HWIDGET hWidget = pNewAnnot ? pNewAnnot->GetXFAWidget() : NULL; + FX_BOOL bRet = TRUE; + IXFA_Widget* hWidget = pNewAnnot ? pNewAnnot->GetXFAWidget() : NULL; if (hWidget) { IXFA_PageView* pXFAPageView = pWidgetHandler->GetPageView(hWidget); diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index afbafb81c3..6fcdeac3af 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -41,7 +41,7 @@ CPDFSDK_Widget::~CPDFSDK_Widget() } -XFA_HWIDGET CPDFSDK_Widget::GetMixXFAWidget() +IXFA_Widget* CPDFSDK_Widget::GetMixXFAWidget() { ASSERT(m_pPageView != NULL); @@ -77,7 +77,7 @@ XFA_HWIDGET CPDFSDK_Widget::GetMixXFAWidget() return NULL; } -XFA_HWIDGET CPDFSDK_Widget::GetGroupMixXFAWidget() +IXFA_Widget* CPDFSDK_Widget::GetGroupMixXFAWidget() { ASSERT(m_pPageView != NULL); @@ -207,7 +207,7 @@ static XFA_EVENTTYPE GetXFAEventType(CPDF_AAction::AActionType eAAT, FX_BOOL bWi FX_BOOL CPDFSDK_Widget::HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT) { - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { @@ -217,7 +217,7 @@ FX_BOOL CPDFSDK_Widget::HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT) eEventType == XFA_EVENT_Change) && GetFieldType() == FIELDTYPE_RADIOBUTTON) { - if (XFA_HWIDGET hGroupWidget = GetGroupMixXFAWidget()) + if (IXFA_Widget* hGroupWidget = GetGroupMixXFAWidget()) { CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hGroupWidget); if (pXFAWidgetHandler->HasEvent(pAcc, eEventType)) @@ -245,7 +245,7 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, PDFSDK_Field CPDFXFA_Document* pDoc = pSDKDoc->GetDocument(); ASSERT(pDoc != NULL); - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { XFA_EVENTTYPE eEventType = GetXFAEventType(eXFAAAT); @@ -274,7 +274,7 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, PDFSDK_Field eEventType == XFA_EVENT_Change) && GetFieldType() == FIELDTYPE_RADIOBUTTON) { - if (XFA_HWIDGET hGroupWidget = GetGroupMixXFAWidget()) + if (IXFA_Widget* hGroupWidget = GetGroupMixXFAWidget()) { CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hGroupWidget); param.m_pTarget = pAcc; @@ -309,7 +309,7 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, PDFSDK_Field void CPDFSDK_Widget::Synchronize(FX_BOOL bSynchronizeElse) { - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { @@ -381,7 +381,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue() IXFA_DocView* pXFADocView = pDoc->GetXFADocView(); if (!pXFADocView) return; - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { @@ -409,7 +409,7 @@ void CPDFSDK_Widget::SynchronizeXFAItems() IXFA_DocView* pXFADocView = pDoc->GetXFADocView(); if (!pXFADocView) return; - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { @@ -421,7 +421,7 @@ void CPDFSDK_Widget::SynchronizeXFAItems() } } -void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView, XFA_HWIDGET hWidget, +void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, CPDF_FormField* pFormField, CPDF_FormControl* pFormControl) { ASSERT(pXFADocView != NULL); @@ -510,7 +510,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView, XFA_HWIDGET } } -void CPDFSDK_Widget::SynchronizeXFAItems(IXFA_DocView* pXFADocView, XFA_HWIDGET hWidget, +void CPDFSDK_Widget::SynchronizeXFAItems(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, CPDF_FormField* pFormField, CPDF_FormControl* pFormControl) { ASSERT(pXFADocView != NULL); @@ -769,7 +769,7 @@ FX_FLOAT CPDFSDK_Widget::GetFontSize() const int CPDFSDK_Widget::GetSelectedIndex(int nIndex) { - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { @@ -789,7 +789,7 @@ int CPDFSDK_Widget::GetSelectedIndex(int nIndex) CFX_WideString CPDFSDK_Widget::GetValue(FX_BOOL bDisplay) { - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { @@ -834,7 +834,7 @@ int CPDFSDK_Widget::CountOptions() const FX_BOOL CPDFSDK_Widget::IsOptionSelected(int nIndex) { - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { @@ -866,7 +866,7 @@ FX_BOOL CPDFSDK_Widget::IsChecked() { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { if (CXFA_WidgetAcc* pWidgetAcc = pXFAWidgetHandler->GetDataAcc(hWidget)) { @@ -2243,7 +2243,7 @@ FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAc CPDFDoc_Environment* pEnv = pDocument->GetEnv(); ASSERT(pEnv != NULL); - if (XFA_HWIDGET hWidget = this->GetMixXFAWidget()) + if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { XFA_EVENTTYPE eEventType = GetXFAEventType(type, data.bWillCommit); @@ -2368,7 +2368,7 @@ FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY) } //CPDFSDK_XFAWidget -CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(XFA_HWIDGET pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm) : +CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm) : CPDFSDK_Annot(pPageView), m_hXFAWidget(pAnnot), m_pInterForm(pInterForm) @@ -2575,17 +2575,17 @@ void CPDFSDK_InterForm::RemoveMap(CPDF_FormControl* pControl) m_Map.RemoveKey(pControl); } -void CPDFSDK_InterForm::AddXFAMap(XFA_HWIDGET hWidget, CPDFSDK_XFAWidget* pWidget) +void CPDFSDK_InterForm::AddXFAMap(IXFA_Widget* hWidget, CPDFSDK_XFAWidget* pWidget) { m_XFAMap.SetAt(hWidget, pWidget); } -void CPDFSDK_InterForm::RemoveXFAMap(XFA_HWIDGET hWidget) +void CPDFSDK_InterForm::RemoveXFAMap(IXFA_Widget* hWidget) { m_XFAMap.RemoveKey(hWidget); } -CPDFSDK_XFAWidget* CPDFSDK_InterForm::GetXFAWidget(XFA_HWIDGET hWidget) +CPDFSDK_XFAWidget* CPDFSDK_InterForm::GetXFAWidget(IXFA_Widget* hWidget) { CPDFSDK_XFAWidget* pWidget = NULL; m_XFAMap.Lookup(hWidget, pWidget); diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index ccb1ab6e34..a1d9453c52 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -805,7 +805,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot * pPDFAnnot) return pSDKAnnot; } -CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(XFA_HWIDGET pPDFAnnot) +CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(IXFA_Widget* pPDFAnnot) { if (!pPDFAnnot) return NULL; @@ -905,7 +905,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByDict(CPDF_Dictionary * pDict) } return NULL; } -CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByXFAWidget(XFA_HWIDGET hWidget) +CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByXFAWidget(IXFA_Widget* hWidget) { if (hWidget == NULL) return NULL; @@ -1118,7 +1118,6 @@ void CPDFSDK_PageView::LoadFXAnnots() pageView = m_page->GetXFAPageView(); ASSERT(pageView != NULL); - XFA_HWIDGET pXFAAnnot = NULL; IXFA_WidgetIterator* pWidgetHander = pageView->CreateWidgetIterator(XFA_TRAVERSEWAY_Form, XFA_WIDGETFILTER_Visible|XFA_WIDGETFILTER_Viewable|XFA_WIDGETFILTER_AllType); if (!pWidgetHander) { @@ -1127,7 +1126,7 @@ void CPDFSDK_PageView::LoadFXAnnots() return; } - pXFAAnnot = pWidgetHander->MoveToNext(); + IXFA_Widget* pXFAAnnot = pWidgetHander->MoveToNext(); while (pXFAAnnot) { CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pXFAAnnot, this); if(!pAnnot) { diff --git a/xfa/include/fxfa/fxfa.h b/xfa/include/fxfa/fxfa.h index 4d6a036622..da39113062 100644 --- a/xfa/include/fxfa/fxfa.h +++ b/xfa/include/fxfa/fxfa.h @@ -35,9 +35,15 @@ protected: IXFA_Doc() { }
};
-typedef struct _XFA_HWIDGET {
- FX_LPVOID pData;
-}* XFA_HWIDGET;
+ +class IXFA_Widget {
+public:
+ virtual ~IXFA_Widget() { }
+protected:
+ IXFA_Widget() { }
+};
+
+ #include "fxfa_basic.h"
#include "fxfa_widget.h"
#define XFA_MBICON_Error 0
@@ -284,24 +290,24 @@ class IXFA_MenuHandler public:
virtual ~IXFA_MenuHandler() { }
- virtual FX_BOOL CanCopy(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL CanCut(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL CanPaste(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL CanSelectAll(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL CanDelete(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL CanDeSelect(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL Copy(XFA_HWIDGET hWidget, CFX_WideString &wsText) = 0;
- virtual FX_BOOL Cut(XFA_HWIDGET hWidget, CFX_WideString &wsText) = 0;
- virtual FX_BOOL Paste(XFA_HWIDGET hWidget, const CFX_WideString &wsText) = 0;
- virtual FX_BOOL SelectAll(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL Delete(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL DeSelect(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL CanUndo(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL CanRedo(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL Undo(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL Redo(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL GetSuggestWords(XFA_HWIDGET hWidget, CFX_PointF pointf, CFX_ByteStringArray &sSuggest) = 0;
- virtual FX_BOOL ReplaceSpellCheckWord(XFA_HWIDGET hWidget, CFX_PointF pointf, FX_BSTR bsReplace) = 0;
+ virtual FX_BOOL CanCopy(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL CanCut(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL CanPaste(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL CanSelectAll(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL CanDelete(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL CanDeSelect(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL Copy(IXFA_Widget* hWidget, CFX_WideString &wsText) = 0;
+ virtual FX_BOOL Cut(IXFA_Widget* hWidget, CFX_WideString &wsText) = 0;
+ virtual FX_BOOL Paste(IXFA_Widget* hWidget, const CFX_WideString &wsText) = 0;
+ virtual FX_BOOL SelectAll(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL Delete(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL DeSelect(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL CanUndo(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL CanRedo(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL Undo(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL Redo(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL GetSuggestWords(IXFA_Widget* hWidget, CFX_PointF pointf, CFX_ByteStringArray &sSuggest) = 0;
+ virtual FX_BOOL ReplaceSpellCheckWord(IXFA_Widget* hWidget, CFX_PointF pointf, FX_BSTR bsReplace) = 0;
};
#define XFA_INVALIDATE_AllPages 0x00000000
#define XFA_INVALIDATE_CurrentPage 0x00000001
@@ -326,13 +332,13 @@ public: virtual void SetChangeMark(IXFA_Doc* hDoc) = 0;
virtual void InvalidateRect(IXFA_PageView* pPageView, const CFX_RectF& rt, FX_DWORD dwFlags = 0) = 0;
- virtual void DisplayCaret(XFA_HWIDGET hWidget, FX_BOOL bVisible, const CFX_RectF* pRtAnchor) = 0;
- virtual FX_BOOL GetPopupPos(XFA_HWIDGET hWidget, FX_FLOAT fMinPopup, FX_FLOAT fMaxPopup,
+ virtual void DisplayCaret(IXFA_Widget* hWidget, FX_BOOL bVisible, const CFX_RectF* pRtAnchor) = 0;
+ virtual FX_BOOL GetPopupPos(IXFA_Widget* hWidget, FX_FLOAT fMinPopup, FX_FLOAT fMaxPopup,
const CFX_RectF &rtAnchor, CFX_RectF &rtPopup) = 0;
- virtual FX_BOOL PopupMenu(XFA_HWIDGET hWidget, CFX_PointF ptPopup, const CFX_RectF* pRectExclude = NULL) = 0;
+ virtual FX_BOOL PopupMenu(IXFA_Widget* hWidget, CFX_PointF ptPopup, const CFX_RectF* pRectExclude = NULL) = 0;
virtual void PageViewEvent(IXFA_PageView* pPageView, FX_DWORD dwFlags) = 0;
- virtual void WidgetEvent(XFA_HWIDGET hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, FX_LPVOID pParam = NULL, FX_LPVOID pAdditional = NULL) = 0;
- virtual FX_BOOL RenderCustomWidget(XFA_HWIDGET hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, const CFX_RectF& rtUI)
+ virtual void WidgetEvent(IXFA_Widget* hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, FX_LPVOID pParam = NULL, FX_LPVOID pAdditional = NULL) = 0;
+ virtual FX_BOOL RenderCustomWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, const CFX_RectF& rtUI)
{
return FALSE;
}
@@ -348,12 +354,12 @@ public: virtual void GotoURL(IXFA_Doc* hDoc, FX_WSTR bsURL, FX_BOOL bAppend = TRUE) = 0;
virtual FX_BOOL IsValidationsEnabled(IXFA_Doc* hDoc) = 0;
virtual void SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled) = 0;
- virtual void SetFocusWidget(IXFA_Doc* hDoc, XFA_HWIDGET hWidget) = 0;
+ virtual void SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0;
virtual void Print(IXFA_Doc* hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions) = 0;
virtual FX_INT32 AbsPageCountInBatch(IXFA_Doc* hDoc) = 0;
- virtual FX_INT32 AbsPageInBatch(IXFA_Doc* hDoc, XFA_HWIDGET hWidget) = 0;
+ virtual FX_INT32 AbsPageInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0;
virtual FX_INT32 SheetCountInBatch(IXFA_Doc* hDoc) = 0;
- virtual FX_INT32 SheetInBatch(IXFA_Doc* hDoc, XFA_HWIDGET hWidget) = 0;
+ virtual FX_INT32 SheetInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0;
virtual FX_INT32 Verify(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE)
{
return 0;
@@ -372,7 +378,7 @@ public: }
virtual void GetURL(IXFA_Doc* hDoc, CFX_WideString &wsDocURL) = 0;
virtual FX_ARGB GetHighlightColor(IXFA_Doc* hDoc) = 0;
- virtual void AddDoRecord(XFA_HWIDGET hWidget) = 0;
+ virtual void AddDoRecord(IXFA_Widget* hWidget) = 0;
virtual FX_BOOL SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit) = 0;
virtual FX_BOOL CheckWord(IXFA_Doc* hDoc, FX_BSTR sWord) = 0;
@@ -531,16 +537,16 @@ public: virtual void UpdateDocView() = 0;
virtual FX_INT32 CountPageViews() = 0;
virtual IXFA_PageView* GetPageView(FX_INT32 nIndex) = 0;
- virtual XFA_HWIDGET GetWidgetByName(FX_WSTR wsName) = 0;
+ virtual IXFA_Widget* GetWidgetByName(FX_WSTR wsName) = 0;
virtual CXFA_WidgetAcc* GetWidgetAccByName(FX_WSTR wsName) = 0;
virtual void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL) = 0;
virtual FX_INT32 ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc = NULL) = 0;
virtual IXFA_WidgetHandler* GetWidgetHandler() = 0;
virtual IXFA_WidgetIterator* CreateWidgetIterator() = 0;
virtual IXFA_WidgetAccIterator* CreateWidgetAccIterator(XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder) = 0;
- virtual XFA_HWIDGET GetFocusWidget() = 0;
+ virtual IXFA_Widget* GetFocusWidget() = 0;
virtual void KillFocus() = 0;
- virtual FX_BOOL SetFocus(XFA_HWIDGET hWidget) = 0;
+ virtual FX_BOOL SetFocus(IXFA_Widget* hWidget) = 0;
};
#define XFA_TRAVERSEWAY_Tranvalse 0x0001
#define XFA_TRAVERSEWAY_Form 0x0002
@@ -562,7 +568,7 @@ public: virtual FX_INT32 LoadPageView(IFX_Pause *pPause = NULL) = 0;
virtual void UnloadPageView() = 0;
- virtual XFA_HWIDGET GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual IXFA_Widget* GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) = 0;
virtual IXFA_WidgetIterator* CreateWidgetIterator(FX_DWORD dwTraverseWay = XFA_TRAVERSEWAY_Form, FX_DWORD dwWidgetFilter = XFA_WIDGETFILTER_Visible | XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType) = 0;
};
class CXFA_RenderOptions
@@ -625,35 +631,35 @@ class IXFA_WidgetHandler public:
virtual ~IXFA_WidgetHandler() { }
- virtual XFA_HWIDGET CreateWidget(XFA_HWIDGET hParent, XFA_WIDGETTYPE eType, XFA_HWIDGET hBefore = NULL) = 0;
- virtual IXFA_PageView* GetPageView(XFA_HWIDGET hWidget) = 0;
- virtual void GetRect(XFA_HWIDGET hWidget, CFX_RectF &rt) = 0;
- virtual FX_DWORD GetStatus(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL GetBBox(XFA_HWIDGET hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE) = 0;
- virtual CXFA_WidgetAcc* GetDataAcc(XFA_HWIDGET hWidget) = 0;
-
- virtual void GetName(XFA_HWIDGET hWidget, CFX_WideString &wsName, FX_INT32 iNameType = 0) = 0;
- virtual FX_BOOL GetToolTip(XFA_HWIDGET hWidget, CFX_WideString &wsToolTip) = 0;
- virtual void SetPrivateData(XFA_HWIDGET hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback) = 0;
- virtual FX_LPVOID GetPrivateData(XFA_HWIDGET hWidget, FX_LPVOID module_id) = 0;
- virtual FX_BOOL OnMouseEnter(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL OnMouseExit(XFA_HWIDGET hWidget) = 0;
- virtual FX_BOOL OnLButtonDown(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnLButtonUp(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnLButtonDblClk(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnMouseMove(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnMouseWheel(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnRButtonDown(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnRButtonUp(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnRButtonDblClk(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
-
- virtual FX_BOOL OnKeyDown(XFA_HWIDGET hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags) = 0;
- virtual FX_BOOL OnKeyUp(XFA_HWIDGET hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags) = 0;
- virtual FX_BOOL OnChar(XFA_HWIDGET hWidget, FX_DWORD dwChar, FX_DWORD dwFlags) = 0;
- virtual FX_DWORD OnHitTest(XFA_HWIDGET hWidget, FX_FLOAT fx, FX_FLOAT fy) = 0;
- virtual FX_BOOL OnSetCursor(XFA_HWIDGET hWidget, FX_FLOAT fx, FX_FLOAT fy) = 0;
-
- virtual void RenderWidget(XFA_HWIDGET hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_BOOL bHighlight = FALSE) = 0;
+ virtual IXFA_Widget* CreateWidget(IXFA_Widget* hParent, XFA_WIDGETTYPE eType, IXFA_Widget* hBefore = NULL) = 0;
+ virtual IXFA_PageView* GetPageView(IXFA_Widget* hWidget) = 0;
+ virtual void GetRect(IXFA_Widget* hWidget, CFX_RectF &rt) = 0;
+ virtual FX_DWORD GetStatus(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL GetBBox(IXFA_Widget* hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE) = 0;
+ virtual CXFA_WidgetAcc* GetDataAcc(IXFA_Widget* hWidget) = 0;
+
+ virtual void GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType = 0) = 0;
+ virtual FX_BOOL GetToolTip(IXFA_Widget* hWidget, CFX_WideString &wsToolTip) = 0;
+ virtual void SetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback) = 0;
+ virtual FX_LPVOID GetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id) = 0;
+ virtual FX_BOOL OnMouseEnter(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL OnMouseExit(IXFA_Widget* hWidget) = 0;
+ virtual FX_BOOL OnLButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnLButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnLButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnRButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnRButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnRButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) = 0;
+
+ virtual FX_BOOL OnKeyDown(IXFA_Widget* hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags) = 0;
+ virtual FX_BOOL OnKeyUp(IXFA_Widget* hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags) = 0;
+ virtual FX_BOOL OnChar(IXFA_Widget* hWidget, FX_DWORD dwChar, FX_DWORD dwFlags) = 0;
+ virtual FX_DWORD OnHitTest(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy) = 0;
+ virtual FX_BOOL OnSetCursor(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy) = 0;
+
+ virtual void RenderWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_BOOL bHighlight = FALSE) = 0;
virtual FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType) = 0;
virtual FX_INT32 ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam) = 0;
};
@@ -662,12 +668,12 @@ class IXFA_WidgetIterator public:
virtual void Release() = 0;
virtual void Reset() = 0;
- virtual XFA_HWIDGET MoveToFirst() = 0;
- virtual XFA_HWIDGET MoveToLast() = 0;
- virtual XFA_HWIDGET MoveToNext() = 0;
- virtual XFA_HWIDGET MoveToPrevious() = 0;
- virtual XFA_HWIDGET GetCurrentWidget() = 0;
- virtual FX_BOOL SetCurrentWidget(XFA_HWIDGET hWidget) = 0;
+ virtual IXFA_Widget* MoveToFirst() = 0;
+ virtual IXFA_Widget* MoveToLast() = 0;
+ virtual IXFA_Widget* MoveToNext() = 0;
+ virtual IXFA_Widget* MoveToPrevious() = 0;
+ virtual IXFA_Widget* GetCurrentWidget() = 0;
+ virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget) = 0;
protected:
~IXFA_WidgetIterator() { }
};
diff --git a/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp b/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp index d7faedc45a..81b7ccb76f 100644 --- a/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp @@ -309,7 +309,7 @@ FX_BOOL CXFA_FFComboBox::OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) }
CFX_PointF pt;
pt.Set(fx, fy);
- GetDoc()->GetDocProvider()->PopupMenu((XFA_HWIDGET)this, pt, NULL);
+ GetDoc()->GetDocProvider()->PopupMenu(this, pt, NULL);
return TRUE;
}
FX_BOOL CXFA_FFComboBox::OnKillFocus(CXFA_FFWidget* pNewWidget)
@@ -531,7 +531,7 @@ void CXFA_FFComboBox::OnPostOpen(IFWL_Widget *pWidget) }
void CXFA_FFComboBox::OnAddDoRecord(IFWL_Widget *pWidget)
{
- GetDoc()->GetDocProvider()->AddDoRecord((XFA_HWIDGET)this);
+ GetDoc()->GetDocProvider()->AddDoRecord(this);
}
FX_INT32 CXFA_FFComboBox::OnProcessMessage(CFWL_Message *pMessage)
{
diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp index 32d2789c7d..7f80c416b2 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp @@ -222,9 +222,9 @@ IXFA_PageView* CXFA_FFDocView::GetPageView(FX_INT32 nIndex) }
return (CXFA_FFPageView*)m_pXFADocLayout->GetPage(nIndex);
}
-XFA_HWIDGET CXFA_FFDocView::GetWidgetByName(FX_WSTR wsName)
+IXFA_Widget* CXFA_FFDocView::GetWidgetByName(FX_WSTR wsName)
{
- return (XFA_HWIDGET)GetWidgetByName(wsName, NULL);
+ return GetWidgetByName(wsName, NULL);
}
CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName(FX_WSTR wsName)
{
@@ -353,9 +353,9 @@ IXFA_WidgetAccIterator* CXFA_FFDocView::CreateWidgetAccIterator(XFA_WIDGETORDER }
return FX_NEW CXFA_WidgetAccIterator(this, pFormRoot);
}
-XFA_HWIDGET CXFA_FFDocView::GetFocusWidget()
+IXFA_Widget* CXFA_FFDocView::GetFocusWidget()
{
- return (XFA_HWIDGET)m_pFocusWidget;
+ return m_pFocusWidget;
}
void CXFA_FFDocView::KillFocus()
{
@@ -366,7 +366,7 @@ void CXFA_FFDocView::KillFocus() m_pFocusWidget = NULL;
m_pOldFocusWidget = NULL;
}
-FX_BOOL CXFA_FFDocView::SetFocus(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFDocView::SetFocus(IXFA_Widget* hWidget)
{
CXFA_FFWidget* pNewFocus = (CXFA_FFWidget*)hWidget;
if (m_pOldFocusWidget == pNewFocus) {
@@ -416,10 +416,10 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetFocusWidgetAcc() void CXFA_FFDocView::SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc)
{
CXFA_FFWidget* pNewFocus = pWidgetAcc ? pWidgetAcc->GetNextWidget(NULL) : NULL;
- if (SetFocus((XFA_HWIDGET)pNewFocus)) {
+ if (SetFocus(pNewFocus)) {
m_pFocusAcc = pWidgetAcc;
if (m_iStatus >= XFA_DOCVIEW_LAYOUTSTATUS_End) {
- m_pDoc->GetDocProvider()->SetFocusWidget(m_pDoc, (XFA_HWIDGET)m_pFocusWidget);
+ m_pDoc->GetDocProvider()->SetFocusWidget(m_pDoc, m_pFocusWidget);
}
}
}
@@ -865,15 +865,15 @@ void CXFA_FFDocWidgetIterator::Reset() m_ContentIterator.Reset();
m_pCurWidget = NULL;
}
-XFA_HWIDGET CXFA_FFDocWidgetIterator::MoveToFirst()
+IXFA_Widget* CXFA_FFDocWidgetIterator::MoveToFirst()
{
return NULL;
}
-XFA_HWIDGET CXFA_FFDocWidgetIterator::MoveToLast()
+IXFA_Widget* CXFA_FFDocWidgetIterator::MoveToLast()
{
return NULL;
}
-XFA_HWIDGET CXFA_FFDocWidgetIterator::MoveToNext()
+IXFA_Widget* CXFA_FFDocWidgetIterator::MoveToNext()
{
CXFA_Node* pItem = m_pCurWidget ? m_ContentIterator.MoveToNext() : m_ContentIterator.GetCurrent();
while (pItem) {
@@ -882,22 +882,22 @@ XFA_HWIDGET CXFA_FFDocWidgetIterator::MoveToNext() if (!m_pCurWidget->IsLoaded() && (m_pCurWidget->GetStatus() & XFA_WIDGETSTATUS_Visible)) {
m_pCurWidget->LoadWidget();
}
- return (XFA_HWIDGET)m_pCurWidget;
+ return m_pCurWidget;
}
}
pItem = m_ContentIterator.MoveToNext();
}
return NULL;
}
-XFA_HWIDGET CXFA_FFDocWidgetIterator::MoveToPrevious()
+IXFA_Widget* CXFA_FFDocWidgetIterator::MoveToPrevious()
{
return NULL;
}
-XFA_HWIDGET CXFA_FFDocWidgetIterator::GetCurrentWidget()
+IXFA_Widget* CXFA_FFDocWidgetIterator::GetCurrentWidget()
{
return NULL;
}
-FX_BOOL CXFA_FFDocWidgetIterator::SetCurrentWidget(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFDocWidgetIterator::SetCurrentWidget(IXFA_Widget* hWidget)
{
return FALSE;
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.h b/xfa/src/fxfa/src/app/xfa_ffdocview.h index 79a3008d70..e3f2d643e2 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.h +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.h @@ -45,16 +45,16 @@ public: virtual void UpdateDocView();
virtual FX_INT32 CountPageViews();
virtual IXFA_PageView* GetPageView(FX_INT32 nIndex);
- virtual XFA_HWIDGET GetWidgetByName(FX_WSTR wsName);
+ virtual IXFA_Widget* GetWidgetByName(FX_WSTR wsName);
virtual CXFA_WidgetAcc* GetWidgetAccByName(FX_WSTR wsName);
virtual void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL);
virtual FX_INT32 ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc = NULL);
virtual IXFA_WidgetHandler* GetWidgetHandler();
virtual IXFA_WidgetIterator* CreateWidgetIterator();
virtual IXFA_WidgetAccIterator* CreateWidgetAccIterator(XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder);
- virtual XFA_HWIDGET GetFocusWidget();
+ virtual IXFA_Widget* GetFocusWidget();
virtual void KillFocus();
- virtual FX_BOOL SetFocus(XFA_HWIDGET hWidget);
+ virtual FX_BOOL SetFocus(IXFA_Widget* hWidget);
CXFA_FFWidget* GetWidgetByName(FX_WSTR wsName, CXFA_FFWidget* pRefWidget = NULL);
CXFA_WidgetAcc* GetWidgetAccByName(FX_WSTR wsName, CXFA_WidgetAcc* pRefWidgetAcc = NULL);
IXFA_DocLayout* GetXFALayout() const;
@@ -129,12 +129,12 @@ public: }
virtual void Reset();
- virtual XFA_HWIDGET MoveToFirst();
- virtual XFA_HWIDGET MoveToLast();
- virtual XFA_HWIDGET MoveToNext();
- virtual XFA_HWIDGET MoveToPrevious();
- virtual XFA_HWIDGET GetCurrentWidget();
- virtual FX_BOOL SetCurrentWidget(XFA_HWIDGET hWidget);
+ virtual IXFA_Widget* MoveToFirst();
+ virtual IXFA_Widget* MoveToLast();
+ virtual IXFA_Widget* MoveToNext();
+ virtual IXFA_Widget* MoveToPrevious();
+ virtual IXFA_Widget* GetCurrentWidget();
+ virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget);
protected:
CXFA_ContainerIterator m_ContentIterator;
CXFA_FFDocView* m_pDocView;
diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp index 2d6cc75046..81119e6e47 100644 --- a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp @@ -84,7 +84,7 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, FX_DWORD dwEvent CXFA_FFWidget* pWidget = pWidgetAcc->GetNextWidget(NULL);
if (!pWidget) {
if (bStaticNotify) {
- pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent((XFA_HWIDGET)pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded, pParam, pAdditional);
+ pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent(pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded, pParam, pAdditional);
}
return;
}
@@ -97,7 +97,7 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, FX_DWORD dwEvent }
}
if (bStaticNotify) {
- pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent((XFA_HWIDGET)pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded, pParam, pAdditional);
+ pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent(pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded, pParam, pAdditional);
}
pWidget = pWidgetAcc->GetNextWidget(pWidget);
}
@@ -111,7 +111,7 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, FX_DWORD dwEvent CXFA_FFWidget* pWidget = pWidgetAcc->GetNextWidget(NULL);
if (!pWidget) {
if (bStaticNotify) {
- pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent((XFA_HWIDGET)pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam, pAdditional);
+ pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent(pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam, pAdditional);
}
return;
}
@@ -124,7 +124,7 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, FX_DWORD dwEvent }
}
if (bStaticNotify) {
- pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent((XFA_HWIDGET)pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam, pAdditional);
+ pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent(pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam, pAdditional);
}
pWidget = pWidgetAcc->GetNextWidget(pWidget);
}
@@ -315,11 +315,11 @@ IXFA_WidgetHandler* CXFA_FFNotify::GetWidgetHandler() CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
return pDocView ? pDocView->GetWidgetHandler() : NULL;
}
-XFA_HWIDGET CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem)
+IXFA_Widget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem)
{
- return (XFA_HWIDGET)XFA_GetWidgetFromLayoutItem(pLayoutItem);
+ return XFA_GetWidgetFromLayoutItem(pLayoutItem);
}
-void CXFA_FFNotify::OpenDropDownList(XFA_HWIDGET hWidget)
+void CXFA_FFNotify::OpenDropDownList(IXFA_Widget* hWidget)
{
CXFA_FFWidget* pWidget = (CXFA_FFWidget*)hWidget;
if (pWidget->GetDataAcc()->GetUIType() != XFA_ELEMENT_ChoiceList) {
@@ -553,7 +553,7 @@ void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView, IXFA_DocLayout *pL IXFA_PageView* pPrePageView = pWidget->GetPageView();
if (pPrePageView != pNewPageView || (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) == (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) {
pWidget->SetPageView(pNewPageView);
- m_pDoc->GetDocProvider()->WidgetEvent((XFA_HWIDGET)pWidget, pWidget->GetDataAcc(), XFA_WIDGETEVENT_PostAdded, pNewPageView, pPrePageView);
+ m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), XFA_WIDGETEVENT_PostAdded, pNewPageView, pPrePageView);
}
if ((dwStatus & XFA_WIDGETSTATUS_Visible) == 0) {
return;
@@ -580,7 +580,7 @@ void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_FFDocView* pDocView, IXFA_DocLayou if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End) {
return;
}
- m_pDoc->GetDocProvider()->WidgetEvent((XFA_HWIDGET)pWidget, pWidget->GetDataAcc(), XFA_WIDGETEVENT_PreRemoved, NULL, NULL);
+ m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), XFA_WIDGETEVENT_PreRemoved, NULL, NULL);
pWidget->AddInvalidateRect(NULL);
}
void CXFA_FFNotify::OnLayoutItemRectChanged(CXFA_FFDocView* pDocView, IXFA_DocLayout *pLayout, CXFA_LayoutItem *pSender, FX_LPVOID pParam, FX_LPVOID pParam2)
diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.h b/xfa/src/fxfa/src/app/xfa_ffnotify.h index 739f25302f..383b0770cb 100644 --- a/xfa/src/fxfa/src/app/xfa_ffnotify.h +++ b/xfa/src/fxfa/src/app/xfa_ffnotify.h @@ -28,8 +28,8 @@ public: virtual IXFA_DocProvider* GetDocProvider();
virtual IXFA_AppProvider* GetAppProvider();
virtual IXFA_WidgetHandler* GetWidgetHandler();
- virtual XFA_HWIDGET GetHWidget(CXFA_LayoutItem* pLayoutItem);
- virtual void OpenDropDownList(XFA_HWIDGET hWidget);
+ virtual IXFA_Widget* GetHWidget(CXFA_LayoutItem* pLayoutItem);
+ virtual void OpenDropDownList(IXFA_Widget* hWidget);
virtual CFX_WideString GetCurrentDateTime();
virtual void ResetData(CXFA_WidgetData* pWidgetData = NULL);
virtual FX_INT32 GetLayoutStatus();
diff --git a/xfa/src/fxfa/src/app/xfa_ffpageview.cpp b/xfa/src/fxfa/src/app/xfa_ffpageview.cpp index ec591adb72..ef340859ea 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpageview.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffpageview.cpp @@ -66,7 +66,7 @@ FX_BOOL CXFA_FFPageView::IsPageViewLoaded() {
return m_bLoaded;
}
-XFA_HWIDGET CXFA_FFPageView::GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy)
+IXFA_Widget* CXFA_FFPageView::GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy)
{
if (!m_bLoaded) {
return NULL;
@@ -87,7 +87,7 @@ XFA_HWIDGET CXFA_FFPageView::GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) if (( FWL_WGTHITTEST_Client == dwFlag
|| FWL_WGTHITTEST_Transparent == dwFlag)) {
pIterator->Release();
- return (XFA_HWIDGET)pWidget;
+ return pWidget;
}
}
pIterator->Release();
@@ -135,52 +135,52 @@ void CXFA_FFPageWidgetIterator::Reset() {
m_sIterator.Reset();
}
-XFA_HWIDGET CXFA_FFPageWidgetIterator::MoveToFirst()
+IXFA_Widget* CXFA_FFPageWidgetIterator::MoveToFirst()
{
m_sIterator.Reset();
for(CXFA_LayoutItem* pLayoutItem = m_sIterator.GetCurrent(); pLayoutItem; pLayoutItem = m_sIterator.MoveToNext()) {
- if (XFA_HWIDGET hWidget = GetWidget(pLayoutItem)) {
+ if (IXFA_Widget* hWidget = GetWidget(pLayoutItem)) {
return hWidget;
}
}
return NULL;
}
-XFA_HWIDGET CXFA_FFPageWidgetIterator::MoveToLast()
+IXFA_Widget* CXFA_FFPageWidgetIterator::MoveToLast()
{
m_sIterator.SetCurrent(NULL);
return MoveToPrevious();
}
-XFA_HWIDGET CXFA_FFPageWidgetIterator::MoveToNext()
+IXFA_Widget* CXFA_FFPageWidgetIterator::MoveToNext()
{
for(CXFA_LayoutItem* pLayoutItem = m_sIterator.MoveToNext(); pLayoutItem; pLayoutItem = m_sIterator.MoveToNext()) {
- if (XFA_HWIDGET hWidget = GetWidget(pLayoutItem)) {
+ if (IXFA_Widget* hWidget = GetWidget(pLayoutItem)) {
return hWidget;
}
}
return NULL;
}
-XFA_HWIDGET CXFA_FFPageWidgetIterator::MoveToPrevious()
+IXFA_Widget* CXFA_FFPageWidgetIterator::MoveToPrevious()
{
for(CXFA_LayoutItem* pLayoutItem = m_sIterator.MoveToPrev(); pLayoutItem; pLayoutItem = m_sIterator.MoveToPrev()) {
- if (XFA_HWIDGET hWidget = GetWidget(pLayoutItem)) {
+ if (IXFA_Widget* hWidget = GetWidget(pLayoutItem)) {
return hWidget;
}
}
return NULL;
}
-XFA_HWIDGET CXFA_FFPageWidgetIterator::GetCurrentWidget()
+IXFA_Widget* CXFA_FFPageWidgetIterator::GetCurrentWidget()
{
CXFA_LayoutItem* pLayoutItem = m_sIterator.GetCurrent();
- return pLayoutItem ? (XFA_HWIDGET)XFA_GetWidgetFromLayoutItem(pLayoutItem) : NULL;
+ return pLayoutItem ? XFA_GetWidgetFromLayoutItem(pLayoutItem) : NULL;
}
-FX_BOOL CXFA_FFPageWidgetIterator::SetCurrentWidget(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFPageWidgetIterator::SetCurrentWidget(IXFA_Widget* hWidget)
{
if(hWidget && m_sIterator.SetCurrent(((CXFA_FFWidget*)hWidget)->GetLayoutItem())) {
return TRUE;
}
return FALSE;
}
-XFA_HWIDGET CXFA_FFPageWidgetIterator::GetWidget(CXFA_LayoutItem* pLayoutItem)
+IXFA_Widget* CXFA_FFPageWidgetIterator::GetWidget(CXFA_LayoutItem* pLayoutItem)
{
if (CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pLayoutItem)) {
if (!XFA_PageWidgetFilter(pWidget, m_dwFilter, FALSE, m_bIgnorerelevant)) {
@@ -189,7 +189,7 @@ XFA_HWIDGET CXFA_FFPageWidgetIterator::GetWidget(CXFA_LayoutItem* pLayoutItem) if (!pWidget->IsLoaded() && (pWidget->GetStatus() & XFA_WIDGETSTATUS_Visible) != 0) {
pWidget->LoadWidget();
}
- return (XFA_HWIDGET)pWidget;
+ return pWidget;
}
return NULL;
}
@@ -213,62 +213,62 @@ void CXFA_FFTabOrderPageWidgetIterator::Reset() CreateTabOrderWidgetArray();
m_iCurWidget = -1;
}
-XFA_HWIDGET CXFA_FFTabOrderPageWidgetIterator::MoveToFirst()
+IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst()
{
if (m_TabOrderWidgetArray.GetSize() > 0) {
for (FX_INT32 i = 0; i < m_TabOrderWidgetArray.GetSize(); i++) {
if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) {
m_iCurWidget = i;
- return (XFA_HWIDGET)m_TabOrderWidgetArray[m_iCurWidget];
+ return m_TabOrderWidgetArray[m_iCurWidget];
}
}
}
return NULL;
}
-XFA_HWIDGET CXFA_FFTabOrderPageWidgetIterator::MoveToLast()
+IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast()
{
if (m_TabOrderWidgetArray.GetSize() > 0) {
for (FX_INT32 i = m_TabOrderWidgetArray.GetSize() - 1; i >= 0; i--) {
if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) {
m_iCurWidget = i;
- return (XFA_HWIDGET)m_TabOrderWidgetArray[m_iCurWidget];
+ return m_TabOrderWidgetArray[m_iCurWidget];
}
}
}
return NULL;
}
-XFA_HWIDGET CXFA_FFTabOrderPageWidgetIterator::MoveToNext()
+IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext()
{
for (FX_INT32 i = m_iCurWidget + 1; i < m_TabOrderWidgetArray.GetSize(); i++) {
if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) {
m_iCurWidget = i;
- return (XFA_HWIDGET)m_TabOrderWidgetArray[m_iCurWidget];
+ return m_TabOrderWidgetArray[m_iCurWidget];
}
}
m_iCurWidget = -1;
return NULL;
}
-XFA_HWIDGET CXFA_FFTabOrderPageWidgetIterator::MoveToPrevious()
+IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToPrevious()
{
for (FX_INT32 i = m_iCurWidget - 1; i >= 0; i--) {
if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) {
m_iCurWidget = i;
- return (XFA_HWIDGET)m_TabOrderWidgetArray[m_iCurWidget];
+ return m_TabOrderWidgetArray[m_iCurWidget];
}
}
m_iCurWidget = -1;
return NULL;
}
-XFA_HWIDGET CXFA_FFTabOrderPageWidgetIterator::GetCurrentWidget()
+IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::GetCurrentWidget()
{
if (m_iCurWidget >= 0) {
- return (XFA_HWIDGET)m_TabOrderWidgetArray[m_iCurWidget];
+ return m_TabOrderWidgetArray[m_iCurWidget];
}
return NULL;
}
-FX_BOOL CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget(IXFA_Widget* hWidget)
{
- FX_INT32 iWidgetIndex = m_TabOrderWidgetArray.Find((CXFA_FFWidget*)hWidget);
+ FX_INT32 iWidgetIndex = m_TabOrderWidgetArray.Find(static_cast<CXFA_FFWidget*>(hWidget));
if (iWidgetIndex >= 0) {
m_iCurWidget = iWidgetIndex;
return TRUE;
diff --git a/xfa/src/fxfa/src/app/xfa_ffpageview.h b/xfa/src/fxfa/src/app/xfa_ffpageview.h index 019c324174..dd0a481ffb 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpageview.h +++ b/xfa/src/fxfa/src/app/xfa_ffpageview.h @@ -21,7 +21,7 @@ public: virtual void UnloadPageView();
FX_BOOL IsPageViewLoaded();
- virtual XFA_HWIDGET GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy);
+ virtual IXFA_Widget* GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy);
virtual IXFA_WidgetIterator* CreateWidgetIterator(FX_DWORD dwTraverseWay = XFA_TRAVERSEWAY_Form,
FX_DWORD dwWidgetFilter = XFA_WIDGETFILTER_Visible | XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType);
IXFA_LayoutPage* GetLayoutPage()
@@ -44,16 +44,16 @@ public: }
virtual void Reset();
- virtual XFA_HWIDGET MoveToFirst();
- virtual XFA_HWIDGET MoveToLast();
- virtual XFA_HWIDGET MoveToNext();
- virtual XFA_HWIDGET MoveToPrevious();
- virtual XFA_HWIDGET GetCurrentWidget();
- virtual FX_BOOL SetCurrentWidget(XFA_HWIDGET hWidget);
+ virtual IXFA_Widget* MoveToFirst();
+ virtual IXFA_Widget* MoveToLast();
+ virtual IXFA_Widget* MoveToNext();
+ virtual IXFA_Widget* MoveToPrevious();
+ virtual IXFA_Widget* GetCurrentWidget();
+ virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget);
protected:
- XFA_HWIDGET GetWidget(CXFA_LayoutItem* pLayoutItem);
+ IXFA_Widget* GetWidget(CXFA_LayoutItem* pLayoutItem);
CXFA_FFPageView* m_pPageView;
- XFA_HWIDGET m_hCurWidget;
+ IXFA_Widget* m_hCurWidget;
FX_DWORD m_dwFilter;
FX_BOOL m_bIgnorerelevant;
CXFA_LayoutItemIterator m_sIterator;
@@ -77,12 +77,12 @@ public: virtual void Release();
virtual void Reset();
- virtual XFA_HWIDGET MoveToFirst();
- virtual XFA_HWIDGET MoveToLast();
- virtual XFA_HWIDGET MoveToNext();
- virtual XFA_HWIDGET MoveToPrevious();
- virtual XFA_HWIDGET GetCurrentWidget();
- virtual FX_BOOL SetCurrentWidget(XFA_HWIDGET hWidget);
+ virtual IXFA_Widget* MoveToFirst();
+ virtual IXFA_Widget* MoveToLast();
+ virtual IXFA_Widget* MoveToNext();
+ virtual IXFA_Widget* MoveToPrevious();
+ virtual IXFA_Widget* GetCurrentWidget();
+ virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget);
protected:
CXFA_WidgetArray m_TabOrderWidgetArray;
CXFA_FFPageView* m_pPageView;
diff --git a/xfa/src/fxfa/src/app/xfa_ffsignature.cpp b/xfa/src/fxfa/src/app/xfa_ffsignature.cpp index 42b75d60c6..a7f48c7033 100644 --- a/xfa/src/fxfa/src/app/xfa_ffsignature.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffsignature.cpp @@ -40,7 +40,7 @@ void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_ CFX_RectF rtWidget = m_rtUI;
IXFA_DocProvider* pDocProvider = m_pDataAcc->GetDoc()->GetDocProvider();
FXSYS_assert(pDocProvider);
- pDocProvider->RenderCustomWidget((XFA_HWIDGET)this, pGS, &mtRotate, rtWidget);
+ pDocProvider->RenderCustomWidget(this, pGS, &mtRotate, rtWidget);
}
FX_BOOL CXFA_FFSignature::OnMouseEnter()
{
diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp index 417891094f..5d50c52e84 100644 --- a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp +++ b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp @@ -138,7 +138,7 @@ FX_BOOL CXFA_FFTextEdit::OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) }
CFX_PointF pt;
pt.Set(fx, fy);
- GetDoc()->GetDocProvider()->PopupMenu((XFA_HWIDGET)this, pt, NULL);
+ GetDoc()->GetDocProvider()->PopupMenu(this, pt, NULL);
return TRUE;
}
FX_BOOL CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget)
@@ -388,7 +388,7 @@ void CXFA_FFTextEdit::OnTextFull(IFWL_Widget *pWidget) }
void CXFA_FFTextEdit::OnAddDoRecord(IFWL_Widget *pWidget)
{
- GetDoc()->GetDocProvider()->AddDoRecord((XFA_HWIDGET)this);
+ GetDoc()->GetDocProvider()->AddDoRecord(this);
}
FX_BOOL CXFA_FFTextEdit::CheckWord(FX_BSTR sWord)
{
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidget.h b/xfa/src/fxfa/src/app/xfa_ffwidget.h index 2e757238e6..8f19e71a0e 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidget.h +++ b/xfa/src/fxfa/src/app/xfa_ffwidget.h @@ -6,11 +6,15 @@ #ifndef _FXFA_FORMFILLER_WIDGET_IMP_H
#define _FXFA_FORMFILLER_WIDGET_IMP_H
+
+#include "../../../../include/fxfa/fxfa.h"
+
class CXFA_FFPageView;
class CXFA_FFDocView;
class CXFA_FFDoc;
class CXFA_FFApp;
class CXFA_LayoutItem;
+
#define XFA_GOTO_POSITION_IF_FAIL(arg, pos) { if (!(arg)) goto pos; }
inline FX_FLOAT XFA_UnitPx2Pt(FX_FLOAT fPx, FX_FLOAT fDpi)
{
@@ -34,7 +38,7 @@ public: CFX_PtrArray m_Globals;
FX_INT32 m_iRefCount;
};
-class CXFA_FFWidget : public CFX_PrivateData, public CXFA_ContentLayoutItemImpl
+class CXFA_FFWidget : public IXFA_Widget, public CFX_PrivateData, public CXFA_ContentLayoutItemImpl
{
public:
CXFA_FFWidget(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp index d953e2bbe3..a154d76392 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp @@ -752,7 +752,7 @@ void CXFA_WidgetAcc::NotifyEvent(FX_DWORD dwEvent, CXFA_FFWidget* pWidget , FX_L {
IXFA_DocProvider* pDocProvider = GetDoc()->GetDocProvider();
if (pWidget) {
- pDocProvider->WidgetEvent((XFA_HWIDGET)pWidget, this, dwEvent, pParam, pAdditional);
+ pDocProvider->WidgetEvent(pWidget, this, dwEvent, pParam, pAdditional);
} else {
pWidget = GetNextWidget(pWidget);
if (pWidget == NULL) {
@@ -760,7 +760,7 @@ void CXFA_WidgetAcc::NotifyEvent(FX_DWORD dwEvent, CXFA_FFWidget* pWidget , FX_L return;
}
while (pWidget) {
- pDocProvider->WidgetEvent((XFA_HWIDGET)pWidget, this, dwEvent, pParam, pAdditional);
+ pDocProvider->WidgetEvent(pWidget, this, dwEvent, pParam, pAdditional);
pWidget = GetNextWidget(pWidget);
}
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp index 9790b4bb3a..856c0792bb 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp @@ -20,160 +20,160 @@ CXFA_FFWidgetHandler::CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView) CXFA_FFWidgetHandler::~CXFA_FFWidgetHandler()
{
}
-IXFA_PageView* CXFA_FFWidgetHandler::GetPageView(XFA_HWIDGET hWidget)
+IXFA_PageView* CXFA_FFWidgetHandler::GetPageView(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->GetPageView();
+ return static_cast<CXFA_FFWidget*>(hWidget)->GetPageView();
}
-void CXFA_FFWidgetHandler::GetRect(XFA_HWIDGET hWidget, CFX_RectF &rt)
+void CXFA_FFWidgetHandler::GetRect(IXFA_Widget* hWidget, CFX_RectF &rt)
{
- ((CXFA_FFWidget*)hWidget)->GetWidgetRect(rt);
+ static_cast<CXFA_FFWidget*>(hWidget)->GetWidgetRect(rt);
}
-FX_DWORD CXFA_FFWidgetHandler::GetStatus(XFA_HWIDGET hWidget)
+FX_DWORD CXFA_FFWidgetHandler::GetStatus(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->GetStatus();
+ return static_cast<CXFA_FFWidget*>(hWidget)->GetStatus();
}
-FX_BOOL CXFA_FFWidgetHandler::GetBBox(XFA_HWIDGET hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus)
+FX_BOOL CXFA_FFWidgetHandler::GetBBox(IXFA_Widget* hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus)
{
- return ((CXFA_FFWidget*)hWidget)->GetBBox(rtBox, dwStatus, bDrawFocus);
+ return static_cast<CXFA_FFWidget*>(hWidget)->GetBBox(rtBox, dwStatus, bDrawFocus);
}
-CXFA_WidgetAcc* CXFA_FFWidgetHandler::GetDataAcc(XFA_HWIDGET hWidget)
+CXFA_WidgetAcc* CXFA_FFWidgetHandler::GetDataAcc(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->GetDataAcc();
+ return static_cast<CXFA_FFWidget*>(hWidget)->GetDataAcc();
}
-void CXFA_FFWidgetHandler::GetName(XFA_HWIDGET hWidget, CFX_WideString &wsName, FX_INT32 iNameType )
+void CXFA_FFWidgetHandler::GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType )
{
- ((CXFA_FFWidget*)hWidget)->GetDataAcc()->GetName(wsName, iNameType);
+ static_cast<CXFA_FFWidget*>(hWidget)->GetDataAcc()->GetName(wsName, iNameType);
}
-FX_BOOL CXFA_FFWidgetHandler::GetToolTip(XFA_HWIDGET hWidget, CFX_WideString &wsToolTip)
+FX_BOOL CXFA_FFWidgetHandler::GetToolTip(IXFA_Widget* hWidget, CFX_WideString &wsToolTip)
{
- return ((CXFA_FFWidget*)hWidget)->GetToolTip(wsToolTip);
+ return static_cast<CXFA_FFWidget*>(hWidget)->GetToolTip(wsToolTip);
}
-void CXFA_FFWidgetHandler::SetPrivateData(XFA_HWIDGET hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback)
+void CXFA_FFWidgetHandler::SetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback)
{
- ((CXFA_FFWidget*)hWidget)->SetPrivateData(module_id, pData, callback);
+ static_cast<CXFA_FFWidget*>(hWidget)->SetPrivateData(module_id, pData, callback);
}
-FX_LPVOID CXFA_FFWidgetHandler::GetPrivateData(XFA_HWIDGET hWidget, FX_LPVOID module_id)
+FX_LPVOID CXFA_FFWidgetHandler::GetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id)
{
- return ((CXFA_FFWidget*)hWidget)->GetPrivateData(module_id);
+ return static_cast<CXFA_FFWidget*>(hWidget)->GetPrivateData(module_id);
}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseEnter(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFWidgetHandler::OnMouseEnter(IXFA_Widget* hWidget)
{
m_pDocView->LockUpdate();
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnMouseEnter();
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnMouseEnter();
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseExit(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFWidgetHandler::OnMouseExit(IXFA_Widget* hWidget)
{
m_pDocView->LockUpdate();
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnMouseExit();
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnMouseExit();
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnLButtonDown(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnLButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
{
m_pDocView->LockUpdate();
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnLButtonDown(dwFlags, fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnLButtonDown(dwFlags, fx, fy);
if (bRet && m_pDocView->SetFocus(hWidget)) {
- ((CXFA_FFDoc*)m_pDocView->GetDoc())->GetDocProvider()->SetFocusWidget(m_pDocView->GetDoc(), (XFA_HWIDGET)hWidget);
+ ((CXFA_FFDoc*)m_pDocView->GetDoc())->GetDocProvider()->SetFocusWidget(m_pDocView->GetDoc(), (IXFA_Widget*)hWidget);
}
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnLButtonUp(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnLButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
{
m_pDocView->LockUpdate();
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
m_pDocView->m_bLayoutEvent = TRUE;
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnLButtonUp(dwFlags, fx, fy);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnLButtonUp(dwFlags, fx, fy);
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnLButtonDblClk(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnLButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
{
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnLButtonDblClk(dwFlags, fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnLButtonDblClk(dwFlags, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseMove(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
{
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnMouseMove(dwFlags, fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnMouseMove(dwFlags, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseWheel(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy)
{
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnMouseWheel(dwFlags, zDelta, fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnMouseWheel(dwFlags, zDelta, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnRButtonDown(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnRButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
{
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnRButtonDown(dwFlags, fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnRButtonDown(dwFlags, fx, fy);
if (bRet && m_pDocView->SetFocus(hWidget)) {
- ((CXFA_FFDoc*)m_pDocView->GetDoc())->GetDocProvider()->SetFocusWidget(m_pDocView->GetDoc(), (XFA_HWIDGET)hWidget);
+ ((CXFA_FFDoc*)m_pDocView->GetDoc())->GetDocProvider()->SetFocusWidget(m_pDocView->GetDoc(), (IXFA_Widget*)hWidget);
}
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnRButtonUp(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnRButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
{
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnRButtonUp(dwFlags, fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnRButtonUp(dwFlags, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnRButtonDblClk(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnRButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
{
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnRButtonDblClk(dwFlags, fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnRButtonDblClk(dwFlags, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnKeyDown(XFA_HWIDGET hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags)
+FX_BOOL CXFA_FFWidgetHandler::OnKeyDown(IXFA_Widget* hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags)
{
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnKeyDown(dwKeyCode, dwFlags);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnKeyDown(dwKeyCode, dwFlags);
m_pDocView->RunInvalidate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnKeyUp(XFA_HWIDGET hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags)
+FX_BOOL CXFA_FFWidgetHandler::OnKeyUp(IXFA_Widget* hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags)
{
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnKeyUp(dwKeyCode, dwFlags);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnKeyUp(dwKeyCode, dwFlags);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnChar(XFA_HWIDGET hWidget, FX_DWORD dwChar, FX_DWORD dwFlags)
+FX_BOOL CXFA_FFWidgetHandler::OnChar(IXFA_Widget* hWidget, FX_DWORD dwChar, FX_DWORD dwFlags)
{
- FX_BOOL bRet = ((CXFA_FFWidget*)hWidget)->OnChar(dwChar, dwFlags);
+ FX_BOOL bRet = static_cast<CXFA_FFWidget*>(hWidget)->OnChar(dwChar, dwFlags);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_DWORD CXFA_FFWidgetHandler::OnHitTest(XFA_HWIDGET hWidget, FX_FLOAT fx, FX_FLOAT fy)
+FX_DWORD CXFA_FFWidgetHandler::OnHitTest(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy)
{
- if (!(((CXFA_FFWidget*)hWidget)->GetStatus() & XFA_WIDGETSTATUS_Visible)) {
+ if (!(static_cast<CXFA_FFWidget*>(hWidget)->GetStatus() & XFA_WIDGETSTATUS_Visible)) {
return FWL_WGTHITTEST_Unknown;
}
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- return ((CXFA_FFWidget*)hWidget)->OnHitTest(fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ return static_cast<CXFA_FFWidget*>(hWidget)->OnHitTest(fx, fy);
}
-FX_BOOL CXFA_FFWidgetHandler::OnSetCursor(XFA_HWIDGET hWidget, FX_FLOAT fx, FX_FLOAT fy)
+FX_BOOL CXFA_FFWidgetHandler::OnSetCursor(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy)
{
- ((CXFA_FFWidget*)hWidget)->Rotate2Normal(fx, fy);
- return ((CXFA_FFWidget*)hWidget)->OnSetCursor(fx, fy);
+ static_cast<CXFA_FFWidget*>(hWidget)->Rotate2Normal(fx, fy);
+ return static_cast<CXFA_FFWidget*>(hWidget)->OnSetCursor(fx, fy);
}
-void CXFA_FFWidgetHandler::RenderWidget(XFA_HWIDGET hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_BOOL bHighlight)
+void CXFA_FFWidgetHandler::RenderWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_BOOL bHighlight)
{
- ((CXFA_FFWidget*)hWidget)->RenderWidget(pGS, pMatrix, bHighlight ? XFA_WIDGETSTATUS_Highlight : 0, 0);
+ static_cast<CXFA_FFWidget*>(hWidget)->RenderWidget(pGS, pMatrix, bHighlight ? XFA_WIDGETSTATUS_Highlight : 0, 0);
}
FX_BOOL CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType)
{
@@ -243,10 +243,10 @@ FX_INT32 CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_Eve FX_INT32 iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam);
return iRet;
}
-XFA_HWIDGET CXFA_FFWidgetHandler::CreateWidget(XFA_HWIDGET hParent, XFA_WIDGETTYPE eType, XFA_HWIDGET hBefore )
+IXFA_Widget* CXFA_FFWidgetHandler::CreateWidget(IXFA_Widget* hParent, XFA_WIDGETTYPE eType, IXFA_Widget* hBefore )
{
- CXFA_Node* pParentFormItem = hParent ? ((CXFA_FFWidget*)hParent)->GetDataAcc()->GetNode() : NULL;
- CXFA_Node* pBeforeFormItem = hBefore ? ((CXFA_FFWidget*)hBefore)->GetDataAcc()->GetNode() : NULL;
+ CXFA_Node* pParentFormItem = hParent ? static_cast<CXFA_FFWidget*>(hParent)->GetDataAcc()->GetNode() : NULL;
+ CXFA_Node* pBeforeFormItem = hBefore ? static_cast<CXFA_FFWidget*>(hBefore)->GetDataAcc()->GetNode() : NULL;
CXFA_Node* pNewFormItem = CreateWidgetFormItem(eType, pParentFormItem, pBeforeFormItem);
if (pNewFormItem == NULL) {
return NULL;
@@ -255,7 +255,7 @@ XFA_HWIDGET CXFA_FFWidgetHandler::CreateWidget(XFA_HWIDGET hParent, XFA_WIDGETTY pNewFormItem->SetFlag(XFA_NODEFLAG_Initialized);
m_pDocView->RunLayout();
CXFA_LayoutItem* pLayout = m_pDocView->GetXFALayout()->GetLayoutItem(pNewFormItem);
- return (XFA_HWIDGET)pLayout;
+ return (IXFA_Widget*)pLayout;
}
CXFA_Node* CXFA_FFWidgetHandler::CreateWidgetFormItem(XFA_WIDGETTYPE eType, CXFA_Node* pParent, CXFA_Node* pBefore) const
{
@@ -516,76 +516,76 @@ CXFA_FFMenuHandler::CXFA_FFMenuHandler() CXFA_FFMenuHandler::~CXFA_FFMenuHandler()
{
}
-FX_BOOL CXFA_FFMenuHandler::CanCopy(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::CanCopy(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->CanCopy();
+ return static_cast<CXFA_FFWidget*>(hWidget)->CanCopy();
}
-FX_BOOL CXFA_FFMenuHandler::CanCut(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::CanCut(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->CanCut();
+ return static_cast<CXFA_FFWidget*>(hWidget)->CanCut();
}
-FX_BOOL CXFA_FFMenuHandler::CanPaste(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::CanPaste(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->CanPaste();
+ return static_cast<CXFA_FFWidget*>(hWidget)->CanPaste();
}
-FX_BOOL CXFA_FFMenuHandler::CanSelectAll(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::CanSelectAll(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->CanSelectAll();
+ return static_cast<CXFA_FFWidget*>(hWidget)->CanSelectAll();
}
-FX_BOOL CXFA_FFMenuHandler::CanDelete(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::CanDelete(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->CanDelete();
+ return static_cast<CXFA_FFWidget*>(hWidget)->CanDelete();
}
-FX_BOOL CXFA_FFMenuHandler::CanDeSelect(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::CanDeSelect(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->CanDeSelect();
+ return static_cast<CXFA_FFWidget*>(hWidget)->CanDeSelect();
}
-FX_BOOL CXFA_FFMenuHandler::Copy(XFA_HWIDGET hWidget, CFX_WideString &wsText)
+FX_BOOL CXFA_FFMenuHandler::Copy(IXFA_Widget* hWidget, CFX_WideString &wsText)
{
- return ((CXFA_FFWidget*)hWidget)->Copy(wsText);
+ return static_cast<CXFA_FFWidget*>(hWidget)->Copy(wsText);
}
-FX_BOOL CXFA_FFMenuHandler::Cut(XFA_HWIDGET hWidget, CFX_WideString &wsText)
+FX_BOOL CXFA_FFMenuHandler::Cut(IXFA_Widget* hWidget, CFX_WideString &wsText)
{
- return ((CXFA_FFWidget*)hWidget)->Cut(wsText);
+ return static_cast<CXFA_FFWidget*>(hWidget)->Cut(wsText);
}
-FX_BOOL CXFA_FFMenuHandler::Paste(XFA_HWIDGET hWidget, const CFX_WideString &wsText)
+FX_BOOL CXFA_FFMenuHandler::Paste(IXFA_Widget* hWidget, const CFX_WideString &wsText)
{
- return ((CXFA_FFWidget*)hWidget)->Paste(wsText);
+ return static_cast<CXFA_FFWidget*>(hWidget)->Paste(wsText);
}
-FX_BOOL CXFA_FFMenuHandler::SelectAll(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::SelectAll(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->SelectAll();
+ return static_cast<CXFA_FFWidget*>(hWidget)->SelectAll();
}
-FX_BOOL CXFA_FFMenuHandler::Delete(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::Delete(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->Delete();
+ return static_cast<CXFA_FFWidget*>(hWidget)->Delete();
}
-FX_BOOL CXFA_FFMenuHandler::DeSelect(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::DeSelect(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->DeSelect();
+ return static_cast<CXFA_FFWidget*>(hWidget)->DeSelect();
}
-FX_BOOL CXFA_FFMenuHandler::CanUndo(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::CanUndo(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->CanUndo();
+ return static_cast<CXFA_FFWidget*>(hWidget)->CanUndo();
}
-FX_BOOL CXFA_FFMenuHandler::CanRedo(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::CanRedo(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->CanRedo();
+ return static_cast<CXFA_FFWidget*>(hWidget)->CanRedo();
}
-FX_BOOL CXFA_FFMenuHandler::Undo(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::Undo(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->Undo();
+ return static_cast<CXFA_FFWidget*>(hWidget)->Undo();
}
-FX_BOOL CXFA_FFMenuHandler::Redo(XFA_HWIDGET hWidget)
+FX_BOOL CXFA_FFMenuHandler::Redo(IXFA_Widget* hWidget)
{
- return ((CXFA_FFWidget*)hWidget)->Redo();
+ return static_cast<CXFA_FFWidget*>(hWidget)->Redo();
}
#define FX_EDIT_ISLATINWORD(u) (u == 0x2D || (u <= 0x005A && u >= 0x0041) || (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0) || u == 0x0027)
-FX_BOOL CXFA_FFMenuHandler::GetSuggestWords(XFA_HWIDGET hWidget, CFX_PointF pointf, CFX_ByteStringArray &sSuggest)
+FX_BOOL CXFA_FFMenuHandler::GetSuggestWords(IXFA_Widget* hWidget, CFX_PointF pointf, CFX_ByteStringArray &sSuggest)
{
- return ((CXFA_FFWidget*)hWidget)->GetSuggestWords(pointf, sSuggest);
+ return static_cast<CXFA_FFWidget*>(hWidget)->GetSuggestWords(pointf, sSuggest);
}
-FX_BOOL CXFA_FFMenuHandler::ReplaceSpellCheckWord(XFA_HWIDGET hWidget, CFX_PointF pointf, FX_BSTR bsReplace)
+FX_BOOL CXFA_FFMenuHandler::ReplaceSpellCheckWord(IXFA_Widget* hWidget, CFX_PointF pointf, FX_BSTR bsReplace)
{
- return ((CXFA_FFWidget*)hWidget)->ReplaceSpellCheckWord(pointf, bsReplace);
+ return static_cast<CXFA_FFWidget*>(hWidget)->ReplaceSpellCheckWord(pointf, bsReplace);
}
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h index 286770a0ad..28c6c84651 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h +++ b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h @@ -12,33 +12,33 @@ class CXFA_FFWidgetHandler : public IXFA_WidgetHandler public:
CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView);
~CXFA_FFWidgetHandler();
- virtual XFA_HWIDGET CreateWidget(XFA_HWIDGET hParent, XFA_WIDGETTYPE eType, XFA_HWIDGET hBefore = NULL);
- virtual IXFA_PageView* GetPageView(XFA_HWIDGET hWidget);
- virtual void GetRect(XFA_HWIDGET hWidget, CFX_RectF &rt);
- virtual FX_DWORD GetStatus(XFA_HWIDGET hWidget);
- virtual FX_BOOL GetBBox(XFA_HWIDGET hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE);
- virtual CXFA_WidgetAcc* GetDataAcc(XFA_HWIDGET hWidget);
- virtual void GetName(XFA_HWIDGET hWidget, CFX_WideString &wsName, FX_INT32 iNameType = 0);
- virtual FX_BOOL GetToolTip(XFA_HWIDGET hWidget, CFX_WideString &wsToolTip);
- virtual void SetPrivateData(XFA_HWIDGET hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
- virtual FX_LPVOID GetPrivateData(XFA_HWIDGET hWidget, FX_LPVOID module_id);
- virtual FX_BOOL OnMouseEnter(XFA_HWIDGET hWidget);
- virtual FX_BOOL OnMouseExit(XFA_HWIDGET hWidget);
- virtual FX_BOOL OnLButtonDown(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnLButtonUp(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnLButtonDblClk(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnMouseMove(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnMouseWheel(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnRButtonDown(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnRButtonUp(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnRButtonDblClk(XFA_HWIDGET hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual IXFA_Widget* CreateWidget(IXFA_Widget* hParent, XFA_WIDGETTYPE eType, IXFA_Widget* hBefore = NULL);
+ virtual IXFA_PageView* GetPageView(IXFA_Widget* hWidget);
+ virtual void GetRect(IXFA_Widget* hWidget, CFX_RectF &rt);
+ virtual FX_DWORD GetStatus(IXFA_Widget* hWidget);
+ virtual FX_BOOL GetBBox(IXFA_Widget* hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE);
+ virtual CXFA_WidgetAcc* GetDataAcc(IXFA_Widget* hWidget);
+ virtual void GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType = 0);
+ virtual FX_BOOL GetToolTip(IXFA_Widget* hWidget, CFX_WideString &wsToolTip);
+ virtual void SetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
+ virtual FX_LPVOID GetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id);
+ virtual FX_BOOL OnMouseEnter(IXFA_Widget* hWidget);
+ virtual FX_BOOL OnMouseExit(IXFA_Widget* hWidget);
+ virtual FX_BOOL OnLButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnLButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnLButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnRButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnRButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnRButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnKeyDown(XFA_HWIDGET hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags);
- virtual FX_BOOL OnKeyUp(XFA_HWIDGET hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags);
- virtual FX_BOOL OnChar(XFA_HWIDGET hWidget, FX_DWORD dwChar, FX_DWORD dwFlags);
- virtual FX_DWORD OnHitTest(XFA_HWIDGET hWidget, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnSetCursor(XFA_HWIDGET hWidget, FX_FLOAT fx, FX_FLOAT fy);
- virtual void RenderWidget(XFA_HWIDGET hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_BOOL bHighlight = FALSE);
+ virtual FX_BOOL OnKeyDown(IXFA_Widget* hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags);
+ virtual FX_BOOL OnKeyUp(IXFA_Widget* hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags);
+ virtual FX_BOOL OnChar(IXFA_Widget* hWidget, FX_DWORD dwChar, FX_DWORD dwFlags);
+ virtual FX_DWORD OnHitTest(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy);
+ virtual FX_BOOL OnSetCursor(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy);
+ virtual void RenderWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_BOOL bHighlight = FALSE);
virtual FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType);
virtual FX_INT32 ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam);
protected:
@@ -82,23 +82,23 @@ class CXFA_FFMenuHandler : public IXFA_MenuHandler public:
CXFA_FFMenuHandler();
~CXFA_FFMenuHandler();
- virtual FX_BOOL CanCopy(XFA_HWIDGET hWidget);
- virtual FX_BOOL CanCut(XFA_HWIDGET hWidget);
- virtual FX_BOOL CanPaste(XFA_HWIDGET hWidget);
- virtual FX_BOOL CanSelectAll(XFA_HWIDGET hWidget);
- virtual FX_BOOL CanDelete(XFA_HWIDGET hWidget);
- virtual FX_BOOL CanDeSelect(XFA_HWIDGET hWidget);
- virtual FX_BOOL Copy(XFA_HWIDGET hWidget, CFX_WideString &wsText);
- virtual FX_BOOL Cut(XFA_HWIDGET hWidget, CFX_WideString &wsText);
- virtual FX_BOOL Paste(XFA_HWIDGET hWidget, const CFX_WideString &wsText);
- virtual FX_BOOL SelectAll(XFA_HWIDGET hWidget);
- virtual FX_BOOL Delete(XFA_HWIDGET hWidget);
- virtual FX_BOOL DeSelect(XFA_HWIDGET hWidget);
- virtual FX_BOOL CanUndo(XFA_HWIDGET hWidget);
- virtual FX_BOOL CanRedo(XFA_HWIDGET hWidget);
- virtual FX_BOOL Undo(XFA_HWIDGET hWidget);
- virtual FX_BOOL Redo(XFA_HWIDGET hWidget);
- virtual FX_BOOL GetSuggestWords(XFA_HWIDGET hWidget, CFX_PointF pointf, CFX_ByteStringArray &sSuggest);
- virtual FX_BOOL ReplaceSpellCheckWord(XFA_HWIDGET hWidget, CFX_PointF pointf, FX_BSTR bsReplace);
+ virtual FX_BOOL CanCopy(IXFA_Widget* hWidget);
+ virtual FX_BOOL CanCut(IXFA_Widget* hWidget);
+ virtual FX_BOOL CanPaste(IXFA_Widget* hWidget);
+ virtual FX_BOOL CanSelectAll(IXFA_Widget* hWidget);
+ virtual FX_BOOL CanDelete(IXFA_Widget* hWidget);
+ virtual FX_BOOL CanDeSelect(IXFA_Widget* hWidget);
+ virtual FX_BOOL Copy(IXFA_Widget* hWidget, CFX_WideString &wsText);
+ virtual FX_BOOL Cut(IXFA_Widget* hWidget, CFX_WideString &wsText);
+ virtual FX_BOOL Paste(IXFA_Widget* hWidget, const CFX_WideString &wsText);
+ virtual FX_BOOL SelectAll(IXFA_Widget* hWidget);
+ virtual FX_BOOL Delete(IXFA_Widget* hWidget);
+ virtual FX_BOOL DeSelect(IXFA_Widget* hWidget);
+ virtual FX_BOOL CanUndo(IXFA_Widget* hWidget);
+ virtual FX_BOOL CanRedo(IXFA_Widget* hWidget);
+ virtual FX_BOOL Undo(IXFA_Widget* hWidget);
+ virtual FX_BOOL Redo(IXFA_Widget* hWidget);
+ virtual FX_BOOL GetSuggestWords(IXFA_Widget* hWidget, CFX_PointF pointf, CFX_ByteStringArray &sSuggest);
+ virtual FX_BOOL ReplaceSpellCheckWord(IXFA_Widget* hWidget, CFX_PointF pointf, FX_BSTR bsReplace);
};
#endif
diff --git a/xfa/src/fxfa/src/app/xfa_fwladapter.cpp b/xfa/src/fxfa/src/app/xfa_fwladapter.cpp index 035fa02310..4b97415310 100644 --- a/xfa/src/fxfa/src/app/xfa_fwladapter.cpp +++ b/xfa/src/fxfa/src/app/xfa_fwladapter.cpp @@ -39,10 +39,10 @@ FX_BOOL FWL_ShowCaret(IFWL_Widget *pWidget, FX_BOOL bVisible, const CFX_RectF *p pXFAWidget->GetRotateMatrix(mt);
CFX_RectF rt(*pRtAnchor);
mt.TransformRect(rt);
- pDocProvider->DisplayCaret((XFA_HWIDGET)pXFAWidget, bVisible, &rt);
+ pDocProvider->DisplayCaret(pXFAWidget, bVisible, &rt);
return TRUE;
}
- pDocProvider->DisplayCaret((XFA_HWIDGET)pXFAWidget, bVisible, pRtAnchor);
+ pDocProvider->DisplayCaret(pXFAWidget, bVisible, pRtAnchor);
return TRUE;
}
FWL_ERR CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect)
@@ -75,6 +75,6 @@ FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMi pFFWidget->GetRotateMatrix(mt);
CFX_RectF rtRotateAnchor(rtAnchor);
mt.TransformRect(rtRotateAnchor);
- pFFWidget->GetDoc()->GetDocProvider()->GetPopupPos((XFA_HWIDGET)pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup);
+ pFFWidget->GetDoc()->GetDocProvider()->GetPopupPos(pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup);
return TRUE;
}
diff --git a/xfa/src/fxfa/src/app/xfa_rendercontext.h b/xfa/src/fxfa/src/app/xfa_rendercontext.h index 974f0a3492..cb514c5cdf 100644 --- a/xfa/src/fxfa/src/app/xfa_rendercontext.h +++ b/xfa/src/fxfa/src/app/xfa_rendercontext.h @@ -20,7 +20,7 @@ public: virtual void StopRender();
protected:
IXFA_WidgetIterator* m_pWidgetIterator;
- XFA_HWIDGET m_pWidget;
+ IXFA_Widget* m_pWidget;
IXFA_PageView* m_pPageView;
CFX_Graphics* m_pGS;
CFX_Matrix m_matrix;
diff --git a/xfa/src/fxfa/src/common/xfa_document.h b/xfa/src/fxfa/src/common/xfa_document.h index 9e985e2155..e082321f22 100644 --- a/xfa/src/fxfa/src/common/xfa_document.h +++ b/xfa/src/fxfa/src/common/xfa_document.h @@ -80,8 +80,8 @@ public: virtual IXFA_DocProvider* GetDocProvider() = 0;
virtual IXFA_AppProvider* GetAppProvider() = 0;
virtual IXFA_WidgetHandler* GetWidgetHandler() = 0;
- virtual XFA_HWIDGET GetHWidget(CXFA_LayoutItem* pLayoutItem) = 0;
- virtual void OpenDropDownList(XFA_HWIDGET hWidget) = 0;
+ virtual IXFA_Widget* GetHWidget(CXFA_LayoutItem* pLayoutItem) = 0;
+ virtual void OpenDropDownList(IXFA_Widget* hWidget) = 0;
virtual CFX_WideString GetCurrentDateTime() = 0;
virtual void ResetData(CXFA_WidgetData* pWidgetData = NULL) = 0;
virtual FX_INT32 GetLayoutStatus() = 0;
diff --git a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp index 0189e5e464..f4254f0bbc 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp @@ -306,7 +306,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(CFXJSE_Arguments* if (!pDocLayout) {
return;
}
- XFA_HWIDGET hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode));
+ IXFA_Widget* hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode));
if (!hWidget) {
return;
}
diff --git a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp index b2354b6f14..25efee719d 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp @@ -427,7 +427,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(CFXJSE_A if (!pDocLayout) {
return;
}
- XFA_HWIDGET hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode));
+ IXFA_Widget* hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode));
if (!hWidget) {
return;
}
@@ -460,7 +460,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch(CFXJSE_Arg if (!pDocLayout) {
return;
}
- XFA_HWIDGET hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode));
+ IXFA_Widget* hWidget = pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode));
if (!hWidget) {
return;
}
|