LibreOffice Module drawinglayer (master) 1
animationtiming.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
20#ifndef INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
21#define INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
22
24
25#include <vector>
26#include <memory>
27
28
30 {
31
32
34 {
35 private:
37 AnimationEntry& operator=(const AnimationEntry& rCandidate) = delete;
38
39 public:
41 virtual ~AnimationEntry();
42 virtual std::unique_ptr<AnimationEntry> clone() const = 0;
43
44 virtual bool operator==(const AnimationEntry& rCandidate) const = 0;
45 virtual double getDuration() const = 0;
46 virtual double getStateAtTime(double fTime) const = 0;
47 virtual double getNextEventTime(double fTime) const = 0;
48 };
49
50
52 {
53 double mfDuration;
54 double mfState;
55
56 public:
57 AnimationEntryFixed(double fDuration, double fState);
58 virtual ~AnimationEntryFixed() override;
59 virtual std::unique_ptr<AnimationEntry> clone() const override;
60
61 virtual bool operator==(const AnimationEntry& rCandidate) const override;
62 virtual double getDuration() const override;
63 virtual double getStateAtTime(double fTime) const override;
64 virtual double getNextEventTime(double fTime) const override;
65 };
66
67
69 {
70 double mfDuration;
72 double mfStart;
73 double mfStop;
74
75 public:
76 AnimationEntryLinear(double fDuration, double fFrequency, double fStart, double fStop);
77 virtual ~AnimationEntryLinear() override;
78 virtual std::unique_ptr<AnimationEntry> clone() const override;
79
80 virtual bool operator==(const AnimationEntry& rCandidate) const override;
81 virtual double getDuration() const override;
82 virtual double getStateAtTime(double fTime) const override;
83 virtual double getNextEventTime(double fTime) const override;
84 };
85
86
88 {
89 protected:
90 using Entries = std::vector<std::unique_ptr<AnimationEntry>>;
91
92 double mfDuration;
94
95 // helpers
96 Entries::size_type impGetIndexAtTime(double fTime, double &rfAddedTime) const;
97
98 public:
100 virtual ~AnimationEntryList() override;
101 virtual std::unique_ptr<AnimationEntry> clone() const override;
102
103 virtual bool operator==(const AnimationEntry& rCandidate) const override;
104 void append(const AnimationEntry& rCandidate);
105 virtual double getDuration() const override;
106 virtual double getStateAtTime(double fTime) const override;
107 virtual double getNextEventTime(double fTime) const override;
108 };
109
110
112 {
113 sal_uInt32 mnRepeat;
114
115 public:
116 AnimationEntryLoop(sal_uInt32 nRepeat);
117 virtual ~AnimationEntryLoop() override;
118 virtual std::unique_ptr<AnimationEntry> clone() const override;
119
120 virtual bool operator==(const AnimationEntry& rCandidate) const override;
121 virtual double getDuration() const override;
122 virtual double getStateAtTime(double fTime) const override;
123 virtual double getNextEventTime(double fTime) const override;
124 };
125
126
127} // end of namespace drawinglayer::animation
128
129
130#endif //INCLUDED_DRAWINGLAYER_ANIMATION_ANIMATIONTIMING_HXX
131
132/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::unique_ptr< AnimationEntry > > Entries
AnimationEntry(const AnimationEntry &)=delete
virtual std::unique_ptr< AnimationEntry > clone() const =0
virtual bool operator==(const AnimationEntry &rCandidate) const =0
virtual double getNextEventTime(double fTime) const =0
virtual double getStateAtTime(double fTime) const =0
AnimationEntry & operator=(const AnimationEntry &rCandidate)=delete
virtual double getDuration() const =0
T * clone(T *const other)
#define DRAWINGLAYER_DLLPUBLIC
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)