Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / include / oox / ppt / timenode.hxx
blobc04d4f526deb5e8be7c41ba9a47103dc7bf15a37
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, css::uno::Any > UserDataMap;
49 TimeNode( sal_Int16 nNodeType );
50 virtual ~TimeNode();
52 NodePropertyMap & getNodeProperties() { return maNodeProperties; }
53 UserDataMap & getUserData() { return maUserData; }
54 TimeNodePtrList & getChildren()
55 { return maChildren; }
57 void setId( sal_Int32 nId );
59 void addNode(
60 const ::oox::core::XmlFilterBase& rFilter,
61 const css::uno::Reference< css::animations::XAnimationNode >& rxNode,
62 const SlidePersistPtr & slide);
63 // data setters
64 void setTo( const css::uno::Any & aTo );
65 void setFrom( const css::uno::Any & aFrom );
66 void setBy( const css::uno::Any & aBy );
67 void setTransitionFilter( const SlideTransition & aTransition)
68 { maTransitionFilter = aTransition; }
70 void setNode(
71 const ::oox::core::XmlFilterBase& rFilter,
72 const css::uno::Reference< css::animations::XAnimationNode >& xNode,
73 const SlidePersistPtr & pSlide );
75 AnimTargetElementPtr getTarget()
77 if( !mpTarget )
78 mpTarget.reset( new AnimTargetElement );
79 return mpTarget;
82 AnimationConditionList &getStartCondition()
83 { return maStCondList; }
84 AnimationConditionList &getEndCondition()
85 { return maEndCondList; }
86 AnimationConditionList &getNextCondition()
87 { return maNextCondList; }
88 AnimationConditionList &getPrevCondition()
89 { return maPrevCondList; }
90 AnimationCondition & getEndSyncValue()
91 { mbHasEndSyncValue = true; return maEndSyncValue; }
92 protected:
94 static OUString getServiceName( sal_Int16 nNodeType );
96 static css::uno::Reference< css::animations::XAnimationNode >
97 createAndInsert(
98 const ::oox::core::XmlFilterBase& rFilter,
99 const OUString& rServiceName,
100 const css::uno::Reference< css::animations::XAnimationNode >& rxNode );
102 private:
103 const sal_Int16 mnNodeType;
105 TimeNodePtrList maChildren;
107 OUString msId;
108 NodePropertyMap maNodeProperties;
109 UserDataMap maUserData; // a sequence to be stored as "UserData" property
110 SlideTransition maTransitionFilter;
111 AnimTargetElementPtr mpTarget;
112 bool mbHasEndSyncValue; // set to true if we try to get the endSync.
113 AnimationCondition maEndSyncValue;
114 AnimationConditionList maStCondList, maEndCondList;
115 AnimationConditionList maPrevCondList, maNextCondList;
121 #endif
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */