LibreOffice Module vcl (master) 1
|
#include <timer.hxx>
Public Member Functions | |
Timer (const char *pDebugName) | |
Timer (const Timer &rTimer) | |
virtual | ~Timer () override |
Timer & | operator= (const Timer &rTimer) |
virtual void | Invoke () override |
Calls the maInvokeHandler with the parameter this. More... | |
void | Invoke (Timer *arg) |
Calls the maInvokeHandler with the parameter. More... | |
void | SetInvokeHandler (const Link< Timer *, void > &rLink) |
void | ClearInvokeHandler () |
void | SetTimeout (sal_uInt64 nTimeoutMs) |
sal_uInt64 | GetTimeout () const |
virtual void | Start (bool bStartTimer=true) override |
Schedules the task for execution. More... | |
Public Member Functions inherited from Task | |
Task (const char *pDebugName) | |
Task (const Task &rTask) | |
virtual | ~Task () COVERITY_NOEXCEPT_FALSE |
Task & | operator= (const Task &rTask) |
void | SetPriority (TaskPriority ePriority) |
TaskPriority | GetPriority () const |
const char * | GetDebugName () const |
virtual void | Invoke ()=0 |
virtual void | Start (bool bStartTimer=true) |
Schedules the task for execution. More... | |
void | Stop () |
bool | IsActive () const |
void | SetStatic () |
This function must be called for static tasks, so the Task destructor ignores the scheduler mutex, as it may not be available anymore. More... | |
bool | IsStatic () const |
Protected Member Functions | |
virtual void | SetDeletionFlags () override |
virtual sal_uInt64 | UpdateMinPeriod (sal_uInt64 nTimeNow) const override |
How long (in MS) until the Task is ready to be dispatched? More... | |
Timer (bool bAuto, const char *pDebugName) | |
Protected Member Functions inherited from Task | |
const ImplSchedulerData * | GetSchedulerData () const |
virtual void | SetDeletionFlags () |
virtual sal_uInt64 | UpdateMinPeriod (sal_uInt64 nTimeNow) const =0 |
How long (in MS) until the Task is ready to be dispatched? More... | |
Private Attributes | |
Link< Timer *, void > | maInvokeHandler |
Callback Link. More... | |
sal_uInt64 | mnTimeout |
const bool | mbAuto |
Additional Inherited Members | |
Static Protected Member Functions inherited from Task | |
static void | StartTimer (sal_uInt64 nMS) |
|
protected |
Definition at line 39 of file timer.cxx.
References DEFAULT, and Task::SetPriority().
Timer::Timer | ( | const Timer & | rTimer | ) |
Definition at line 52 of file timer.cxx.
References maInvokeHandler, and mnTimeout.
|
overridevirtual |
Calls the maInvokeHandler with the parameter this.
Implements Task.
Reimplemented in DebugEventInjector, and JSDialogNotifyIdle.
Definition at line 73 of file timer.cxx.
References Link< typename Arg, typename Ret >::Call(), and maInvokeHandler.
Referenced by IdleFormatter::DoIdleFormat(), and IdleFormatter::ForceTimeout().
void Timer::Invoke | ( | Timer * | arg | ) |
Calls the maInvokeHandler with the parameter.
Convenience Invoke function, mainly used to call with nullptr.
arg | parameter for the Link::Call function |
Definition at line 78 of file timer.cxx.
References Link< typename Arg, typename Ret >::Call(), and maInvokeHandler.
Definition at line 63 of file timer.cxx.
References maInvokeHandler, mbAuto, mnTimeout, Task::operator=(), and SAL_WARN_IF.
|
overrideprotectedvirtual |
Reimplemented from Task.
Definition at line 25 of file timer.cxx.
References mbAuto, and Task::SetDeletionFlags().
Definition at line 56 of file timer.hxx.
Referenced by Animation::Animation(), weld::ButtonPressRepeater::ButtonPressRepeater(), HelpTextWindow::HelpTextWindow(), ImplFrameData::ImplFrameData(), SpinField::ImplInit(), DockingWindow::ImplInitDockingWindowData(), InterimItemWindow::InterimItemWindow(), SvInplaceEdit2::LoseFocus(), vcl::graphic::Manager::Manager(), MenuBarUpdateIconManager::MenuBarUpdateIconManager(), MenuFloatingWindow::MenuFloatingWindow(), vcl::PrintDialog::PrintDialog(), vcl::QuickSelectionEngine_Data::QuickSelectionEngine_Data(), vcl::RoadmapWizard::RoadmapWizard(), SalFlashAttention::SalFlashAttention(), SalInstanceAssistant::SalInstanceAssistant(), SelectionEngine::SelectionEngine(), SvImpLBox::SvImpLBox(), SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl(), and SystemWindow::SystemWindow().
void Timer::SetTimeout | ( | sal_uInt64 | nTimeoutMs | ) |
Definition at line 90 of file timer.cxx.
References Task::IsActive(), mnTimeout, and Task::StartTimer().
Referenced by DebugEventInjector::DebugEventInjector(), HelpTextWindow::HelpTextWindow(), weld::IMPL_LINK(), weld::IMPL_LINK_NOARG(), SpinField::ImplInit(), Animation::ImplRestartTimer(), MenuFloatingWindow::ImplScroll(), DebugEventInjector::Invoke(), vcl::graphic::Manager::Manager(), MenuBarUpdateIconManager::MenuBarUpdateIconManager(), MenuFloatingWindow::MenuFloatingWindow(), SpinField::MouseButtonUp(), vcl::QuickSelectionEngine_Data::QuickSelectionEngine_Data(), SalFlashAttention::SalFlashAttention(), SelectionEngine::SelectionEngine(), SelectionEngine::SelMouseMove(), SelectionEngine::SetUpdateInterval(), and HelpTextWindow::ShowHelp().
|
overridevirtual |
Schedules the task for execution.
If the timer is already active, it's reset! Check with Task::IsActive() to prevent reset.
If you unset bStartTimer, the Task must call Task::StartTimer(...) to be correctly scheduled! Otherwise it might just be picked up when the Scheduler runs the next time.
bStartTimer | if false, don't schedule the Task by calling Task::StartTimer(0). |
Reimplemented from Task.
Reimplemented in Idle.
Definition at line 83 of file timer.cxx.
References mnTimeout, Task::Start(), and Task::StartTimer().
Referenced by MenuBarUpdateIconManager::AddMenuBarIcon(), MenuFloatingWindow::ChangeHighlightItem(), DebugEventInjector::DebugEventInjector(), SalFlashAttention::Flash(), weld::IMPL_LINK(), Animation::ImplRestartTimer(), MenuFloatingWindow::ImplScroll(), DebugEventInjector::Invoke(), vcl::graphic::Manager::Manager(), SpinField::MouseButtonDown(), SpinField::MouseMove(), MenuFloatingWindow::MouseMove(), HelpTextWindow::ResetHideTimer(), SelectionEngine::SelMouseMove(), SelectionEngine::SetUpdateInterval(), HelpTextWindow::ShowHelp(), and SalFlashAttention::Start().
|
overrideprotectedvirtual |
How long (in MS) until the Task is ready to be dispatched?
Simply return Scheduler::ImmediateTimeoutMs if you're ready, like an Idle. If you have to return Scheduler::InfiniteTimeoutMs, you probably need another mechanism to wake up the Scheduler or rely on other Tasks to be scheduled, or simply use a polling Timer.
nTimeNow | the current time |
Implements Task.
Reimplemented in Idle.
Definition at line 32 of file timer.cxx.
References Task::GetSchedulerData(), Scheduler::ImmediateTimeoutMs, mnTimeout, and ImplSchedulerData::mnUpdateTime.
|
private |
Definition at line 30 of file timer.hxx.
Referenced by operator=(), and SetDeletionFlags().
|
private |
Definition at line 29 of file timer.hxx.
Referenced by operator=(), SetTimeout(), Start(), Timer(), and UpdateMinPeriod().