Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfwl_pushbutton.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
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 XFA_FWL_CFWL_PUSHBUTTON_H_
8#define XFA_FWL_CFWL_PUSHBUTTON_H_
9
10#include "xfa/fwl/cfwl_widget.h"
11
12namespace pdfium {
13
14#define FWL_STATE_PSB_Hovered (1 << FWL_STATE_WGT_MAX)
15#define FWL_STATE_PSB_Pressed (1 << (FWL_STATE_WGT_MAX + 1))
16#define FWL_STATE_PSB_Default (1 << (FWL_STATE_WGT_MAX + 2))
17
18class CFWL_MessageKey;
19class CFWL_MessageMouse;
20
21class CFWL_PushButton final : public CFWL_Widget {
22 public:
24 ~CFWL_PushButton() override;
25
26 // CFWL_Widget
27 FWL_Type GetClassID() const override;
28 void SetStates(uint32_t dwStates) override;
29 void Update() override;
30 void DrawWidget(CFGAS_GEGraphics* pGraphics,
31 const CFX_Matrix& matrix) override;
32 void OnProcessMessage(CFWL_Message* pMessage) override;
33 void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
34 const CFX_Matrix& matrix) override;
35
36 private:
37 explicit CFWL_PushButton(CFWL_App* pApp);
38
39 void DrawBkground(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& mtMatrix);
40 Mask<CFWL_PartState> GetPartStates();
41 void UpdateTextOutStyles();
42 void OnFocusGained();
43 void OnFocusLost();
44 void OnLButtonDown(CFWL_MessageMouse* pMsg);
45 void OnLButtonUp(CFWL_MessageMouse* pMsg);
46 void OnMouseMove(CFWL_MessageMouse* pMsg);
47 void OnMouseLeave(CFWL_MessageMouse* pMsg);
48 void OnKeyDown(CFWL_MessageKey* pMsg);
49
50 bool m_bBtnDown = false;
51 CFX_RectF m_ClientRect;
52 CFX_RectF m_CaptionRect;
53};
54
55} // namespace pdfium
56
57// TODO(crbug.com/42271761): Remove.
58using pdfium::CFWL_PushButton;
59
60#endif // XFA_FWL_CFWL_PUSHBUTTON_H_
#define FWL_STATE_PSB_Pressed
#define FWL_STATE_PSB_Hovered
#define FWL_STATE_WGT_MAX
Definition cfwl_widget.h:46
#define FWL_STATE_WGT_Focused
Definition cfwl_widget.h:44
#define FWL_STATE_WGT_Disabled
Definition cfwl_widget.h:43
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_RectF & operator=(const CFX_RectF &other)=default
CFWL_Widget * GetSrcTarget() const
Definition cfwl_event.h:42
const uint32_t m_dwKeyCodeOrChar
const KeyCommand m_dwCmd
Type GetType() const
CFWL_Widget * GetDstTarget() const
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void SetStates(uint32_t dwStates) override
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
FWL_Type GetClassID() const override
void OnProcessMessage(CFWL_Message *pMessage) override
void OnProcessMessage(CFWL_Message *pMessage) override
void RepaintRect(const CFX_RectF &pRect)
bool HasBorder() const
void DispatchEvent(CFWL_Event *pEvent)
CFWL_Widget(CFWL_App *app, const Properties &properties, CFWL_Widget *pOuter)
void DrawBorder(CFGAS_GEGraphics *pGraphics, CFWL_ThemePart::Part iPartBorder, const CFX_Matrix &pMatrix)
virtual CFX_RectF GetClientRect()
IFWL_ThemeProvider * GetThemeProvider() const
bool IsLocked() const
Properties m_Properties
bool IsEnabled() const
virtual void SetStates(uint32_t dwStates)
#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
Definition heap.h:32
@ XFA_FWL_VKEY_Return