LibreOffice Module slideshow (master) 1
Public Member Functions | Static Public Member Functions | List of all members
slideshow::internal::SmilFunctionParser Class Reference

#include <smilfunctionparser.hxx>

Public Member Functions

 SmilFunctionParser ()=delete
 
 SmilFunctionParser (const SmilFunctionParser &)=delete
 
SmilFunctionParseroperator= (const SmilFunctionParser &)=delete
 

Static Public Member Functions

static std::shared_ptr< ExpressionNode > const & parseSmilValue (const OUString &rSmilValue, const ::basegfx::B2DRectangle &rRelativeShapeBounds)
 Parse a string containing a SMIL value. More...
 
static std::shared_ptr< ExpressionNode > const & parseSmilFunction (const OUString &rSmilFunction, const ::basegfx::B2DRectangle &rRelativeShapeBounds)
 Parse a string containing a SMIL function. More...
 

Detailed Description

Definition at line 35 of file smilfunctionparser.hxx.

Constructor & Destructor Documentation

◆ SmilFunctionParser() [1/2]

slideshow::internal::SmilFunctionParser::SmilFunctionParser ( )
delete

◆ SmilFunctionParser() [2/2]

slideshow::internal::SmilFunctionParser::SmilFunctionParser ( const SmilFunctionParser )
delete

Member Function Documentation

◆ operator=()

SmilFunctionParser & slideshow::internal::SmilFunctionParser::operator= ( const SmilFunctionParser )
delete

◆ parseSmilFunction()

std::shared_ptr< ExpressionNode > const & slideshow::internal::SmilFunctionParser::parseSmilFunction ( const OUString &  rSmilFunction,
const ::basegfx::B2DRectangle rRelativeShapeBounds 
)
static

Parse a string containing a SMIL function.

This method parses a string representing a possibly time-varying SMIL function.

The following grammar is accepted by this method: identifier = 't'|'pi'|'e'|'X'|'Y'|'Width'|'Height'

function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan'|'acos'|'asin'|'exp'|'log'

basic_expression = number | identifier | function '(' additive_expression ')' | '(' additive_expression ')'

unary_expression = '-' basic_expression | basic_expression

multiplicative_expression = unary_expression ( ( '*' unary_expression )* | ( '/' unary_expression )* )

additive_expression = multiplicative_expression ( ( '+' multiplicative_expression )* | ( '-' multiplicative_expression )* )

Parameters
rSmilFunctionThe string to parse
rRelativeShapeBoundsThe bounds of the shape this SMIL value is to be evaluated for. The bounds must be relative to the page the shape is part of, i.e. within the [0,1] range. This is necessary, since the string might contain symbolic references to the shape bounding box.
Exceptions
ParseErrorif an invalid expression is given.
Returns
the generated function object.

Definition at line 567 of file smilfunctionparser.cxx.

References OUStringToOString().

◆ parseSmilValue()

std::shared_ptr< ExpressionNode > const & slideshow::internal::SmilFunctionParser::parseSmilValue ( const OUString &  rSmilValue,
const ::basegfx::B2DRectangle rRelativeShapeBounds 
)
static

Parse a string containing a SMIL value.

This method parses a string representing a fixed value (i.e. a value that does not change by time). Due to the dynamic view capabilities of the presentation engine, this value can sometimes only be determined during runtime of the animation (because e.g. mixed screen/view coordinates are involved), and is thus still returned as an ExpressionNode object. An example for such a case is the "Width+1.0" string, which contains the width of the shape in user coordinate space, and the screen width in device coordinate space.

The following grammar is accepted by this method: identifier = 'pi'|'e'|'X'|'Y'|'Width'|'Height'

function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan'|'acos'|'asin'|'exp'|'log'

basic_expression = number | identifier | function '(' additive_expression ')' | '(' additive_expression ')'

unary_expression = '-' basic_expression | basic_expression

multiplicative_expression = unary_expression ( ( '*' unary_expression )* | ( '/' unary_expression )* )

additive_expression = multiplicative_expression ( ( '+' multiplicative_expression )* | ( '-' multiplicative_expression )* )

Parameters
rSmilValueThe string to parse
rRelativeShapeBoundsThe bounds of the shape this SMIL value is to be evaluated for. The bounds must be relative to the page the shape is part of, i.e. within the [0,1] range. This is necessary, since the string might contain symbolic references to the shape bounding box.
Exceptions
ParseErrorif an invalid expression is given.
Returns
the generated function object.

Definition at line 524 of file smilfunctionparser.cxx.

References OUStringToOString().

Referenced by slideshow::internal::extractValue().


The documentation for this class was generated from the following files: