on 551c708 help sign in
54 lines 1.6 kB history raw
1/*
2 * Copyright (C) 2013 - Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, as
6 * published by the Free Software Foundation; either version 2.1 or 3.0
7 * of the License.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranties of
11 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
12 * PURPOSE. See the applicable version of the GNU Lesser General Public
13 * License for more details.
14 *
15 * You should have received a copy of both the GNU Lesser General Public
16 * License along with this program. If not, see <http://www.gnu.org/licenses/>
17 *
18 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
19 */
21#ifndef UBUNTUGESTURES_TIMESOURCE_H
22#define UBUNTUGESTURES_TIMESOURCE_H
24#include "UbuntuGesturesGlobal.h"
25#include <QSharedPointer>
27namespace UbuntuGestures {
28/*
29 Interface for a time source.
30 */
31class UBUNTUGESTURES_EXPORT TimeSource {
32public:
33 virtual ~TimeSource() {}
34 /* Returns the current time in milliseconds since some reference time in the past. */
35 virtual qint64 msecsSinceReference() = 0;
36};
37typedef QSharedPointer<TimeSource> SharedTimeSource;
39/*
40 Implementation of a time source
41 */
42class RealTimeSourcePrivate;
43class RealTimeSource : public TimeSource {
44public:
45 RealTimeSource();
46 virtual ~RealTimeSource();
47 qint64 msecsSinceReference() override;
48private:
49 RealTimeSourcePrivate *d;
50};
52} // namespace UbuntuGestures
54#endif // UBUNTUGESTURES_TIMESOURCE_H