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
cpwl_caret.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 FPDFSDK_PWL_CPWL_CARET_H_
8#define FPDFSDK_PWL_CPWL_CARET_H_
9
10#include <memory>
11
12#include "core/fxcrt/cfx_timer.h"
13#include "fpdfsdk/pwl/cpwl_wnd.h"
14
15class CPWL_Caret final : public CPWL_Wnd, public CFX_Timer::CallbackIface {
16 public:
17 CPWL_Caret(const CreateParams& cp,
18 std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData);
19 ~CPWL_Caret() override;
20
21 // CPWL_Wnd:
23 const CFX_Matrix& mtUser2Device) override;
24 bool InvalidateRect(const CFX_FloatRect* pRect) override;
25 bool SetVisible(bool bVisible) override;
26
27 // CFX_Timer::CallbackIface:
28 void OnTimerFired() override;
29
30 void SetCaret(bool bVisible,
31 const CFX_PointF& ptHead,
32 const CFX_PointF& ptFoot);
33 void SetInvalidRect(const CFX_FloatRect& rc) { m_rcInvalid = rc; }
34
35 private:
36 CFX_FloatRect GetCaretRect() const;
37
38 bool m_bFlash = false;
39 CFX_PointF m_ptHead;
40 CFX_PointF m_ptFoot;
41 float m_fWidth = 0.4f;
42 CFX_FloatRect m_rcInvalid;
43 std::unique_ptr<CFX_Timer> m_pTimer;
44};
45
46#endif // FPDFSDK_PWL_CPWL_CARET_H_
bool IsEmpty() const
void Intersect(const CFX_FloatRect &other_rect)
void Inflate(float x, float y)
CFX_FloatRect & operator=(const CFX_FloatRect &that)=default
void AppendPoint(const CFX_PointF &point, Point::Type type)
Definition cfx_path.cpp:289
bool DrawPath(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options)
bool SetVisible(bool bVisible) override
bool InvalidateRect(const CFX_FloatRect *pRect) override
void DrawThisAppearance(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device) override
~CPWL_Caret() override
void SetCaret(bool bVisible, const CFX_PointF &ptHead, const CFX_PointF &ptFoot)
void OnTimerFired() override
CPWL_Caret(const CreateParams &cp, std::unique_ptr< IPWL_FillerNotify::PerWindowData > pAttachedData)
void SetInvalidRect(const CFX_FloatRect &rc)
Definition cpwl_caret.h:33
const CFX_FloatRect & GetClipRect() const
Definition cpwl_wnd.cpp:606
virtual bool InvalidateRect(const CFX_FloatRect *pRect)
Definition cpwl_wnd.cpp:278
bool IsVisible() const
Definition cpwl_wnd.h:204
virtual bool SetVisible(bool bVisible)
Definition cpwl_wnd.cpp:575
bool Move(const CFX_FloatRect &rcNew, bool bReset, bool bRefresh)
Definition cpwl_wnd.cpp:211
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
Definition fx_dib.h:118
static constexpr CFX_FillRenderOptions EvenOddOptions()