Replace XFA_HWIDGET with IXFA_Widget*
[pdfium.git] / xfa / src / fxfa / src / app / xfa_ffwidgethandler.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc.\r
6 \r
9 class CXFA_FFDocView;\r
10 class CXFA_FFWidgetHandler : public IXFA_WidgetHandler\r
11 {\r
12 public:\r
13     CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView);\r
14     ~CXFA_FFWidgetHandler();\r
15     virtual IXFA_Widget*                CreateWidget(IXFA_Widget* hParent, XFA_WIDGETTYPE eType, IXFA_Widget* hBefore = NULL);\r
16     virtual IXFA_PageView*      GetPageView(IXFA_Widget* hWidget);\r
17     virtual void                        GetRect(IXFA_Widget* hWidget, CFX_RectF &rt);\r
18     virtual FX_DWORD            GetStatus(IXFA_Widget* hWidget);\r
19     virtual FX_BOOL                     GetBBox(IXFA_Widget* hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE);\r
20     virtual CXFA_WidgetAcc*     GetDataAcc(IXFA_Widget* hWidget);\r
21     virtual void                        GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType = 0);\r
22     virtual     FX_BOOL                 GetToolTip(IXFA_Widget* hWidget, CFX_WideString &wsToolTip);\r
23     virtual     void                    SetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);\r
24     virtual     FX_LPVOID               GetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id);\r
25     virtual FX_BOOL             OnMouseEnter(IXFA_Widget* hWidget);\r
26     virtual FX_BOOL             OnMouseExit(IXFA_Widget* hWidget);\r
27     virtual FX_BOOL             OnLButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);\r
28     virtual FX_BOOL             OnLButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);\r
29     virtual FX_BOOL             OnLButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);\r
30     virtual FX_BOOL             OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);\r
31     virtual FX_BOOL             OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy);\r
32     virtual FX_BOOL             OnRButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);\r
33     virtual FX_BOOL             OnRButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);\r
34     virtual FX_BOOL             OnRButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);\r
35 \r
36     virtual FX_BOOL             OnKeyDown(IXFA_Widget* hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags);\r
37     virtual FX_BOOL             OnKeyUp(IXFA_Widget* hWidget, FX_DWORD dwKeyCode, FX_DWORD dwFlags);\r
38     virtual FX_BOOL             OnChar(IXFA_Widget* hWidget, FX_DWORD dwChar, FX_DWORD dwFlags);\r
39     virtual     FX_DWORD        OnHitTest(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy);\r
40     virtual FX_BOOL             OnSetCursor(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy);\r
41     virtual void                RenderWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_BOOL bHighlight = FALSE);\r
42     virtual FX_BOOL             HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType);\r
43     virtual FX_INT32    ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam);\r
44 protected:\r
45     CXFA_Node*          CreateWidgetFormItem(XFA_WIDGETTYPE eType, CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
46 \r
47     CXFA_Node*          CreatePushButton(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
48     CXFA_Node*          CreateCheckButton(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
49     CXFA_Node*          CreateExclGroup(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
50     CXFA_Node*          CreateRadioButton(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
51     CXFA_Node*          CreateDatetimeEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
52     CXFA_Node*          CreateDecimalField(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
53     CXFA_Node*          CreateNumericField(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
54     CXFA_Node*          CreateSignature(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
55     CXFA_Node*          CreateTextEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
56     CXFA_Node*          CreateDropdownList(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
57     CXFA_Node*          CreateListBox(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
58     CXFA_Node*          CreateImageField(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
59     CXFA_Node*          CreatePasswordEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
60     CXFA_Node*          CreateField(XFA_ELEMENT eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
61     CXFA_Node*          CreateArc(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
62     CXFA_Node*          CreateRectangle(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
63     CXFA_Node*          CreateImage(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
64     CXFA_Node*          CreateLine(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
65     CXFA_Node*          CreateText(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
66     CXFA_Node*          CreateDraw(XFA_ELEMENT eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
67 \r
68     CXFA_Node*          CreateSubform(CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
69     CXFA_Node*          CreateFormItem(XFA_ELEMENT eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
70     CXFA_Node*                  CreateCopyNode(XFA_ELEMENT eElement, CXFA_Node* pParent, CXFA_Node* pBefore = NULL) const;\r
71     CXFA_Node*                  CreateTemplateNode(XFA_ELEMENT eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const;\r
72     CXFA_Node*                  CreateFontNode(CXFA_Node* pParent) const;\r
73     CXFA_Node*                  CreateMarginNode(CXFA_Node* pParent, FX_DWORD dwFlags, FX_FLOAT fInsets[4]) const;\r
74     CXFA_Node*                  CreateValueNode(XFA_ELEMENT eValue, CXFA_Node* pParent) const;\r
75     IXFA_ObjFactory*    GetObjFactory() const;\r
76     CXFA_Document*              GetXFADoc() const;\r
77 \r
78     CXFA_FFDocView*             m_pDocView;\r
79 };\r
80 class CXFA_FFMenuHandler : public IXFA_MenuHandler\r
81 {\r
82 public:\r
83     CXFA_FFMenuHandler();\r
84     ~CXFA_FFMenuHandler();\r
85     virtual FX_BOOL             CanCopy(IXFA_Widget* hWidget);\r
86     virtual FX_BOOL             CanCut(IXFA_Widget* hWidget);\r
87     virtual FX_BOOL             CanPaste(IXFA_Widget* hWidget);\r
88     virtual FX_BOOL             CanSelectAll(IXFA_Widget* hWidget);\r
89     virtual FX_BOOL             CanDelete(IXFA_Widget* hWidget);\r
90     virtual FX_BOOL             CanDeSelect(IXFA_Widget* hWidget);\r
91     virtual FX_BOOL             Copy(IXFA_Widget* hWidget, CFX_WideString &wsText);\r
92     virtual FX_BOOL             Cut(IXFA_Widget* hWidget, CFX_WideString &wsText);\r
93     virtual FX_BOOL             Paste(IXFA_Widget* hWidget, const CFX_WideString &wsText);\r
94     virtual FX_BOOL             SelectAll(IXFA_Widget* hWidget);\r
95     virtual FX_BOOL             Delete(IXFA_Widget* hWidget);\r
96     virtual FX_BOOL             DeSelect(IXFA_Widget* hWidget);\r
97     virtual FX_BOOL             CanUndo(IXFA_Widget* hWidget);\r
98     virtual FX_BOOL             CanRedo(IXFA_Widget* hWidget);\r
99     virtual FX_BOOL             Undo(IXFA_Widget* hWidget);\r
100     virtual FX_BOOL             Redo(IXFA_Widget* hWidget);\r
101     virtual FX_BOOL             GetSuggestWords(IXFA_Widget* hWidget, CFX_PointF pointf, CFX_ByteStringArray &sSuggest);\r
102     virtual FX_BOOL             ReplaceSpellCheckWord(IXFA_Widget* hWidget, CFX_PointF pointf, FX_BSTR bsReplace);\r
103 };\r
104 #endif\r