Bump version to 24.04.3.4
[LibreOffice.git] / slideshow / source / inc / expressionnode.hxx
blob7e3e674a8814ca7d0e71eb8d6735bdf8180d71e0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 /* Definition of ExpressionNode interface */
24 namespace slideshow::internal
26 /** Interface describing an abstract animation function.
28 Use this interface to model time-dependent animation
29 functions of one variable.
31 class AnimationFunction
33 public:
34 virtual ~AnimationFunction() {}
36 /** Operator to calculate function value.
38 This method calculates the function value for the
39 given time instant t.
41 @param t
42 Current time instant, must be in the range [0,1]
44 @return the function value, typically in relative
45 user coordinate space ([0,1] range).
47 virtual double operator()( double t ) const = 0;
51 /** Refinement of AnimationFunction
53 This interface is used by the SMIL function parser, to
54 collapse constant values into precalculated, single nodes.
56 class ExpressionNode : public AnimationFunction
58 public:
59 /** Predicate whether this node is constant.
61 This predicate returns true, if this node is
62 neither time- nor ViewInfo dependent. This allows
63 for certain optimizations, i.e. not the full
64 expression tree needs be represented by
65 ExpressionNodes.
67 @returns true, if this node is neither time- nor
68 ViewInfo dependent
70 virtual bool isConstant() const = 0;
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */