LibreOffice Module oox (master)  1
timenode.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 
21 #ifndef INCLUDED_OOX_PPT_TIMENODE_HXX
22 #define INCLUDED_OOX_PPT_TIMENODE_HXX
23 
24 #include <vector>
25 #include <map>
26 #include <memory>
27 
28 #include <com/sun/star/uno/Any.hxx>
29 #include <com/sun/star/uno/Reference.hxx>
31 #include <oox/ppt/slidepersist.hxx>
33 #include <rtl/ustring.hxx>
34 #include <sal/types.h>
35 
36 namespace com::sun::star {
37  namespace animations { class XAnimationNode; }
38 }
39 
40 namespace oox::core { class XmlFilterBase; }
41 
42 namespace oox::ppt {
43 
44  class TimeNode;
45 
46  typedef std::shared_ptr< TimeNode > TimeNodePtr;
47  typedef std::vector< TimeNodePtr > TimeNodePtrList;
48 
49  class TimeNode final
50  {
51  public:
52  typedef ::std::map< OUString, css::uno::Any > UserDataMap;
53 
54  TimeNode( sal_Int16 nNodeType );
55  ~TimeNode();
56 
58  UserDataMap & getUserData() { return maUserData; }
59  TimeNodePtrList & getChildren()
60  { return maChildren; }
61 
62  void setId( sal_Int32 nId );
63 
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; }
74 
75  void setNode(
76  const ::oox::core::XmlFilterBase& rFilter,
77  const css::uno::Reference< css::animations::XAnimationNode >& xNode,
78  const SlidePersistPtr & pSlide,
79  const css::uno::Reference< css::animations::XAnimationNode >& xParent);
80 
82  {
83  if( !mpTarget )
84  mpTarget = std::make_shared<AnimTargetElement>();
85  return mpTarget;
86  }
87 
89  { return maStCondList; }
91  { return maEndCondList; }
93  { return maNextCondList; }
95  { return maPrevCondList; }
97  { mbHasEndSyncValue = true; return maEndSyncValue; }
98  private:
99 
100  static OUString getServiceName( sal_Int16 nNodeType );
101 
102  static css::uno::Reference< css::animations::XAnimationNode >
104  const ::oox::core::XmlFilterBase& rFilter,
105  const OUString& rServiceName,
106  const css::uno::Reference< css::animations::XAnimationNode >& rxNode );
107 
108  const sal_Int16 mnNodeType;
109 
110  TimeNodePtrList maChildren;
111 
112  OUString msId;
114  UserDataMap maUserData; // a sequence to be stored as "UserData" property
117  bool mbHasEndSyncValue; // set to true if we try to get the endSync.
121  };
122 
123 }
124 
125 
126 #endif
127 
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< TimeNodePtr > TimeNodePtrList
Definition: timenode.hxx:47
data for CT_TLTimeCondition
TimeNode(sal_Int16 nNodeType)
Definition: timenode.cxx:130
UserDataMap & getUserData()
Definition: timenode.hxx:58
NodePropertyMap maNodeProperties
Definition: timenode.hxx:113
sal_Int16 nId
Definition: olehelper.cxx:97
std::shared_ptr< AnimTargetElement > AnimTargetElementPtr
AnimTargetElementPtr mpTarget
Definition: timenode.hxx:116
void setTo(const css::uno::Any &aTo)
Definition: timenode.cxx:651
AnimationCondition maEndSyncValue
Definition: timenode.hxx:118
std::array< css::uno::Any, NP_SIZE_ > NodePropertyMap
void setNode(const ::oox::core::XmlFilterBase &rFilter, const css::uno::Reference< css::animations::XAnimationNode > &xNode, const SlidePersistPtr &pSlide, const css::uno::Reference< css::animations::XAnimationNode > &xParent)
Definition: timenode.cxx:245
TimeNodePtrList maChildren
Definition: timenode.hxx:110
const sal_Int16 mnNodeType
Definition: timenode.hxx:108
::std::map< OUString, css::uno::Any > UserDataMap
Definition: timenode.hxx:52
AnimationConditionList maNextCondList
Definition: timenode.hxx:120
exports com.sun.star. animations
SlideTransition maTransitionFilter
Definition: timenode.hxx:115
void setTransitionFilter(const SlideTransition &aTransition)
Definition: timenode.hxx:72
AnimationConditionList & getEndCondition()
Definition: timenode.hxx:90
std::vector< AnimationCondition > AnimationConditionList
static OUString getServiceName(sal_Int16 nNodeType)
Definition: timenode.cxx:85
static css::uno::Reference< css::animations::XAnimationNode > createAndInsert(const ::oox::core::XmlFilterBase &rFilter, const OUString &rServiceName, const css::uno::Reference< css::animations::XAnimationNode > &rxNode)
Definition: timenode.cxx:626
NodePropertyMap & getNodeProperties()
Definition: timenode.hxx:57
AnimationConditionList & getNextCondition()
Definition: timenode.hxx:92
AnimationConditionList maEndCondList
Definition: timenode.hxx:119
AnimationConditionList maPrevCondList
Definition: timenode.hxx:120
void setFrom(const css::uno::Any &aFrom)
Definition: timenode.cxx:656
TimeNodePtrList & getChildren()
Definition: timenode.hxx:59
AnimationCondition & getEndSyncValue()
Definition: timenode.hxx:96
std::shared_ptr< SlidePersist > SlidePersistPtr
AnimationConditionList & getStartCondition()
Definition: timenode.hxx:88
std::shared_ptr< TimeNode > TimeNodePtr
Definition: timenode.hxx:44
void setBy(const css::uno::Any &aBy)
Definition: timenode.cxx:661
void addNode(const ::oox::core::XmlFilterBase &rFilter, const css::uno::Reference< css::animations::XAnimationNode > &rxNode, const SlidePersistPtr &slide)
Definition: timenode.cxx:224
UserDataMap maUserData
Definition: timenode.hxx:114
AnimationConditionList & getPrevCondition()
Definition: timenode.hxx:94
void setId(sal_Int32 nId)
Definition: timenode.cxx:646
AnimationConditionList maStCondList
Definition: timenode.hxx:119
AnimTargetElementPtr const & getTarget()
Definition: timenode.hxx:81