update dev300-m58
[ooovba.git] / sd / source / filter / ppt / ppt97animations.hxx
blob274a35139396568180920369fa4163db5da7b5ba
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ppt97animations.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SD_PPT_97_ANIMATIONS_HXX
32 #define _SD_PPT_97_ANIMATIONS_HXX
34 // header for class SvStream
35 #include <tools/stream.hxx>
37 class SdrObject;
38 class Ppt97Animation;
40 // helper class for reading PPT AnimationInfoAtom
41 class Ppt97AnimationInfoAtom
43 friend class Ppt97Animation;
45 //-- member
46 UINT32 nDimColor;
47 UINT32 nFlags; // 0x0004: time instead of click
48 UINT32 nSoundRef;
49 INT32 nDelayTime; // 1/1000 sec
50 UINT16 nOrderID;
51 UINT16 nSlideCount;
52 UINT8 nBuildType;
53 UINT8 nFlyMethod;
54 UINT8 nFlyDirection;
55 UINT8 nAfterEffect; //nAfterEffect: 0: none; 1: change color; 2: dim on next effect; 3: dim after effect;
56 UINT8 nSubEffect;
57 UINT8 nOLEVerb;
59 // unknown, because whole size needs to be 28
60 UINT8 nUnknown1;
61 UINT8 nUnknown2;
63 //-- methods
64 void ReadStream( SvStream& rIn );
66 nFlags:
67 decimal / hexadecimal / binary
68 1040 0x00000410 10000010000 mouseclick
69 17428 0x00004414 100010000010100 after previous 0 sec (animate form)
70 17412 0x00004404 100010000000100 after previous 0 sec
71 1088 0x00000440 10001000000 stop previous sound and mouseclick
72 1044 0x00000414 10000010100 play sound automatic
73 1041 0x00000411 10000010001
74 | | | | | |
75 | | | | | reverse order
76 | | | | after previous
77 | | | sound
78 | | stop previous sound
79 | ?
80 animate form
82 nAfterEffect:
83 1: color
84 0: nothing
85 3: hide after animation
86 2: hide at next mouse click
90 class Ppt97Animation
92 /** this is a helping class for import of PPT 97 animations
93 1. use the constructor Ppt97Animation( SvStream& rIn ) to import informations from the stream
94 2. use the set methods to modify and complete the data
95 3. use the method createAndSetCustomAnimationEffect( ) to create an effect in sd model
98 public: //public methods
99 Ppt97Animation( SvStream& rIn );
101 Ppt97Animation();
102 Ppt97Animation( const Ppt97Animation& rAnimation );
103 Ppt97Animation& operator= ( const Ppt97Animation& rAnimation );
104 bool operator < ( const Ppt97Animation& rAnimation ) const;//later is greater
105 bool operator > ( const Ppt97Animation& rAnimation ) const;//later is greater
106 ~Ppt97Animation();
108 //get methods
109 bool HasEffect() const;
110 bool HasParagraphEffect() const;
111 bool HasSoundEffect() const;
112 sal_Int32 GetDimColor() const;
113 UINT32 GetSoundRef() const;
114 bool HasAnimateAssociatedShape() const; //true if the shape should be animated in addition to the text
116 //set methods
117 void SetDimColor( sal_Int32 nDimColor );
118 void SetSoundFileUrl( const ::rtl::OUString& rSoundFileUrl );
119 void SetAnimateAssociatedShape( bool bAnimate ); //true if the shape should be animated in addition to the text
121 //action methods
122 /** this method creates a CustomAnimationEffect for the given SdrObject
123 from internal data and stores the created effect at the draw model
125 void createAndSetCustomAnimationEffect( SdrObject* pObj );
127 private: //private methods
129 //read methods
130 ::rtl::OUString GetPresetId() const;
131 ::rtl::OUString GetPresetSubType() const;
132 bool HasAfterEffect() const;
133 bool HasAfterEffect_ChangeColor() const;
134 bool HasAfterEffect_DimAtNextEffect() const;
135 bool HasAfterEffect_DimAfterEffect() const;
136 bool HasStopPreviousSound() const;
137 bool HasReverseOrder() const; //true if the text paragraphs should be animated in reverse order
138 sal_Int32 GetParagraphLevel() const; //paragraph level that is animated ( that paragraph and higher levels )
139 sal_Int16 GetTextAnimationType() const; //see com::sun::star::presentation::TextAnimationType
140 sal_Int16 GetEffectNodeType() const; //see com::sun::star::presentation::EffectNodeType
141 double GetDelayTimeInSeconds() const;//-1 for start on mouseclick or >= 0 for a delay in seconds for automatic start
142 bool GetSpecialDuration( double& rfDurationInSeconds ) const;
143 bool GetSpecialTextIterationDelay( double& rfTextIterationDelay ) const;
145 void UpdateCacheData() const;
146 void ClearCacheData() const;
148 private: //private member
149 //input information:
150 Ppt97AnimationInfoAtom m_aAtom;//pure input from stream
151 ::rtl::OUString m_aSoundFileUrl;//this needs to be set in addition from outside as this class has not the knowledge to translate the sound bits to a file url/
153 //cached generated output information:
154 mutable bool m_bDirtyCache;
155 mutable ::rtl::OUString m_aPresetId; // m_aPresetId and m_aSubType match to the values in sd/xml/effects.xml
156 mutable ::rtl::OUString m_aSubType;
157 mutable bool m_bHasSpecialDuration;
158 mutable double m_fDurationInSeconds;
161 #endif