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