Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / include / fwl / core / fwl_form.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_FORM_H\r
8 #define _FWL_FORM_H\r
9 class IFWL_Widget;\r
10 class IFWL_Panel;\r
11 class IFWL_Form;\r
12 #define FWL_CLASS_Form                                  L"FWL_FORM"\r
13 #define FWL_CLASSHASH_Form                              881567292\r
14 #define FWL_CLASS_FormProxy                             L"FWL_FORMPROXY"\r
15 #define FWL_CLASSHASH_FormProxy                 881567291\r
16 #define FWL_STYLEEXT_FRM_Resize                 (1L << 0)\r
17 #define FWL_STYLEEXT_FRM_NativeBorder   (1L << 1)\r
18 #define FWL_STYLEEXT_FRM_RoundCorner    (2L << 1)\r
19 #define FWL_STYLEEXT_FRM_RoundCorner4   (3L << 1)\r
20 #define FWL_STYLEEXT_FRM_NoDrawClient   (1L << 3)\r
21 #define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1)\r
22 #define FWL_STYLEEXT_FRM_Max                    (3)\r
23 #if (_FX_OS_==_FX_MACOSX_)\r
24 #define FWL_UseMacSystemBorder\r
25 #endif\r
26 #define FWL_WGTCAPACITY_FRM_CYCaption           (FWL_WGTCAPACITY_MAX + 1)\r
27 #define FWL_WGTCAPACITY_FRM_CYNarrowCaption     (FWL_WGTCAPACITY_MAX + 2)\r
28 #define FWL_WGTCAPACITY_FRM_BigIcon                     (FWL_WGTCAPACITY_MAX + 3)\r
29 #define FWL_WGTCAPACITY_FRM_SmallIcon           (FWL_WGTCAPACITY_MAX + 4)\r
30 #define FWL_PART_FRM_Border                             1\r
31 #define FWL_PART_FRM_Edge                               2\r
32 #define FWL_PART_FRM_Background                 3\r
33 #define FWL_PART_FRM_Caption                    4\r
34 #define FWL_PART_FRM_NarrowCaption              5\r
35 #define FWL_PART_FRM_CloseBox                   6\r
36 #define FWL_PART_FRM_MinimizeBox                7\r
37 #define FWL_PART_FRM_MaximizeBox                8\r
38 #define FWL_PART_FRM_HeadText                   9\r
39 #define FWL_PART_FRM_Icon                               10\r
40 #define FWL_PARTSTATE_FRM_Normal                1\r
41 #define FWL_PARTSTATE_FRM_Hover                 2\r
42 #define FWL_PARTSTATE_FRM_Pressed               3\r
43 #define FWL_PARTSTATE_FRM_Inactive              4\r
44 #define FWL_PARTSTATE_FRM_Disabled              5\r
45 class IFWL_FormDP : public IFWL_DataProvider\r
46 {\r
47 public:\r
48     virtual CFX_DIBitmap* GetIcon(IFWL_Widget *pWidget, FX_BOOL bBig) = 0;\r
49 };\r
50 enum FWL_FORMSIZE {\r
51     FWL_FORMSIZE_Manual = 0,\r
52     FWL_FORMSIZE_Width,\r
53     FWL_FORMSIZE_Height,\r
54     FWL_FORMSIZE_All,\r
55 };\r
56 enum FWL_COMMANDID {\r
57     FWL_COMMANDID_Close = 0,\r
58     FWL_COMMANDID_Ok,\r
59     FWL_COMMANDID_Cancel,\r
60     FWL_COMMANDID_Abort,\r
61     FWL_COMMANDID_Retry,\r
62     FWL_COMMANDID_Ignore,\r
63     FWL_COMMANDID_Yes,\r
64     FWL_COMMANDID_No,\r
65 };\r
66 class IFWL_Form : public IFWL_Panel\r
67 {\r
68 public:\r
69     static IFWL_Form*   Create();\r
70     FWL_ERR                     Initialize(IFWL_Widget *pOuter = NULL);\r
71     FWL_ERR                     Initialize(CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);\r
72     FWL_ERR                     Initialize(CFWL_WidgetImpProperties &properties, CFX_WideString *classname, IFWL_Widget *pOuter = NULL);\r
73     FWL_FORMSIZE        GetFormSize();\r
74     FWL_ERR                     SetFormSize(FWL_FORMSIZE eFormSize);\r
75     IFWL_Widget*        DoModal();\r
76     IFWL_Widget*        DoModal(FX_DWORD &dwCommandID);\r
77     FWL_ERR                     EndDoModal();\r
78     FWL_ERR                     SetBorderRegion(CFX_Path *pPath);\r
79 protected:\r
80     IFWL_Form();\r
81     virtual ~IFWL_Form();\r
82 };\r
83 #endif\r