Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: xfa/fwl/core/cfwl_form.h

Issue 2524173002: Merge IFWL and CFWL classes. (Closed)
Patch Set: make chrome build happy Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FWL_CORE_CFWL_FORM_H_ 7 #ifndef XFA_FWL_CORE_CFWL_FORM_H_
8 #define XFA_FWL_CORE_CFWL_FORM_H_ 8 #define XFA_FWL_CORE_CFWL_FORM_H_
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "core/fxcrt/fx_system.h" 12 #include "core/fxcrt/fx_system.h"
13 #include "xfa/fwl/core/cfwl_widget.h"
13 #include "xfa/fwl/core/cfwl_widgetproperties.h" 14 #include "xfa/fwl/core/cfwl_widgetproperties.h"
14 #include "xfa/fwl/core/ifwl_widget.h"
15 15
16 #define FWL_CLASS_Form L"FWL_FORM" 16 #define FWL_CLASS_Form L"FWL_FORM"
17 #define FWL_CLASS_FormProxy L"FWL_FORMPROXY" 17 #define FWL_CLASS_FormProxy L"FWL_FORMPROXY"
18 #define FWL_STYLEEXT_FRM_Resize (1L << 0) 18 #define FWL_STYLEEXT_FRM_Resize (1L << 0)
19 #define FWL_STYLEEXT_FRM_NativeBorder (1L << 1) 19 #define FWL_STYLEEXT_FRM_NativeBorder (1L << 1)
20 #define FWL_STYLEEXT_FRM_RoundCorner (2L << 1) 20 #define FWL_STYLEEXT_FRM_RoundCorner (2L << 1)
21 #define FWL_STYLEEXT_FRM_RoundCorner4 (3L << 1) 21 #define FWL_STYLEEXT_FRM_RoundCorner4 (3L << 1)
22 #define FWL_STYLEEXT_FRM_NoDrawClient (1L << 3) 22 #define FWL_STYLEEXT_FRM_NoDrawClient (1L << 3)
23 #define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1) 23 #define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1)
24 #define FWL_STYLEEXT_FRM_Max (3) 24 #define FWL_STYLEEXT_FRM_Max (3)
25 25
26 #if (_FX_OS_ == _FX_MACOSX_) 26 #if (_FX_OS_ == _FX_MACOSX_)
27 #define FWL_UseMacSystemBorder 27 #define FWL_UseMacSystemBorder
28 #endif 28 #endif
29 29
30 class CFWL_MsgMouse; 30 class CFWL_MsgMouse;
31 class CFWL_NoteLoop; 31 class CFWL_NoteLoop;
32 class IFWL_Widget; 32 class CFWL_Widget;
33 class IFWL_ThemeProvider; 33 class IFWL_ThemeProvider;
34 class CFWL_SysBtn; 34 class CFWL_SysBtn;
35 35
36 class CFWL_Form : public IFWL_Widget { 36 class CFWL_Form : public CFWL_Widget {
37 public: 37 public:
38 CFWL_Form(const CFWL_App* app, 38 CFWL_Form(const CFWL_App* app,
39 std::unique_ptr<CFWL_WidgetProperties> properties, 39 std::unique_ptr<CFWL_WidgetProperties> properties,
40 IFWL_Widget* pOuter); 40 CFWL_Widget* pOuter);
41 ~CFWL_Form() override; 41 ~CFWL_Form() override;
42 42
43 // IFWL_Widget 43 // CFWL_Widget
44 FWL_Type GetClassID() const override; 44 FWL_Type GetClassID() const override;
45 bool IsInstance(const CFX_WideStringC& wsClass) const override; 45 bool IsInstance(const CFX_WideStringC& wsClass) const override;
46 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; 46 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
47 void GetClientRect(CFX_RectF& rect) override; 47 void GetClientRect(CFX_RectF& rect) override;
48 void Update() override; 48 void Update() override;
49 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; 49 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
50 void DrawWidget(CFX_Graphics* pGraphics, 50 void DrawWidget(CFX_Graphics* pGraphics,
51 const CFX_Matrix* pMatrix = nullptr) override; 51 const CFX_Matrix* pMatrix = nullptr) override;
52 void OnProcessMessage(CFWL_Message* pMessage) override; 52 void OnProcessMessage(CFWL_Message* pMessage) override;
53 void OnDrawWidget(CFX_Graphics* pGraphics, 53 void OnDrawWidget(CFX_Graphics* pGraphics,
54 const CFX_Matrix* pMatrix) override; 54 const CFX_Matrix* pMatrix) override;
55 55
56 IFWL_Widget* DoModal(); 56 CFWL_Widget* DoModal();
57 void EndDoModal(); 57 void EndDoModal();
58 58
59 IFWL_Widget* GetSubFocus() const { return m_pSubFocus; } 59 CFWL_Widget* GetSubFocus() const { return m_pSubFocus; }
60 void SetSubFocus(IFWL_Widget* pWidget) { m_pSubFocus = pWidget; } 60 void SetSubFocus(CFWL_Widget* pWidget) { m_pSubFocus = pWidget; }
61 61
62 private: 62 private:
63 void DrawBackground(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); 63 void DrawBackground(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme);
64 void RemoveSysButtons(); 64 void RemoveSysButtons();
65 CFWL_SysBtn* GetSysBtnAtPoint(FX_FLOAT fx, FX_FLOAT fy); 65 CFWL_SysBtn* GetSysBtnAtPoint(FX_FLOAT fx, FX_FLOAT fy);
66 CFWL_SysBtn* GetSysBtnByState(uint32_t dwState); 66 CFWL_SysBtn* GetSysBtnByState(uint32_t dwState);
67 CFWL_SysBtn* GetSysBtnByIndex(int32_t nIndex); 67 CFWL_SysBtn* GetSysBtnByIndex(int32_t nIndex);
68 int32_t GetSysBtnIndex(CFWL_SysBtn* pBtn); 68 int32_t GetSysBtnIndex(CFWL_SysBtn* pBtn);
69 void GetEdgeRect(CFX_RectF& rtEdge); 69 void GetEdgeRect(CFX_RectF& rtEdge);
70 void SetWorkAreaRect(); 70 void SetWorkAreaRect();
71 void Layout(); 71 void Layout();
72 void ResetSysBtn(); 72 void ResetSysBtn();
73 void RegisterForm(); 73 void RegisterForm();
74 void UnRegisterForm(); 74 void UnRegisterForm();
75 void OnLButtonDown(CFWL_MsgMouse* pMsg); 75 void OnLButtonDown(CFWL_MsgMouse* pMsg);
76 void OnLButtonUp(CFWL_MsgMouse* pMsg); 76 void OnLButtonUp(CFWL_MsgMouse* pMsg);
77 void OnMouseMove(CFWL_MsgMouse* pMsg); 77 void OnMouseMove(CFWL_MsgMouse* pMsg);
78 void OnMouseLeave(CFWL_MsgMouse* pMsg); 78 void OnMouseLeave(CFWL_MsgMouse* pMsg);
79 void OnLButtonDblClk(CFWL_MsgMouse* pMsg); 79 void OnLButtonDblClk(CFWL_MsgMouse* pMsg);
80 80
81 #if (_FX_OS_ == _FX_MACOSX_) 81 #if (_FX_OS_ == _FX_MACOSX_)
82 bool m_bMouseIn; 82 bool m_bMouseIn;
83 #endif 83 #endif
84 CFX_RectF m_rtRestore; 84 CFX_RectF m_rtRestore;
85 CFX_RectF m_rtRelative; 85 CFX_RectF m_rtRelative;
86 CFWL_SysBtn* m_pCloseBox; 86 CFWL_SysBtn* m_pCloseBox;
87 CFWL_SysBtn* m_pMinBox; 87 CFWL_SysBtn* m_pMinBox;
88 CFWL_SysBtn* m_pMaxBox; 88 CFWL_SysBtn* m_pMaxBox;
89 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; 89 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop;
90 IFWL_Widget* m_pSubFocus; 90 CFWL_Widget* m_pSubFocus;
91 FX_FLOAT m_fCXBorder; 91 FX_FLOAT m_fCXBorder;
92 FX_FLOAT m_fCYBorder; 92 FX_FLOAT m_fCYBorder;
93 int32_t m_iCaptureBtn; 93 int32_t m_iCaptureBtn;
94 int32_t m_iSysBox; 94 int32_t m_iSysBox;
95 bool m_bLButtonDown; 95 bool m_bLButtonDown;
96 bool m_bMaximized; 96 bool m_bMaximized;
97 bool m_bSetMaximize; 97 bool m_bSetMaximize;
98 bool m_bDoModalFlag; 98 bool m_bDoModalFlag;
99 }; 99 };
100 100
101 #endif // XFA_FWL_CORE_CFWL_FORM_H_ 101 #endif // XFA_FWL_CORE_CFWL_FORM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698