Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / include / fwl / core / fwl_widgetmgr.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_WIDGETMGR_H\r
8 #define _FWL_WIDGETMGR_H\r
9 class IFWL_Widget;\r
10 class IFWL_WidgetMgr;\r
11 class IFWL_WidgetMgrDelegate;\r
12 enum FWL_WGTRELATION {\r
13     FWL_WGTRELATION_Parent = 0,\r
14     FWL_WGTRELATION_Owner,\r
15     FWL_WGTRELATION_FirstSibling,\r
16     FWL_WGTRELATION_PriorSibling,\r
17     FWL_WGTRELATION_NextSibling,\r
18     FWL_WGTRELATION_LastSibling,\r
19     FWL_WGTRELATION_FirstChild,\r
20     FWL_WGTRELATION_LastChild,\r
21     FWL_WGTRELATION_SystemForm\r
22 };\r
23 class IFWL_WidgetMgr\r
24 {\r
25 public:\r
26     virtual FX_INT32            CountWidgets(IFWL_Widget *pParent = NULL) = 0;\r
27     virtual IFWL_Widget*        GetWidget(FX_INT32 nIndex, IFWL_Widget *pParent = NULL) = 0;\r
28     virtual IFWL_Widget*        GetWidget(IFWL_Widget *pWidget, FWL_WGTRELATION eRelation) = 0;\r
29     virtual FX_INT32            GetWidgetIndex(IFWL_Widget *pWidget) = 0;\r
30     virtual FX_BOOL                     SetWidgetIndex(IFWL_Widget *pWidget, FX_INT32 nIndex) = 0;\r
31     virtual FX_BOOL                     IsWidget(FX_LPVOID pObj) = 0;\r
32     virtual FWL_ERR                     RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect = NULL) = 0;\r
33     virtual FX_DWORD            GetCapability() = 0;\r
34 };\r
35 IFWL_WidgetMgr*         FWL_GetWidgetMgr();\r
36 FX_BOOL FWL_WidgetIsChild(IFWL_Widget *parent, IFWL_Widget *find);\r
37 #define FWL_WGTMGR_DisableThread        0x00000001\r
38 #define FWL_WGTMGR_DisableForm          0x00000002\r
39 class IFWL_WidgetMgrDelegate\r
40 {\r
41 public:\r
42     virtual FWL_ERR             OnSetCapability(FX_DWORD dwCapability = FWL_WGTMGR_DisableThread) = 0;\r
43     virtual FX_INT32 OnProcessMessageToForm(CFWL_Message *pMessage) = 0;\r
44     virtual     FWL_ERR  OnDrawWidget(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL) = 0;\r
45 };\r
46 FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget *pWidget, const CFX_WideString *saveFile, const CFX_Matrix *pMatrix = NULL);\r
47 #endif\r