blob: 9c913f1c23532ec7ac7e412fbb48b0ce3902ba31 [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// 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.
Lei Zhanga6d9f0e2015-06-13 00:48:38 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Dan Sinclairc411eb92017-07-25 09:39:30 -04007#ifndef FPDFSDK_PWL_CPWL_WND_H_
8#define FPDFSDK_PWL_CPWL_WND_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
weili2d5b0202016-08-03 11:06:49 -070010#include <memory>
Tom Sepezab277682016-02-17 10:07:21 -080011#include <vector>
12
dsinclair1727aee2016-09-29 13:12:56 -070013#include "core/fpdfdoc/cpdf_formcontrol.h"
Dan Sinclairbc8dcc32017-01-19 13:53:02 -050014#include "core/fxcrt/cfx_observable.h"
Tom Sepezd0409af2017-05-25 15:53:57 -070015#include "core/fxcrt/cfx_unowned_ptr.h"
dsinclaira52ab742016-09-29 13:59:29 -070016#include "core/fxcrt/fx_basic.h"
Dan Sinclair7f55a542017-07-13 14:17:10 -040017#include "core/fxge/cfx_color.h"
Lei Zhang60fa2fc2017-07-21 17:42:19 -070018#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
Dan Sinclairbc8dcc32017-01-19 13:53:02 -050019#include "fpdfsdk/cpdfsdk_widget.h"
Dan Sinclairc411eb92017-07-25 09:39:30 -040020#include "fpdfsdk/pwl/cpwl_timer.h"
21#include "fpdfsdk/pwl/cpwl_timer_handler.h"
Tom Sepez870292c2015-04-07 16:12:46 -070022
Lei Zhang4183f202017-07-07 16:10:06 -070023class CPWL_Edit;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070024class CPWL_MsgControl;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070025class CPWL_ScrollBar;
Tom Sepez870292c2015-04-07 16:12:46 -070026class CPWL_Wnd;
dsinclairb9590102016-04-27 06:38:59 -070027class CFX_SystemHandler;
dsinclairc7a73492016-04-05 12:01:42 -070028class IPVT_FontMap;
Tom Sepez870292c2015-04-07 16:12:46 -070029class IPWL_Provider;
Dan Sinclairfb00ec22017-07-05 09:28:15 -040030struct PWL_SCROLL_INFO;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070031
Nico Weber9d8ec5a2015-08-04 13:00:21 -070032// window styles
33#define PWS_CHILD 0x80000000L
34#define PWS_BORDER 0x40000000L
35#define PWS_BACKGROUND 0x20000000L
36#define PWS_HSCROLL 0x10000000L
37#define PWS_VSCROLL 0x08000000L
38#define PWS_VISIBLE 0x04000000L
Nico Weber9d8ec5a2015-08-04 13:00:21 -070039#define PWS_READONLY 0x01000000L
40#define PWS_AUTOFONTSIZE 0x00800000L
41#define PWS_AUTOTRANSPARENT 0x00400000L
42#define PWS_NOREFRESHCLIP 0x00200000L
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070043
Nico Weber9d8ec5a2015-08-04 13:00:21 -070044// edit and label styles
45#define PES_MULTILINE 0x0001L
46#define PES_PASSWORD 0x0002L
47#define PES_LEFT 0x0004L
48#define PES_RIGHT 0x0008L
49#define PES_MIDDLE 0x0010L
50#define PES_TOP 0x0020L
51#define PES_BOTTOM 0x0040L
52#define PES_CENTER 0x0080L
53#define PES_CHARARRAY 0x0100L
54#define PES_AUTOSCROLL 0x0200L
55#define PES_AUTORETURN 0x0400L
56#define PES_UNDO 0x0800L
57#define PES_RICH 0x1000L
58#define PES_SPELLCHECK 0x2000L
59#define PES_TEXTOVERFLOW 0x4000L
60#define PES_NOREAD 0x8000L
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070061
Nico Weber9d8ec5a2015-08-04 13:00:21 -070062// listbox styles
63#define PLBS_MULTIPLESEL 0x0001L
64#define PLBS_HOVERSEL 0x0008L
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070065
Nico Weber9d8ec5a2015-08-04 13:00:21 -070066// combobox styles
67#define PCBS_ALLOWCUSTOMTEXT 0x0001L
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070068
Nico Weber9d8ec5a2015-08-04 13:00:21 -070069#define PWL_CLASSNAME_EDIT "CPWL_Edit"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070070
Nico Weber9d8ec5a2015-08-04 13:00:21 -070071struct CPWL_Dash {
weili625ad662016-06-15 11:21:33 -070072 CPWL_Dash() : nDash(0), nGap(0), nPhase(0) {}
Nico Weber9d8ec5a2015-08-04 13:00:21 -070073 CPWL_Dash(int32_t dash, int32_t gap, int32_t phase)
74 : nDash(dash), nGap(gap), nPhase(phase) {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070075
Dan Sinclairbc8dcc32017-01-19 13:53:02 -050076 void Reset() {
77 nDash = 0;
78 nGap = 0;
79 nPhase = 0;
80 }
81
Nico Weber9d8ec5a2015-08-04 13:00:21 -070082 int32_t nDash;
83 int32_t nGap;
84 int32_t nPhase;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070085};
86
Dan Sinclair7f55a542017-07-13 14:17:10 -040087inline bool operator==(const CFX_Color& c1, const CFX_Color& c2) {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070088 return c1.nColorType == c2.nColorType && c1.fColor1 - c2.fColor1 < 0.0001 &&
89 c1.fColor1 - c2.fColor1 > -0.0001 &&
90 c1.fColor2 - c2.fColor2 < 0.0001 &&
91 c1.fColor2 - c2.fColor2 > -0.0001 &&
92 c1.fColor3 - c2.fColor3 < 0.0001 &&
93 c1.fColor3 - c2.fColor3 > -0.0001 &&
94 c1.fColor4 - c2.fColor4 < 0.0001 && c1.fColor4 - c2.fColor4 > -0.0001;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070095}
96
Dan Sinclair7f55a542017-07-13 14:17:10 -040097inline bool operator!=(const CFX_Color& c1, const CFX_Color& c2) {
Tom Sepez007e6c02016-02-26 14:31:56 -080098 return !(c1 == c2);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070099}
100
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700101#define PWL_SCROLLBAR_WIDTH 12.0f
Dan Sinclairfc54e052017-02-23 09:59:05 -0500102#define PWL_SCROLLBAR_TRANSPARENCY 150
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700103#define PWL_DEFAULT_SELBACKCOLOR \
Dan Sinclair7f55a542017-07-13 14:17:10 -0400104 CFX_Color(COLORTYPE_RGB, 0, 51.0f / 255.0f, 113.0f / 255.0f)
105#define PWL_DEFAULT_BLACKCOLOR CFX_Color(COLORTYPE_GRAY, 0)
106#define PWL_DEFAULT_WHITECOLOR CFX_Color(COLORTYPE_GRAY, 1)
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700107
Dan Sinclairbc8dcc32017-01-19 13:53:02 -0500108class IPWL_Provider : public CFX_Observable<IPWL_Provider> {
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700109 public:
110 virtual ~IPWL_Provider() {}
Tom Sepeze5b59ca2015-01-09 11:46:17 -0800111
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700112 // get a matrix which map user space to CWnd client space
Tom Sepez60d909e2015-12-10 15:34:55 -0800113 virtual CFX_Matrix GetWindowMatrix(void* pAttachedData) = 0;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700114};
115
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700116class IPWL_FocusHandler {
117 public:
118 virtual ~IPWL_FocusHandler() {}
Lei Zhang4183f202017-07-07 16:10:06 -0700119 virtual void OnSetFocus(CPWL_Edit* pEdit) = 0;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700120};
121
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700122struct PWL_CREATEPARAM {
123 public:
weili625ad662016-06-15 11:21:33 -0700124 PWL_CREATEPARAM();
125 PWL_CREATEPARAM(const PWL_CREATEPARAM& other);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700126
Dan Sinclairbc8dcc32017-01-19 13:53:02 -0500127 void Reset() {
128 rcRectWnd.Reset();
129 pSystemHandler = nullptr;
130 pFontMap = nullptr;
131 pProvider.Reset();
132 pFocusHandler = nullptr;
133 dwFlags = 0;
134 sBackgroundColor.Reset();
135 pAttachedWidget.Reset();
136 nBorderStyle = BorderStyle::SOLID;
137 dwBorderWidth = 0;
138 sBorderColor.Reset();
139 sTextColor.Reset();
Dan Sinclairbc8dcc32017-01-19 13:53:02 -0500140 nTransparency = 0;
141 fFontSize = 0.0f;
142 sDash.Reset();
143 pAttachedData = nullptr;
144 pParentWnd = nullptr;
145 pMsgControl = nullptr;
146 eCursorType = 0;
147 mtChild.SetIdentity();
148 }
149
Lei Zhang633a3b72017-06-02 15:27:22 -0700150 CFX_FloatRect rcRectWnd; // required
151 CFX_SystemHandler* pSystemHandler; // required
152 IPVT_FontMap* pFontMap; // required
153 IPWL_Provider::ObservedPtr pProvider; // required
154 IPWL_FocusHandler* pFocusHandler; // optional
155 uint32_t dwFlags; // optional
Dan Sinclair7f55a542017-07-13 14:17:10 -0400156 CFX_Color sBackgroundColor; // optional
Dan Sinclairbc8dcc32017-01-19 13:53:02 -0500157 CPDFSDK_Widget::ObservedPtr pAttachedWidget; // required
Lei Zhang633a3b72017-06-02 15:27:22 -0700158 BorderStyle nBorderStyle; // optional
159 int32_t dwBorderWidth; // optional
Dan Sinclair7f55a542017-07-13 14:17:10 -0400160 CFX_Color sBorderColor; // optional
161 CFX_Color sTextColor; // optional
Lei Zhang633a3b72017-06-02 15:27:22 -0700162 int32_t nTransparency; // optional
163 float fFontSize; // optional
164 CPWL_Dash sDash; // optional
165 void* pAttachedData; // optional
166 CPWL_Wnd* pParentWnd; // ignore
167 CPWL_MsgControl* pMsgControl; // ignore
168 int32_t eCursorType; // ignore
169 CFX_Matrix mtChild; // ignore
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700170};
171
Tom Sepez77417ec2017-07-19 16:46:22 -0700172class CPWL_Wnd : public CPWL_TimerHandler, public CFX_Observable<CPWL_Wnd> {
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700173 public:
174 CPWL_Wnd();
Lei Zhang2b1a2d52015-08-14 22:16:22 -0700175 ~CPWL_Wnd() override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700176
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700177 virtual CFX_ByteString GetClassName() const;
Lei Zhang33c03002017-08-15 11:18:19 -0700178 virtual void InvalidateRect(CFX_FloatRect* pRect);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700179
tsepez4cf55152016-11-02 14:37:54 -0700180 virtual bool OnKeyDown(uint16_t nChar, uint32_t nFlag);
tsepez4cf55152016-11-02 14:37:54 -0700181 virtual bool OnChar(uint16_t nChar, uint32_t nFlag);
Dan Sinclairf528eee2017-02-14 11:52:07 -0500182 virtual bool OnLButtonDblClk(const CFX_PointF& point, uint32_t nFlag);
183 virtual bool OnLButtonDown(const CFX_PointF& point, uint32_t nFlag);
184 virtual bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag);
Dan Sinclairf528eee2017-02-14 11:52:07 -0500185 virtual bool OnRButtonDown(const CFX_PointF& point, uint32_t nFlag);
186 virtual bool OnRButtonUp(const CFX_PointF& point, uint32_t nFlag);
187 virtual bool OnMouseMove(const CFX_PointF& point, uint32_t nFlag);
tsepez4cf55152016-11-02 14:37:54 -0700188 virtual bool OnMouseWheel(short zDelta,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500189 const CFX_PointF& point,
tsepez4cf55152016-11-02 14:37:54 -0700190 uint32_t nFlag);
Dan Sinclairfb00ec22017-07-05 09:28:15 -0400191 virtual void SetScrollInfo(const PWL_SCROLL_INFO& info);
Dan Sinclair7e0336e2017-07-05 09:39:50 -0400192 virtual void SetScrollPosition(float pos);
Dan Sinclair63fbd8d2017-07-05 14:10:36 -0400193 virtual void ScrollWindowVertically(float pos);
Dan Sinclair7f6bec92017-07-05 14:13:16 -0400194 virtual void NotifyLButtonDown(CPWL_Wnd* child, const CFX_PointF& pos);
195 virtual void NotifyLButtonUp(CPWL_Wnd* child, const CFX_PointF& pos);
196 virtual void NotifyMouseMove(CPWL_Wnd* child, const CFX_PointF& pos);
Dan Sinclair90b73262017-02-23 14:38:48 -0500197 virtual void SetFocus();
198 virtual void KillFocus();
199 virtual void SetCursor();
tsepez4cf55152016-11-02 14:37:54 -0700200 virtual void SetVisible(bool bVisible);
Dan Sinclair05df0752017-03-14 14:43:42 -0400201 virtual void SetFontSize(float fFontSize);
202 virtual float GetFontSize() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700203
Diana Gagedce2d722017-06-20 11:17:11 -0700204 virtual CFX_WideString GetSelectedText();
Diana Gageab390972017-07-28 17:07:39 -0700205 virtual void ReplaceSelection(const CFX_WideString& text);
Tom Sepez281a9ea2016-02-26 14:24:28 -0800206 virtual CFX_FloatRect GetFocusRect() const;
Tom Sepez281a9ea2016-02-26 14:24:28 -0800207 virtual CFX_FloatRect GetClientRect() const;
Dan Sinclair90b73262017-02-23 14:38:48 -0500208
209 void InvalidateFocusHandler(IPWL_FocusHandler* handler);
210 void InvalidateProvider(IPWL_Provider* provider);
211 void Create(const PWL_CREATEPARAM& cp);
212 void Destroy();
213 void Move(const CFX_FloatRect& rcNew, bool bReset, bool bRefresh);
214
215 void SetCapture();
216 void ReleaseCapture();
217
Lei Zhangeb14e042017-08-15 13:56:43 -0700218 void DrawAppearance(CFX_RenderDevice* pDevice,
219 const CFX_Matrix& mtUser2Device);
Dan Sinclair90b73262017-02-23 14:38:48 -0500220
Dan Sinclair7f55a542017-07-13 14:17:10 -0400221 CFX_Color GetBackgroundColor() const;
222 void SetBackgroundColor(const CFX_Color& color);
223 CFX_Color GetBorderColor() const;
224 CFX_Color GetTextColor() const;
225 void SetTextColor(const CFX_Color& color);
226 CFX_Color GetBorderLeftTopColor(BorderStyle nBorderStyle) const;
227 CFX_Color GetBorderRightBottomColor(BorderStyle nBorderStyle) const;
Dan Sinclair90b73262017-02-23 14:38:48 -0500228
229 void SetBorderStyle(BorderStyle eBorderStyle);
230 BorderStyle GetBorderStyle() const;
231 const CPWL_Dash& GetBorderDash() const;
232
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700233 int32_t GetBorderWidth() const;
Dan Sinclair90b73262017-02-23 14:38:48 -0500234 int32_t GetInnerBorderWidth() const;
235 CFX_FloatRect GetWindowRect() const;
236 CFX_PointF GetCenterPoint() const;
237
tsepez4cf55152016-11-02 14:37:54 -0700238 bool IsVisible() const { return m_bVisible; }
239 bool HasFlag(uint32_t dwFlags) const;
tsepezc3255f52016-03-25 14:52:27 -0700240 void AddFlag(uint32_t dwFlags);
241 void RemoveFlag(uint32_t dwFlags);
Dan Sinclair90b73262017-02-23 14:38:48 -0500242
243 void SetClipRect(const CFX_FloatRect& rect);
Tom Sepez281a9ea2016-02-26 14:24:28 -0800244 const CFX_FloatRect& GetClipRect() const;
Dan Sinclair90b73262017-02-23 14:38:48 -0500245
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700246 CPWL_Wnd* GetParentWindow() const;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700247 void* GetAttachedData() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700248
Dan Sinclairf528eee2017-02-14 11:52:07 -0500249 bool WndHitTest(const CFX_PointF& point) const;
250 bool ClientHitTest(const CFX_PointF& point) const;
tsepez4cf55152016-11-02 14:37:54 -0700251 bool IsCaptureMouse() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700252
Dan Sinclair90b73262017-02-23 14:38:48 -0500253 void EnableWindow(bool bEnable);
254 bool IsEnabled() const { return m_bEnabled; }
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700255 const CPWL_Wnd* GetFocused() const;
tsepez4cf55152016-11-02 14:37:54 -0700256 bool IsFocused() const;
257 bool IsReadOnly() const;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700258 CPWL_ScrollBar* GetVScrollBar() const;
Lei Zhanga6d9f0e2015-06-13 00:48:38 -0700259
dsinclairc7a73492016-04-05 12:01:42 -0700260 IPVT_FontMap* GetFontMap() const;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700261 IPWL_Provider* GetProvider() const;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700262 IPWL_FocusHandler* GetFocusHandler() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700263
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700264 int32_t GetTransparency();
265 void SetTransparency(int32_t nTransparency);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700266
Tom Sepez60d909e2015-12-10 15:34:55 -0800267 CFX_Matrix GetChildToRoot() const;
268 CFX_Matrix GetChildMatrix() const;
269 void SetChildMatrix(const CFX_Matrix& mt);
270 CFX_Matrix GetWindowMatrix() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700271
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700272 protected:
Dan Sinclair90b73262017-02-23 14:38:48 -0500273 friend class CPWL_MsgControl;
274
Lei Zhang2b1a2d52015-08-14 22:16:22 -0700275 // CPWL_TimerHandler
dsinclairb9590102016-04-27 06:38:59 -0700276 CFX_SystemHandler* GetSystemHandler() const override;
Lei Zhang2b1a2d52015-08-14 22:16:22 -0700277
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700278 virtual void CreateChildWnd(const PWL_CREATEPARAM& cp);
279 virtual void RePosChildWnd();
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700280
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700281 virtual void DrawThisAppearance(CFX_RenderDevice* pDevice,
Lei Zhangeb14e042017-08-15 13:56:43 -0700282 const CFX_Matrix& mtUser2Device);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700283
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700284 virtual void OnCreate(PWL_CREATEPARAM& cp);
285 virtual void OnCreated();
286 virtual void OnDestroy();
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700287
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700288 virtual void OnSetFocus();
289 virtual void OnKillFocus();
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700290
tsepez4cf55152016-11-02 14:37:54 -0700291 void SetNotifyFlag(bool bNotifying = true) { m_bNotifying = bNotifying; }
Lei Zhanga6d9f0e2015-06-13 00:48:38 -0700292
tsepez4cf55152016-11-02 14:37:54 -0700293 bool IsValid() const;
Lei Zhang7457e382016-01-06 23:00:34 -0800294 const PWL_CREATEPARAM& GetCreationParam() const;
tsepez4cf55152016-11-02 14:37:54 -0700295 bool IsNotifying() const { return m_bNotifying; }
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700296
Tom Sepez281a9ea2016-02-26 14:24:28 -0800297 void InvalidateRectMove(const CFX_FloatRect& rcOld,
298 const CFX_FloatRect& rcNew);
Lei Zhanga6d9f0e2015-06-13 00:48:38 -0700299
tsepez4cf55152016-11-02 14:37:54 -0700300 bool IsWndCaptureMouse(const CPWL_Wnd* pWnd) const;
301 bool IsWndCaptureKeyboard(const CPWL_Wnd* pWnd) const;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700302 const CPWL_Wnd* GetRootWnd() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700303
Lei Zhang60fa2fc2017-07-21 17:42:19 -0700304 static bool IsCTRLpressed(uint32_t nFlag) {
305 return CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag);
306 }
307 static bool IsSHIFTpressed(uint32_t nFlag) {
308 return CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag);
309 }
310 static bool IsALTpressed(uint32_t nFlag) {
311 return CPDFSDK_FormFillEnvironment::IsALTKeyDown(nFlag);
312 }
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700313
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700314 private:
Dan Sinclair90b73262017-02-23 14:38:48 -0500315 CFX_PointF ParentToChild(const CFX_PointF& point) const;
316 CFX_FloatRect ParentToChild(const CFX_FloatRect& rect) const;
317
Lei Zhangeb14e042017-08-15 13:56:43 -0700318 void DrawChildAppearance(CFX_RenderDevice* pDevice,
319 const CFX_Matrix& mtUser2Device);
Dan Sinclair90b73262017-02-23 14:38:48 -0500320
Lei Zhang77f9bff2017-08-29 11:34:12 -0700321 CFX_FloatRect PWLtoWnd(const CFX_FloatRect& rect) const;
Dan Sinclair1f403ce2017-02-21 12:56:24 -0500322
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700323 void AddChild(CPWL_Wnd* pWnd);
324 void RemoveChild(CPWL_Wnd* pWnd);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700325
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700326 void CreateScrollBar(const PWL_CREATEPARAM& cp);
327 void CreateVScrollBar(const PWL_CREATEPARAM& cp);
Lei Zhanga6d9f0e2015-06-13 00:48:38 -0700328
Lei Zhang62b2e912015-08-14 21:49:19 -0700329 void AdjustStyle();
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700330 void CreateMsgControl();
331 void DestroyMsgControl();
Lei Zhanga6d9f0e2015-06-13 00:48:38 -0700332
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700333 CPWL_MsgControl* GetMsgControl() const;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700334
tsepez6745f962017-01-04 10:09:45 -0800335 std::vector<CPWL_Wnd*> m_Children;
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700336 PWL_CREATEPARAM m_sPrivateParam;
Tom Sepezd0409af2017-05-25 15:53:57 -0700337 CFX_UnownedPtr<CPWL_ScrollBar> m_pVScrollBar;
Tom Sepez281a9ea2016-02-26 14:24:28 -0800338 CFX_FloatRect m_rcWindow;
339 CFX_FloatRect m_rcClip;
tsepez4cf55152016-11-02 14:37:54 -0700340 bool m_bCreated;
341 bool m_bVisible;
342 bool m_bNotifying;
343 bool m_bEnabled;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700344};
345
Dan Sinclairc411eb92017-07-25 09:39:30 -0400346#endif // FPDFSDK_PWL_CPWL_WND_H_