Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cfx_timer.h
Go to the documentation of this file.
1
// Copyright 2017 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
CORE_FXCRT_CFX_TIMER_H_
8
#
define
CORE_FXCRT_CFX_TIMER_H_
9
10
#
include
<
stdint
.
h
>
11
12
#
include
"core/fxcrt/observed_ptr.h"
13
#
include
"core/fxcrt/unowned_ptr.h"
14
15
class
CFX_Timer
{
16
public
:
17
// HandlerIface is implemented by upper layers that actually perform
18
// the system-dependent actions of scheduling and triggering timers.
19
class
HandlerIface
:
public
Observable
{
20
public
:
21
static
constexpr
int32_t
kInvalidTimerID
= 0;
22
using
TimerCallback
=
void
(*)(int32_t idEvent);
23
24
virtual
~
HandlerIface
() =
default
;
25
26
virtual
int32_t
SetTimer
(int32_t uElapse,
TimerCallback
lpTimerFunc) = 0;
27
virtual
void
KillTimer
(int32_t nTimerID) = 0;
28
};
29
30
// CallbackIface is implemented by layers that want to perform a
31
// specific action on timer expiry.
32
class
CallbackIface
{
33
public
:
34
virtual
~
CallbackIface
() =
default
;
35
virtual
void
OnTimerFired
() = 0;
36
};
37
38
static
void
InitializeGlobals
();
39
static
void
DestroyGlobals
();
40
41
CFX_Timer
(
HandlerIface
* pHandlerIface,
42
CallbackIface
* pCallbackIface,
43
int32_t nInterval);
44
~
CFX_Timer
();
45
46
bool
HasValidID
()
const
{
47
return
m_nTimerID !=
HandlerIface
::
kInvalidTimerID
;
48
}
49
50
private
:
51
static
void
TimerProc(int32_t idEvent);
52
53
int32_t m_nTimerID =
HandlerIface
::
kInvalidTimerID
;
54
ObservedPtr<
HandlerIface
> m_pHandlerIface;
55
UnownedPtr
<
CallbackIface
>
const
m_pCallbackIface;
56
};
57
58
#
endif
// CORE_FXCRT_CFX_TIMER_H_
DCHECK
#define DCHECK
Definition
check.h:33
CFX_Timer::CallbackIface
Definition
cfx_timer.h:32
CFX_Timer::CallbackIface::~CallbackIface
virtual ~CallbackIface()=default
CFX_Timer::CallbackIface::OnTimerFired
virtual void OnTimerFired()=0
CFX_Timer::HandlerIface
Definition
cfx_timer.h:19
CFX_Timer::HandlerIface::kInvalidTimerID
static constexpr int32_t kInvalidTimerID
Definition
cfx_timer.h:21
CFX_Timer::HandlerIface::TimerCallback
void(*)(int32_t idEvent) TimerCallback
Definition
cfx_timer.h:22
CFX_Timer::HandlerIface::KillTimer
virtual void KillTimer(int32_t nTimerID)=0
CFX_Timer::HandlerIface::~HandlerIface
virtual ~HandlerIface()=default
CFX_Timer::HandlerIface::SetTimer
virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc)=0
CFX_Timer
Definition
cfx_timer.h:15
CFX_Timer::HasValidID
bool HasValidID() const
Definition
cfx_timer.h:46
CFX_Timer::DestroyGlobals
static void DestroyGlobals()
Definition
cfx_timer.cpp:27
CFX_Timer::CFX_Timer
CFX_Timer(HandlerIface *pHandlerIface, CallbackIface *pCallbackIface, int32_t nInterval)
Definition
cfx_timer.cpp:32
CFX_Timer::~CFX_Timer
~CFX_Timer()
Definition
cfx_timer.cpp:44
CFX_Timer::InitializeGlobals
static void InitializeGlobals()
Definition
cfx_timer.cpp:21
fxcrt::Observable
Definition
observed_ptr.h:17
fxcrt::UnownedPtr
Definition
unowned_ptr.h:76
CHECK
#define CHECK(cvref)
Definition
q23utility.cpp:15
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxcrt
cfx_timer.h
Generated on
for Qt by
1.18.0