LCOV - code coverage report
Current view: top level - sd/source/filter/ppt - ppt97animations.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 2 50.0 %
Date: 2014-11-03 Functions: 1 2 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : #ifndef INCLUDED_SD_SOURCE_FILTER_PPT_PPT97ANIMATIONS_HXX
      21             : #define INCLUDED_SD_SOURCE_FILTER_PPT_PPT97ANIMATIONS_HXX
      22             : 
      23             : #include <tools/stream.hxx>
      24             : 
      25             : class SdrObject;
      26             : class Ppt97Animation;
      27             : 
      28             : /// helper class for reading PPT AnimationInfoAtom
      29             : class Ppt97AnimationInfoAtom
      30             : {
      31             :     friend class Ppt97Animation;
      32             : 
      33             : //-- member
      34             :     sal_uInt32          nDimColor;
      35             :     sal_uInt32          nFlags;         ///< 0x0004: time instead of click
      36             :     sal_uInt32          nSoundRef;
      37             :     sal_Int32           nDelayTime;     ///< 1/1000 sec
      38             :     sal_uInt16          nOrderID;
      39             :     sal_uInt16          nSlideCount;
      40             :     sal_uInt8           nBuildType;
      41             :     sal_uInt8           nFlyMethod;
      42             :     sal_uInt8           nFlyDirection;
      43             :     sal_uInt8           nAfterEffect;   ///< nAfterEffect: 0: none; 1: change color; 2: dim on next effect; 3: dim after effect;
      44             :     sal_uInt8           nSubEffect;
      45             :     sal_uInt8           nOLEVerb;
      46             : 
      47             :     // unknown, because whole size needs to be 28
      48             :     sal_uInt8           nUnknown1;
      49             :     sal_uInt8           nUnknown2;
      50             : 
      51             : //-- methods
      52             :     void ReadStream( SvStream& rIn );
      53             : /*
      54             :     nFlags:
      55             :     decimal / hexadecimal / binary
      56             :     1040 0x00000410     10000010000 mouseclick
      57             :    17428 0x00004414 100010000010100 after previous 0 sec (animate form)
      58             :    17412 0x00004404 100010000000100 after previous 0 sec
      59             :     1088 0x00000440     10001000000 stop previous sound and mouseclick
      60             :     1044 0x00000414     10000010100 play sound automatic
      61             :     1041 0x00000411     10000010001
      62             :                     |   |   | | | |
      63             :                     |   |   | | | reverse order
      64             :                     |   |   | | after previous
      65             :                     |   |   | sound
      66             :                     |   |   stop previous sound
      67             :                     |   ?
      68             :                     animate form
      69             : 
      70             :     nAfterEffect:
      71             :     1: color
      72             :     0: nothing
      73             :     3: hide after animation
      74             :     2: hide at next mouse click
      75             : */
      76             : };
      77             : 
      78             : /** this is a helping class for import of PPT 97 animations
      79             :         1. use the constructor Ppt97Animation( SvStream& rIn ) to import information from the stream
      80             :         2. use the set methods to modify and complete the data
      81             :         3. use the method createAndSetCustomAnimationEffect( ) to create an effect in sd model
      82             :     */
      83             : class Ppt97Animation
      84             : {
      85             : 
      86             : public: //public methods
      87             :     Ppt97Animation( SvStream& rIn );
      88             : 
      89             :     Ppt97Animation( const Ppt97Animation& rAnimation );
      90             :     Ppt97Animation& operator= ( const Ppt97Animation& rAnimation );
      91             :     bool operator < ( const Ppt97Animation& rAnimation ) const;//later is greater
      92             :     bool operator > ( const Ppt97Animation& rAnimation ) const;//later is greater
      93             :     ~Ppt97Animation();
      94             : 
      95             :     //get methods
      96             :     bool HasEffect() const;
      97             :     bool HasParagraphEffect() const;
      98             :     bool HasSoundEffect() const;
      99          78 :     sal_Int32 GetDimColor() const { return static_cast<sal_Int32>(m_aAtom.nDimColor);}
     100           0 :     sal_uInt32 GetSoundRef() const { return m_aAtom.nSoundRef;}
     101             :     /// @return true if the shape should be animated in addition to the text
     102             :     bool HasAnimateAssociatedShape() const;
     103             : 
     104             :     //set methods
     105             :     void SetDimColor( sal_Int32 nDimColor );
     106             :     void SetSoundFileUrl( const OUString& rSoundFileUrl );
     107             :     void SetAnimateAssociatedShape( bool bAnimate ); //true if the shape should be animated in addition to the text
     108             : 
     109             :     //action methods
     110             :     /** this method creates a CustomAnimationEffect for the given SdrObject
     111             :     from internal data and stores the created effect at the draw model
     112             :     */
     113             :     void createAndSetCustomAnimationEffect( SdrObject* pObj );
     114             : 
     115             : private: //private methods
     116             : 
     117             :     //read methods
     118             :     OUString GetPresetId() const;
     119             :     OUString GetPresetSubType() const;
     120             :     bool HasAfterEffect() const;
     121             :     bool HasAfterEffect_ChangeColor() const;
     122             :     bool HasAfterEffect_DimAtNextEffect() const;
     123             :     bool HasStopPreviousSound() const;
     124             : 
     125             :     /// @return true if the text paragraphs should be animated in reverse order
     126             :     bool HasReverseOrder() const;
     127             : 
     128             :     ///paragraph level that is animated ( that paragraph and higher levels )
     129             :     sal_Int32 GetParagraphLevel() const;
     130             : 
     131             :     ///@see com::sun::star::presentation::TextAnimationType
     132             :     sal_Int16 GetTextAnimationType() const;
     133             : 
     134             :     ///@see com::sun::star::presentation::EffectNodeType
     135             :     sal_Int16 GetEffectNodeType() const;
     136             : 
     137             :     /// @return -1 for start on mouseclick or >= 0 for a delay in seconds for automatic start
     138             :     double GetDelayTimeInSeconds() const;
     139             :     bool GetSpecialDuration( double& rfDurationInSeconds ) const;
     140             :     bool GetSpecialTextIterationDelay( double& rfTextIterationDelay ) const;
     141             : 
     142             :     void UpdateCacheData() const;
     143             :     void ClearCacheData() const;
     144             : 
     145             : private: //private member
     146             :     //input information:
     147             :     Ppt97AnimationInfoAtom  m_aAtom;         ///< pure input from stream
     148             :     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
     149             : 
     150             :     //cached generated output information:
     151             :     mutable bool            m_bDirtyCache;
     152             :     mutable OUString m_aPresetId; // m_aPresetId and m_aSubType match to the values in sd/xml/effects.xml
     153             :     mutable OUString m_aSubType;
     154             :     mutable bool            m_bHasSpecialDuration;
     155             :     mutable double          m_fDurationInSeconds;
     156             : };
     157             : 
     158             : #endif
     159             : 
     160             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10