LibreOffice Module slideshow (master) 1
wakeupevent.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_WAKEUPEVENT_HXX
20#define INCLUDED_SLIDESHOW_SOURCE_INC_WAKEUPEVENT_HXX
21
23
24#include "event.hxx"
25#include "activitiesqueue.hxx"
26
27namespace slideshow::internal {
28
36class WakeupEvent : public Event
37{
38public:
40 std::shared_ptr< ::canvas::tools::ElapsedTime > const& pTimeBase,
41 ActivitiesQueue & rActivityQueue );
42 WakeupEvent(const WakeupEvent&) = delete;
44
45 virtual void dispose() override;
46 virtual bool fire() override;
47 virtual bool isCharged() const override;
48 virtual double getActivationTime( double nCurrentTime ) const override;
49
51 void start();
52
61 void setNextTimeout( double nextTime );
62
68 void setActivity( const ActivitySharedPtr& rActivity );
69
70private:
72 double mnNextTime;
75};
76
77typedef ::std::shared_ptr< WakeupEvent > WakeupEventSharedPtr;
78
79} // namespace presentation::internal
80
81#endif // INCLUDED_SLIDESHOW_SOURCE_INC_WAKEUPEVENT_HXX
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class handles the XSprite updates needed for animations, such as moves, scales etc.
Definition of Event interface.
Definition: event.hxx:33
Little helper class, used to set Activities active again after some sleep period.
Definition: wakeupevent.hxx:37
void setActivity(const ActivitySharedPtr &rActivity)
Set activity to wakeup.
Definition: wakeupevent.cxx:79
virtual bool isCharged() const override
Query whether this event is still charged, i.e.
Definition: wakeupevent.cxx:53
virtual bool fire() override
Execute the event.
Definition: wakeupevent.cxx:45
virtual void dispose() override
Dispose all object references.
Definition: wakeupevent.cxx:40
void start()
Start the internal timer.
Definition: wakeupevent.cxx:68
WakeupEvent(std::shared_ptr< ::canvas::tools::ElapsedTime > const &pTimeBase, ActivitiesQueue &rActivityQueue)
void setNextTimeout(double nextTime)
Set the next timeout this object should generate.
Definition: wakeupevent.cxx:74
virtual double getActivationTime(double nCurrentTime) const override
Query the activation time instant this event shall be fired, if it was inserted at instant nCurrentTi...
Definition: wakeupevent.cxx:60
WakeupEvent & operator=(const WakeupEvent &)=delete
::canvas::tools::ElapsedTime maTimer
Definition: wakeupevent.hxx:71
ActivitiesQueue & mrActivityQueue
Definition: wakeupevent.hxx:74
WakeupEvent(const WakeupEvent &)=delete
::std::shared_ptr< Activity > ActivitySharedPtr
Definition: activity.hxx:83
::std::shared_ptr< WakeupEvent > WakeupEventSharedPtr
Definition: wakeupevent.hxx:77