LibreOffice Module sd (master) 1
pptinanimations.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#pragma once
21
22#include <com/sun/star/uno/Reference.hxx>
23
24#include <vector>
25#include <animations.hxx>
26
27#ifdef DBG_ANIM_LOG
28#include <stdio.h>
29#endif
30
31namespace com::sun::star::animations { class XAnimationNode; }
32namespace com::sun::star::drawing { class XDrawPage; }
33namespace ppt { struct AnimationNode; }
34
35class DffRecordHeader;
36class SvStream;
37class ImplSdPPTImport;
38
39namespace ppt
40{
41class PropertySet;
42class Atom;
43
45{
46public:
47 AnimationImporter( ImplSdPPTImport* pPPTImport, SvStream& rStCtrl );
48
49 int import( const css::uno::Reference< css::drawing::XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd );
50
51private:
52 int importAnimationContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xParent );
53 int importTimeContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
54 int importAnimationNodeContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
55
56 void importAnimateSetContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
57 void importAnimateFilterContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
58 void importAnimateContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
59 void importAnimateScaleContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
60 void importAnimateColorContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
61 void importAnimateRotationContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
62 void importAnimateMotionContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
63 void importCommandContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
64 int importAudioContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
65
66 void importAnimationEvents( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
67 void importAnimationValues( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
68 void importAnimationActions( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
69 void importAnimateAttributeTargetContainer( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
70
71 void importAnimateKeyPoints( const Atom* pAtom, const css::uno::Reference< css::animations::XAnimationNode >& xNode );
72 void importPropertySetContainer( const Atom* pAtom,PropertySet& rSet );
73 bool importAttributeValue( const Atom* pAtom, css::uno::Any& rAny );
74 void importAttributeNamesContainer( const Atom* pAtom, OUString& rAttributeNames );
75 void importTargetElementContainer( const Atom* pAtom, css::uno::Any& rTarget, sal_Int16& nSubType );
76
77 static void fillNode( css::uno::Reference< css::animations::XAnimationNode > const & xTiming, const AnimationNode& rNode, const PropertySet& rSet );
78 static css::uno::Reference< css::animations::XAnimationNode > createNode( const Atom* pAtom, const AnimationNode& rNode );
79
80 bool convertAnimationNode( const css::uno::Reference< css::animations::XAnimationNode >& xNode, const css::uno::Reference< css::animations::XAnimationNode >& xParent );
81 css::uno::Any implGetColorAny( sal_Int32 nMode, sal_Int32 nA, sal_Int32 nB, sal_Int32 nC );
82 static sal_Int16 implGetColorSpace( sal_Int32 nMode, sal_Int32 nA, sal_Int32 nB, sal_Int32 nC );
83
84private:
85 css::uno::Reference< css::animations::XAnimationNode > mxRootNode;
86
89
90 std::vector< sd::AfterEffectNode > maAfterEffectNodes;
91
92#ifdef DBG_ANIM_LOG
93 FILE * mpFile;
94 void dump_anim_group( const Atom* pAtom, const AnimationNode& rNode, const PropertySet& rSet, bool bOpen );
95 void dump( const OUString& rString );
96 void dump( sal_uInt32 nLen, bool bNewLine = true );
97#endif
98
99 static void dump_atom_header( const Atom* pAtom, bool bOpen, bool bAppend );
100 static void dump_atom( const Atom* pAtom, bool bNewLine = true );
101 static void dump_target( css::uno::Any& rAny );
102 static void dump( css::uno::Any& rAny );
103 static void dump( const PropertySet& rSet );
104 static void dump( const AnimationNode& rNode );
105 static void dump( const char * pText );
106 static void dump( const char * pText, sal_Int32 nInt );
107 void dump( const char * pText, sal_Int64 nInt );
108 static void dump( const char * pText, double fDouble );
109 static void dump( const char * pText, const char * pText2 );
110 static void dump( const char * pText, std::u16string_view rString );
111};
112
113} // namespace ppt
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void dump(const char *pText, sal_Int64 nInt)
std::vector< sd::AfterEffectNode > maAfterEffectNodes
int importAudioContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
static sal_Int16 implGetColorSpace(sal_Int32 nMode, sal_Int32 nA, sal_Int32 nB, sal_Int32 nC)
int importAnimationContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xParent)
void importAttributeNamesContainer(const Atom *pAtom, OUString &rAttributeNames)
static void dump_atom(const Atom *pAtom, bool bNewLine=true)
void importCommandContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
void importAnimateFilterContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
ImplSdPPTImport * mpPPTImport
void importAnimateRotationContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
void importAnimateContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
css::uno::Reference< css::animations::XAnimationNode > mxRootNode
void importAnimateScaleContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
void importAnimateSetContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
static void dump(css::uno::Any &rAny)
void importAnimationValues(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
static css::uno::Reference< css::animations::XAnimationNode > createNode(const Atom *pAtom, const AnimationNode &rNode)
int importAnimationNodeContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
css::uno::Any implGetColorAny(sal_Int32 nMode, sal_Int32 nA, sal_Int32 nB, sal_Int32 nC)
void importAnimateMotionContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
void importAnimateColorContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
bool convertAnimationNode(const css::uno::Reference< css::animations::XAnimationNode > &xNode, const css::uno::Reference< css::animations::XAnimationNode > &xParent)
static void dump_atom_header(const Atom *pAtom, bool bOpen, bool bAppend)
bool importAttributeValue(const Atom *pAtom, css::uno::Any &rAny)
void importAnimateKeyPoints(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
void importPropertySetContainer(const Atom *pAtom, PropertySet &rSet)
int importTimeContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
static void dump_target(css::uno::Any &rAny)
static void fillNode(css::uno::Reference< css::animations::XAnimationNode > const &xTiming, const AnimationNode &rNode, const PropertySet &rSet)
void importTargetElementContainer(const Atom *pAtom, css::uno::Any &rTarget, sal_Int16 &nSubType)
void importAnimateAttributeTargetContainer(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
void importAnimationEvents(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
AnimationImporter(ImplSdPPTImport *pPPTImport, SvStream &rStCtrl)
void importAnimationActions(const Atom *pAtom, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
FilterGroup & rTarget
static SfxItemSet & rSet
this atom is the first entry in each animation group