Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / include / fwl / adapter / fwl_sdadapterimp.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. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _FWL_SDAPATER_IMP_H\r
8 #define _FWL_SDAPATER_IMP_H\r
9 class IFWL_AdapterNative;\r
10 class IFWL_AdapterWidgetMgr;\r
11 class IFWL_AdapterThreadMgr;\r
12 class IFWL_AdapterTimerMgr;\r
13 class IFWL_WidgetMgrDelegate;\r
14 class CFWL_SDAdatperNative;\r
15 class CFWL_SDAdapterWidgetMgr;\r
16 class CFWL_SDAdapterTimerMgr;\r
17 class CFWL_SDAdapterWidgetMgr : public IFWL_AdapterWidgetMgr, public CFX_Object\r
18 {\r
19 public:\r
20     CFWL_SDAdapterWidgetMgr();\r
21     ~CFWL_SDAdapterWidgetMgr();\r
22     virtual FWL_ERR CreateWidget(IFWL_Widget *pWidget, IFWL_Widget *pParent = NULL);\r
23     virtual FWL_ERR DestroyWidget(IFWL_Widget *pWidget);\r
24     virtual FWL_ERR SetWidgetRect(IFWL_Widget *pWidget, const CFX_RectF &rect);\r
25     virtual FWL_ERR SetWidgetPosition(IFWL_Widget *pWidget, FX_FLOAT fx, FX_FLOAT fy);\r
26     virtual FWL_ERR SetParentWidget(IFWL_Widget *pWidget, IFWL_Widget *pParent);\r
27     virtual FWL_ERR ShowWidget(IFWL_Widget *pWidget);\r
28     virtual FWL_ERR HideWidget(IFWL_Widget *pWidget);\r
29     virtual FWL_ERR SetNormal(IFWL_Widget *pWidget);\r
30     virtual FWL_ERR SetMaximize(IFWL_Widget *pWidget);\r
31     virtual FWL_ERR SetMinimize(IFWL_Widget *pWidget);\r
32     virtual FWL_ERR RunWidget(IFWL_Widget *pWidget);\r
33     virtual FWL_ERR RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect);\r
34     virtual     FWL_ERR Exit(FX_INT32 iExitCode);\r
35     virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget *pWidget, void *vp);\r
36     virtual FX_BOOL     GetPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup);\r
37 public:\r
38     virtual FWL_ERR GetWidgetRect(IFWL_Widget *pWidget, CFX_RectF &rect);\r
39     virtual FWL_ERR SetWidgetIcon(IFWL_Widget *pWidget, const CFX_DIBitmap *pIcon, FX_BOOL bBig);\r
40     virtual FWL_ERR SetWidgetCaption(IFWL_Widget *pWidget, FX_WSTR wsCaption);\r
41     virtual     FWL_ERR SetBorderRegion(IFWL_Widget *pWidget, CFX_Path *pPath);\r
42     virtual FWL_ERR SetTransparent(IFWL_Widget *pWidget, FX_DWORD dwAlpha);\r
43     virtual FWL_ERR SetFullScreen(IFWL_Widget *pWidget, FX_BOOL bFullScreen);\r
44     virtual FX_BOOL CheckMessage();\r
45     virtual FX_BOOL IsIdleMessage();\r
46     virtual FWL_ERR DispatchMessage();\r
47     virtual FWL_ERR GetWidgetDC(IFWL_Widget *pWidget, FX_LPVOID &pDC);\r
48     virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget *pWidget, FX_LPVOID pDC, CFX_RectF *pClip = 0);\r
49     virtual FX_LPVOID GetWindow(IFWL_Widget *pWidget);\r
50     virtual     FX_DWORD GetKeyState(FX_DWORD dwVirtKey);\r
51     virtual FWL_ERR  RunLoop(IFWL_Widget *widget);\r
52     virtual FWL_ERR  EndLoop();\r
53     virtual FWL_ERR  InitMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData);\r
54     virtual FWL_ERR  UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, FX_INT32 iType);\r
55     virtual FX_INT32 TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData);\r
56     virtual     FWL_ERR  SetMessageHook(IFWL_AdapterMessageHook *hook);\r
57     virtual FWL_ERR  GetSystemBorder(FX_FLOAT &l, FX_FLOAT &t, FX_FLOAT &r, FX_FLOAT &b);\r
58 };\r
59 class CFWL_SDAdapterThreadMgr : public IFWL_AdapterThreadMgr, public CFX_Object\r
60 {\r
61 public:\r
62     CFWL_SDAdapterThreadMgr();\r
63     ~CFWL_SDAdapterThreadMgr();\r
64 public:\r
65     virtual FWL_ERR             Start(IFWL_Thread *pThread, FWL_HTHREAD &hThread, FX_BOOL bSuspended = FALSE);\r
66     virtual FWL_ERR             Resume(FWL_HTHREAD hThread);\r
67     virtual FWL_ERR             Suspend(FWL_HTHREAD hThread);\r
68     virtual FWL_ERR             Kill(FWL_HTHREAD hThread, FX_INT32 iExitCode);\r
69     virtual FWL_ERR             Stop(FWL_HTHREAD hThread, FX_INT32 iExitCode);\r
70     virtual IFWL_Thread* GetCurrentThread();\r
71 };\r
72 #endif\r