summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_form.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-23 16:03:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-23 16:03:10 -0800
commit0ce11eef157b791c661d7e82e1c5641605b9f03d (patch)
treee5166163947824e52c417b4a65c2c7d965c00dad /xfa/fwl/core/cfwl_form.h
parent2430b30088c3e3396ccf26a10d360d0553404bb0 (diff)
downloadpdfium-0ce11eef157b791c661d7e82e1c5641605b9f03d.tar.xz
Rename IFWL classes which do not have CFWL equivalents
This CL moves the IFWL classes that do not have CFWL class buddies to have the CFWL name. This CL leaves the tree in a weird state of having CFWL be two hierarchies, one of which is intertwined with the IFWL hierarchy. This should be commited just before the CL to move the rest of IFWL to CFWL. Review-Url: https://codereview.chromium.org/2525083002
Diffstat (limited to 'xfa/fwl/core/cfwl_form.h')
-rw-r--r--xfa/fwl/core/cfwl_form.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/xfa/fwl/core/cfwl_form.h b/xfa/fwl/core/cfwl_form.h
new file mode 100644
index 0000000000..cb01c5b7a8
--- /dev/null
+++ b/xfa/fwl/core/cfwl_form.h
@@ -0,0 +1,101 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_FWL_CORE_CFWL_FORM_H_
+#define XFA_FWL_CORE_CFWL_FORM_H_
+
+#include <memory>
+
+#include "core/fxcrt/fx_system.h"
+#include "xfa/fwl/core/cfwl_widgetproperties.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+
+#define FWL_CLASS_Form L"FWL_FORM"
+#define FWL_CLASS_FormProxy L"FWL_FORMPROXY"
+#define FWL_STYLEEXT_FRM_Resize (1L << 0)
+#define FWL_STYLEEXT_FRM_NativeBorder (1L << 1)
+#define FWL_STYLEEXT_FRM_RoundCorner (2L << 1)
+#define FWL_STYLEEXT_FRM_RoundCorner4 (3L << 1)
+#define FWL_STYLEEXT_FRM_NoDrawClient (1L << 3)
+#define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1)
+#define FWL_STYLEEXT_FRM_Max (3)
+
+#if (_FX_OS_ == _FX_MACOSX_)
+#define FWL_UseMacSystemBorder
+#endif
+
+class CFWL_MsgMouse;
+class CFWL_NoteLoop;
+class IFWL_Widget;
+class IFWL_ThemeProvider;
+class CFWL_SysBtn;
+
+class CFWL_Form : public IFWL_Widget {
+ public:
+ CFWL_Form(const CFWL_App* app,
+ std::unique_ptr<CFWL_WidgetProperties> properties,
+ IFWL_Widget* pOuter);
+ ~CFWL_Form() override;
+
+ // IFWL_Widget
+ FWL_Type GetClassID() const override;
+ bool IsInstance(const CFX_WideStringC& wsClass) const override;
+ void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
+ void GetClientRect(CFX_RectF& rect) override;
+ void Update() override;
+ FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
+ void DrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = nullptr) override;
+ void OnProcessMessage(CFWL_Message* pMessage) override;
+ void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) override;
+
+ IFWL_Widget* DoModal();
+ void EndDoModal();
+
+ IFWL_Widget* GetSubFocus() const { return m_pSubFocus; }
+ void SetSubFocus(IFWL_Widget* pWidget) { m_pSubFocus = pWidget; }
+
+ private:
+ void DrawBackground(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme);
+ void RemoveSysButtons();
+ CFWL_SysBtn* GetSysBtnAtPoint(FX_FLOAT fx, FX_FLOAT fy);
+ CFWL_SysBtn* GetSysBtnByState(uint32_t dwState);
+ CFWL_SysBtn* GetSysBtnByIndex(int32_t nIndex);
+ int32_t GetSysBtnIndex(CFWL_SysBtn* pBtn);
+ void GetEdgeRect(CFX_RectF& rtEdge);
+ void SetWorkAreaRect();
+ void Layout();
+ void ResetSysBtn();
+ void RegisterForm();
+ void UnRegisterForm();
+ void OnLButtonDown(CFWL_MsgMouse* pMsg);
+ void OnLButtonUp(CFWL_MsgMouse* pMsg);
+ void OnMouseMove(CFWL_MsgMouse* pMsg);
+ void OnMouseLeave(CFWL_MsgMouse* pMsg);
+ void OnLButtonDblClk(CFWL_MsgMouse* pMsg);
+
+#if (_FX_OS_ == _FX_MACOSX_)
+ bool m_bMouseIn;
+#endif
+ CFX_RectF m_rtRestore;
+ CFX_RectF m_rtRelative;
+ CFWL_SysBtn* m_pCloseBox;
+ CFWL_SysBtn* m_pMinBox;
+ CFWL_SysBtn* m_pMaxBox;
+ std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop;
+ IFWL_Widget* m_pSubFocus;
+ FX_FLOAT m_fCXBorder;
+ FX_FLOAT m_fCYBorder;
+ int32_t m_iCaptureBtn;
+ int32_t m_iSysBox;
+ bool m_bLButtonDown;
+ bool m_bMaximized;
+ bool m_bSetMaximize;
+ bool m_bDoModalFlag;
+};
+
+#endif // XFA_FWL_CORE_CFWL_FORM_H_