| OLD | NEW |
| 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_IFWL_FORM_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_FORM_H_ |
| 8 #define XFA_FWL_CORE_IFWL_FORM_H_ | 8 #define XFA_FWL_CORE_IFWL_FORM_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class CFWL_SysBtn { | 42 class CFWL_SysBtn { |
| 43 public: | 43 public: |
| 44 CFWL_SysBtn(); | 44 CFWL_SysBtn(); |
| 45 | 45 |
| 46 bool IsDisabled() const; | 46 bool IsDisabled() const; |
| 47 uint32_t GetPartState() const; | 47 uint32_t GetPartState() const; |
| 48 | 48 |
| 49 void SetNormal(); | 49 void SetNormal(); |
| 50 void SetPressed(); | 50 void SetPressed(); |
| 51 void SetHover(); | 51 void SetHover(); |
| 52 void SetDisabled(FX_BOOL bDisabled); | 52 void SetDisabled(bool bDisabled); |
| 53 | 53 |
| 54 CFX_RectF m_rtBtn; | 54 CFX_RectF m_rtBtn; |
| 55 uint32_t m_dwState; | 55 uint32_t m_dwState; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 enum FORM_RESIZETYPE { | 58 enum FORM_RESIZETYPE { |
| 59 FORM_RESIZETYPE_None = 0, | 59 FORM_RESIZETYPE_None = 0, |
| 60 FORM_RESIZETYPE_Cap, | 60 FORM_RESIZETYPE_Cap, |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 struct RestoreInfo { | 63 struct RestoreInfo { |
| 64 RestoreInfo(); | 64 RestoreInfo(); |
| 65 ~RestoreInfo(); | 65 ~RestoreInfo(); |
| 66 | 66 |
| 67 CFX_PointF m_ptStart; | 67 CFX_PointF m_ptStart; |
| 68 CFX_SizeF m_szStart; | 68 CFX_SizeF m_szStart; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 class CFWL_MsgMouse; | 71 class CFWL_MsgMouse; |
| 72 class CFWL_MsgClose; | 72 class CFWL_MsgClose; |
| 73 class CFWL_MsgWindowMove; | 73 class CFWL_MsgWindowMove; |
| 74 class CFWL_NoteLoop; | 74 class CFWL_NoteLoop; |
| 75 class CFWL_WidgetImpProperties; | 75 class CFWL_WidgetImpProperties; |
| 76 class IFWL_Widget; | 76 class IFWL_Widget; |
| 77 class IFWL_ThemeProvider; | 77 class IFWL_ThemeProvider; |
| 78 class CFWL_SysBtn; | 78 class CFWL_SysBtn; |
| 79 | 79 |
| 80 class IFWL_FormDP : public IFWL_DataProvider { | 80 class IFWL_FormDP : public IFWL_DataProvider { |
| 81 public: | 81 public: |
| 82 virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, FX_BOOL bBig) = 0; | 82 virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, bool bBig) = 0; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 class IFWL_Form : public IFWL_Widget { | 85 class IFWL_Form : public IFWL_Widget { |
| 86 public: | 86 public: |
| 87 IFWL_Form(const IFWL_App* app, | 87 IFWL_Form(const IFWL_App* app, |
| 88 const CFWL_WidgetImpProperties& properties, | 88 const CFWL_WidgetImpProperties& properties, |
| 89 IFWL_Widget* pOuter); | 89 IFWL_Widget* pOuter); |
| 90 ~IFWL_Form() override; | 90 ~IFWL_Form() override; |
| 91 | 91 |
| 92 // IFWL_Widget | 92 // IFWL_Widget |
| 93 FWL_Type GetClassID() const override; | 93 FWL_Type GetClassID() const override; |
| 94 FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const override; | 94 bool IsInstance(const CFX_WideStringC& wsClass) const override; |
| 95 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 95 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
| 96 FWL_Error GetClientRect(CFX_RectF& rect) override; | 96 FWL_Error GetClientRect(CFX_RectF& rect) override; |
| 97 FWL_Error Update() override; | 97 FWL_Error Update() override; |
| 98 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 98 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
| 99 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 99 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
| 100 const CFX_Matrix* pMatrix = nullptr) override; | 100 const CFX_Matrix* pMatrix = nullptr) override; |
| 101 void OnProcessMessage(CFWL_Message* pMessage) override; | 101 void OnProcessMessage(CFWL_Message* pMessage) override; |
| 102 void OnDrawWidget(CFX_Graphics* pGraphics, | 102 void OnDrawWidget(CFX_Graphics* pGraphics, |
| 103 const CFX_Matrix* pMatrix) override; | 103 const CFX_Matrix* pMatrix) override; |
| 104 | 104 |
| 105 FWL_FORMSIZE GetFormSize(); | 105 FWL_FORMSIZE GetFormSize(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 129 void DrawIconImage(CFX_Graphics* pGs, | 129 void DrawIconImage(CFX_Graphics* pGs, |
| 130 IFWL_ThemeProvider* pTheme, | 130 IFWL_ThemeProvider* pTheme, |
| 131 const CFX_Matrix* pMatrix = nullptr); | 131 const CFX_Matrix* pMatrix = nullptr); |
| 132 void GetEdgeRect(CFX_RectF& rtEdge); | 132 void GetEdgeRect(CFX_RectF& rtEdge); |
| 133 void SetWorkAreaRect(); | 133 void SetWorkAreaRect(); |
| 134 void SetCursor(FX_FLOAT fx, FX_FLOAT fy); | 134 void SetCursor(FX_FLOAT fx, FX_FLOAT fy); |
| 135 void Layout(); | 135 void Layout(); |
| 136 void ReSetSysBtn(); | 136 void ReSetSysBtn(); |
| 137 void RegisterForm(); | 137 void RegisterForm(); |
| 138 void UnRegisterForm(); | 138 void UnRegisterForm(); |
| 139 FX_BOOL IsDoModal(); | 139 bool IsDoModal(); |
| 140 void SetThemeData(); | 140 void SetThemeData(); |
| 141 FX_BOOL HasIcon(); | 141 bool HasIcon(); |
| 142 void UpdateIcon(); | 142 void UpdateIcon(); |
| 143 void UpdateCaption(); | 143 void UpdateCaption(); |
| 144 void DoWidthLimit(FX_FLOAT& fLeft, | 144 void DoWidthLimit(FX_FLOAT& fLeft, |
| 145 FX_FLOAT& fWidth, | 145 FX_FLOAT& fWidth, |
| 146 FX_FLOAT fCurX, | 146 FX_FLOAT fCurX, |
| 147 FX_FLOAT fSpace, | 147 FX_FLOAT fSpace, |
| 148 FX_FLOAT fLimitMin, | 148 FX_FLOAT fLimitMin, |
| 149 FX_FLOAT fLimitMax, | 149 FX_FLOAT fLimitMax, |
| 150 FX_BOOL bLeft); | 150 bool bLeft); |
| 151 void DoHeightLimit(FX_FLOAT& fTop, | 151 void DoHeightLimit(FX_FLOAT& fTop, |
| 152 FX_FLOAT& fHeight, | 152 FX_FLOAT& fHeight, |
| 153 FX_FLOAT fCurY, | 153 FX_FLOAT fCurY, |
| 154 FX_FLOAT fSpace, | 154 FX_FLOAT fSpace, |
| 155 FX_FLOAT fLimitMin, | 155 FX_FLOAT fLimitMin, |
| 156 FX_FLOAT fLimitMax, | 156 FX_FLOAT fLimitMax, |
| 157 FX_BOOL bTop); | 157 bool bTop); |
| 158 | 158 |
| 159 CFX_RectF m_rtRestore; | 159 CFX_RectF m_rtRestore; |
| 160 CFX_RectF m_rtCaptionText; | 160 CFX_RectF m_rtCaptionText; |
| 161 CFX_RectF m_rtRelative; | 161 CFX_RectF m_rtRelative; |
| 162 CFX_RectF m_rtCaption; | 162 CFX_RectF m_rtCaption; |
| 163 CFX_RectF m_rtIcon; | 163 CFX_RectF m_rtIcon; |
| 164 CFWL_SysBtn* m_pCloseBox; | 164 CFWL_SysBtn* m_pCloseBox; |
| 165 CFWL_SysBtn* m_pMinBox; | 165 CFWL_SysBtn* m_pMinBox; |
| 166 CFWL_SysBtn* m_pMaxBox; | 166 CFWL_SysBtn* m_pMaxBox; |
| 167 CFWL_SysBtn* m_pCaptionBox; | 167 CFWL_SysBtn* m_pCaptionBox; |
| 168 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; | 168 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; |
| 169 IFWL_Widget* m_pSubFocus; | 169 IFWL_Widget* m_pSubFocus; |
| 170 RestoreInfo m_InfoStart; | 170 RestoreInfo m_InfoStart; |
| 171 FX_FLOAT m_fCXBorder; | 171 FX_FLOAT m_fCXBorder; |
| 172 FX_FLOAT m_fCYBorder; | 172 FX_FLOAT m_fCYBorder; |
| 173 int32_t m_iCaptureBtn; | 173 int32_t m_iCaptureBtn; |
| 174 int32_t m_iSysBox; | 174 int32_t m_iSysBox; |
| 175 int32_t m_eResizeType; | 175 int32_t m_eResizeType; |
| 176 FX_BOOL m_bLButtonDown; | 176 bool m_bLButtonDown; |
| 177 bool m_bMaximized; | 177 bool m_bMaximized; |
| 178 FX_BOOL m_bSetMaximize; | 178 bool m_bSetMaximize; |
| 179 bool m_bCustomizeLayout; | 179 bool m_bCustomizeLayout; |
| 180 FWL_FORMSIZE m_eFormSize; | 180 FWL_FORMSIZE m_eFormSize; |
| 181 FX_BOOL m_bDoModalFlag; | 181 bool m_bDoModalFlag; |
| 182 FX_FLOAT m_fSmallIconSz; | 182 FX_FLOAT m_fSmallIconSz; |
| 183 FX_FLOAT m_fBigIconSz; | 183 FX_FLOAT m_fBigIconSz; |
| 184 CFX_DIBitmap* m_pBigIcon; | 184 CFX_DIBitmap* m_pBigIcon; |
| 185 CFX_DIBitmap* m_pSmallIcon; | 185 CFX_DIBitmap* m_pSmallIcon; |
| 186 FX_BOOL m_bMouseIn; | 186 bool m_bMouseIn; |
| 187 | 187 |
| 188 private: | 188 private: |
| 189 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 189 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
| 190 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 190 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
| 191 void OnMouseMove(CFWL_MsgMouse* pMsg); | 191 void OnMouseMove(CFWL_MsgMouse* pMsg); |
| 192 void OnMouseHover(CFWL_MsgMouse* pMsg); | 192 void OnMouseHover(CFWL_MsgMouse* pMsg); |
| 193 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 193 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
| 194 void OnLButtonDblClk(CFWL_MsgMouse* pMsg); | 194 void OnLButtonDblClk(CFWL_MsgMouse* pMsg); |
| 195 void OnWindowMove(CFWL_MsgWindowMove* pMsg); | 195 void OnWindowMove(CFWL_MsgWindowMove* pMsg); |
| 196 void OnClose(CFWL_MsgClose* pMsg); | 196 void OnClose(CFWL_MsgClose* pMsg); |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 #endif // XFA_FWL_CORE_IFWL_FORM_H_ | 199 #endif // XFA_FWL_CORE_IFWL_FORM_H_ |
| OLD | NEW |