Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / oox / ppt / timenode.hxx
blob0c3cd403b93dc4c794ce97e534214d82448d9871
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 <list>
25 #include <map>
26 #include <memory>
28 #include <com/sun/star/uno/Any.hxx>
29 #include <com/sun/star/uno/Reference.hxx>
30 #include <oox/ppt/slidetransition.hxx>
31 #include <oox/ppt/slidepersist.hxx>
32 #include <oox/ppt/animationspersist.hxx>
33 #include <rtl/ustring.hxx>
34 #include <sal/types.h>
36 namespace com { namespace sun { namespace star {
37 namespace animations { class XAnimationNode; }
38 } } }
40 namespace oox { namespace core { class XmlFilterBase; } }
42 namespace oox { namespace ppt {
44 class TimeNode;
46 typedef std::shared_ptr< TimeNode > TimeNodePtr;
47 typedef std::list< TimeNodePtr > TimeNodePtrList;
49 class TimeNode final
51 public:
52 typedef ::std::map< OUString, css::uno::Any > UserDataMap;
54 TimeNode( sal_Int16 nNodeType );
55 ~TimeNode();
57 NodePropertyMap & getNodeProperties() { return maNodeProperties; }
58 UserDataMap & getUserData() { return maUserData; }
59 TimeNodePtrList & getChildren()
60 { return maChildren; }
62 void setId( sal_Int32 nId );
64 void addNode(
65 const ::oox::core::XmlFilterBase& rFilter,
66 const css::uno::Reference< css::animations::XAnimationNode >& rxNode,
67 const SlidePersistPtr & slide);
68 // data setters
69 void setTo( const css::uno::Any & aTo );
70 void setFrom( const css::uno::Any & aFrom );
71 void setBy( const css::uno::Any & aBy );
72 void setTransitionFilter( const SlideTransition & aTransition)
73 { maTransitionFilter = aTransition; }
75 void setNode(
76 const ::oox::core::XmlFilterBase& rFilter,
77 const css::uno::Reference< css::animations::XAnimationNode >& xNode,
78 const SlidePersistPtr & pSlide );
80 AnimTargetElementPtr const & getTarget()
82 if( !mpTarget )
83 mpTarget.reset( new AnimTargetElement );
84 return mpTarget;
87 AnimationConditionList &getStartCondition()
88 { return maStCondList; }
89 AnimationConditionList &getEndCondition()
90 { return maEndCondList; }
91 AnimationConditionList &getNextCondition()
92 { return maNextCondList; }
93 AnimationConditionList &getPrevCondition()
94 { return maPrevCondList; }
95 AnimationCondition & getEndSyncValue()
96 { mbHasEndSyncValue = true; return maEndSyncValue; }
97 private:
99 static OUString getServiceName( sal_Int16 nNodeType );
101 static css::uno::Reference< css::animations::XAnimationNode >
102 createAndInsert(
103 const ::oox::core::XmlFilterBase& rFilter,
104 const OUString& rServiceName,
105 const css::uno::Reference< css::animations::XAnimationNode >& rxNode );
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: */