Branch libreoffice-5-0-4
[LibreOffice.git] / include / oox / ppt / timenode.hxx
blob1aa5b5afddb98bd5eea21cca9a53a3d6ea52e8a7
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 .
21 #ifndef INCLUDED_OOX_PPT_TIMENODE_HXX
22 #define INCLUDED_OOX_PPT_TIMENODE_HXX
24 #include <memory>
25 #include <vector>
26 #include <list>
27 #include <rtl/ustring.hxx>
29 #include <com/sun/star/frame/XModel.hpp>
30 #include <com/sun/star/animations/XAnimationNode.hpp>
31 #include <oox/helper/propertymap.hxx>
32 #include <oox/ppt/slidetransition.hxx>
33 #include <oox/ppt/slidepersist.hxx>
34 #include <oox/ppt/animationspersist.hxx>
36 namespace oox { namespace ppt {
38 class TimeNode;
39 class SlideTransition;
41 typedef std::shared_ptr< TimeNode > TimeNodePtr;
42 typedef std::list< TimeNodePtr > TimeNodePtrList;
44 class TimeNode
46 public:
47 typedef ::std::map< OUString, ::com::sun::star::uno::Any > UserDataMap;
49 TimeNode( sal_Int16 nNodeType );
50 virtual ~TimeNode();
52 NodePropertyMap & getNodeProperties() { return maNodeProperties; }
53 UserDataMap & getUserData() { return maUserData; }
54 void addChild( const TimeNodePtr & pChildPtr )
55 { maChildren.push_back( pChildPtr ); }
57 TimeNodePtrList & getChildren()
58 { return maChildren; }
60 void setId( sal_Int32 nId );
61 const OUString & getId() const { return msId; }
63 void addNode(
64 const ::oox::core::XmlFilterBase& rFilter,
65 const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rxNode,
66 const SlidePersistPtr & slide);
67 // data setters
68 void setTo( const ::com::sun::star::uno::Any & aTo );
69 void setFrom( const ::com::sun::star::uno::Any & aFrom );
70 void setBy( const ::com::sun::star::uno::Any & aBy );
71 void setTransitionFilter( const SlideTransition & aTransition)
72 { maTransitionFilter = aTransition; }
74 void setNode(
75 const ::oox::core::XmlFilterBase& rFilter,
76 const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode,
77 const SlidePersistPtr & pSlide );
79 AnimTargetElementPtr getTarget()
81 if( !mpTarget )
82 mpTarget.reset( new AnimTargetElement );
83 return mpTarget;
86 AnimationConditionList &getStartCondition()
87 { return maStCondList; }
88 AnimationConditionList &getEndCondition()
89 { return maEndCondList; }
90 AnimationConditionList &getNextCondition()
91 { return maNextCondList; }
92 AnimationConditionList &getPrevCondition()
93 { return maPrevCondList; }
94 AnimationCondition & getEndSyncValue()
95 { mbHasEndSyncValue = true; return maEndSyncValue; }
96 protected:
98 static OUString getServiceName( sal_Int16 nNodeType );
100 static ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >
101 createAndInsert(
102 const ::oox::core::XmlFilterBase& rFilter,
103 const OUString& rServiceName,
104 const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rxNode );
106 private:
107 const sal_Int16 mnNodeType;
109 TimeNodePtrList maChildren;
111 OUString msId;
112 NodePropertyMap maNodeProperties;
113 UserDataMap maUserData; // a sequence to be stored as "UserData" property
114 SlideTransition maTransitionFilter;
115 AnimTargetElementPtr mpTarget;
116 bool mbHasEndSyncValue; // set to true if we try to get the endSync.
117 AnimationCondition maEndSyncValue;
118 AnimationConditionList maStCondList, maEndCondList;
119 AnimationConditionList maPrevCondList, maNextCondList;
125 #endif
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */