1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef XFA_FWL_CORE_IFWL_FORM_H_ 8 #define XFA_FWL_CORE_IFWL_FORM_H_ 9 10 #include "xfa/fwl/core/ifwl_dataprovider.h" 11 #include "xfa/fwl/core/ifwl_widget.h" 12 #include "core/fxcrt/include/fx_system.h" 13 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" 14 15 #define FWL_CLASS_Form L"FWL_FORM" 16 #define FWL_CLASS_FormProxy L"FWL_FORMPROXY" 17 #define FWL_STYLEEXT_FRM_Resize (1L << 0) 18 #define FWL_STYLEEXT_FRM_NativeBorder (1L << 1) 19 #define FWL_STYLEEXT_FRM_RoundCorner (2L << 1) 20 #define FWL_STYLEEXT_FRM_RoundCorner4 (3L << 1) 21 #define FWL_STYLEEXT_FRM_NoDrawClient (1L << 3) 22 #define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1) 23 #define FWL_STYLEEXT_FRM_Max (3) 24 25 #if (_FX_OS_ == _FX_MACOSX_) 26 #define FWL_UseMacSystemBorder 27 #endif 28 29 enum FWL_FORMSIZE { 30 FWL_FORMSIZE_Manual = 0, 31 FWL_FORMSIZE_Width, 32 FWL_FORMSIZE_Height, 33 FWL_FORMSIZE_All, 34 }; 35 36 class CFX_DIBitmap; 37 class CFX_WideString; 38 class CFX_Path; 39 class IFWL_Widget; 40 class IFWL_Form; 41 42 class IFWL_FormDP : public IFWL_DataProvider { 43 public: 44 virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, FX_BOOL bBig) = 0; 45 }; 46 47 class IFWL_Form : public IFWL_Widget { 48 public: 49 static IFWL_Form* CreateFormProxy(CFWL_WidgetImpProperties& properties, 50 CFX_WideString* classname, 51 IFWL_Widget* pOuter); 52 53 FWL_FORMSIZE GetFormSize(); 54 FWL_Error SetFormSize(FWL_FORMSIZE eFormSize); 55 IFWL_Widget* DoModal(); 56 IFWL_Widget* DoModal(uint32_t& dwCommandID); 57 FWL_Error EndDoModal(); 58 FWL_Error SetBorderRegion(CFX_Path* pPath); 59 60 protected: 61 IFWL_Form(); 62 }; 63 64 #endif // XFA_FWL_CORE_IFWL_FORM_H_ 65