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
12#define FWL_STATE_PSB_Hovered (1 << FWL_STATE_WGT_MAX)
13#define FWL_STATE_PSB_Pressed (1 << (FWL_STATE_WGT_MAX + 1))
14#define FWL_STATE_PSB_Default (1 << (FWL_STATE_WGT_MAX + 2))
15
16class CFWL_MessageKey;
17class CFWL_MessageMouse;
18
19class CFWL_PushButton final : public CFWL_Widget {
20 public:
22 ~CFWL_PushButton() override;
23
24 // CFWL_Widget
25 FWL_Type GetClassID() const override;
26 void SetStates(uint32_t dwStates) override;
27 void Update() override;
28 void DrawWidget(CFGAS_GEGraphics* pGraphics,
29 const CFX_Matrix& matrix) override;
30 void OnProcessMessage(CFWL_Message* pMessage) override;
31 void OnDrawWidget(CFGAS_GEGraphics* pGraphics,
32 const CFX_Matrix& matrix) override;
33
34 private:
35 explicit CFWL_PushButton(CFWL_App* pApp);
36
37 void DrawBkground(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& mtMatrix);
38 Mask<CFWL_PartState> GetPartStates();
39 void UpdateTextOutStyles();
40 void OnFocusGained();
41 void OnFocusLost();
42 void OnLButtonDown(CFWL_MessageMouse* pMsg);
43 void OnLButtonUp(CFWL_MessageMouse* pMsg);
44 void OnMouseMove(CFWL_MessageMouse* pMsg);
45 void OnMouseLeave(CFWL_MessageMouse* pMsg);
46 void OnKeyDown(CFWL_MessageKey* pMsg);
47
48 bool m_bBtnDown = false;
49 CFX_RectF m_ClientRect;
50 CFX_RectF m_CaptionRect;
51};
52
53#endif // XFA_FWL_CFWL_PUSHBUTTON_H_
#define FWL_STATE_PSB_Pressed
#define FWL_STATE_PSB_Hovered
CFWL_PartState
#define FWL_STATE_WGT_MAX
Definition cfwl_widget.h:44
FWL_Type
Definition cfwl_widget.h:46
#define FWL_STATE_WGT_Focused
Definition cfwl_widget.h:42
#define FWL_STATE_WGT_Disabled
Definition cfwl_widget.h:41
CFWL_Widget * GetSrcTarget() const
Definition cfwl_event.h:40
const KeyCommand m_dwCmd
const uint32_t m_dwKeyCodeOrChar
const MouseCommand m_dwCmd
Type GetType() const
CFWL_Widget * GetDstTarget() const
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void Update() override
~CFWL_PushButton() override
FWL_Type GetClassID() const override
void OnProcessMessage(CFWL_Message *pMessage) override
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void SetStates(uint32_t dwStates) override
CFX_RectF m_PartRect
CFX_Matrix m_matrix
CFWL_Widget(CFWL_App *app, const Properties &properties, CFWL_Widget *pOuter)
virtual void SetStates(uint32_t dwStates)
Properties m_Properties
void OnProcessMessage(CFWL_Message *pMessage) override
bool HasBorder() const
void DrawBorder(CFGAS_GEGraphics *pGraphics, CFWL_ThemePart::Part iPartBorder, const CFX_Matrix &pMatrix)
void RepaintRect(const CFX_RectF &pRect)
IFWL_ThemeProvider * GetThemeProvider() const
bool IsEnabled() const
virtual CFX_RectF GetClientRect()
void DispatchEvent(CFWL_Event *pEvent)
bool IsLocked() const
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_RectF & operator=(const CFX_RectF &other)=default
@ XFA_FWL_VKEY_Return
#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED
Definition heap.h:32