phoneuis/BubbleManager/Inc/BMMediaReader.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Base class for media readers.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef BMMEDIAREADER_H
       
    20 #define BMMEDIAREADER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "BMMediaReaderInterface.h"
       
    24 
       
    25 class MBubbleMediaReaderObserver;
       
    26 
       
    27 /**
       
    28  *  Base class for media readers.
       
    29  *
       
    30  *  @lib BubbleManager
       
    31  *  @since S60 v3.2
       
    32  */
       
    33 class CBubbleMediaReader : public CBase,
       
    34                            public MBubbleMediaReader
       
    35     {
       
    36 public:    
       
    37     virtual ~CBubbleMediaReader();
       
    38 
       
    39     /**
       
    40      * Derived class should call this when image or new 
       
    41      * animation frame has been read to frame buffer.
       
    42      *
       
    43      * @since S60 v3.2
       
    44      */
       
    45     void HandleReadingComplete();
       
    46     
       
    47     /**
       
    48      * Derived class should call this in error situation.
       
    49      *
       
    50      * @since S60 v3.2
       
    51      * @param aError System wide error code.
       
    52      */
       
    53     void HandleReadingError( TInt aError );
       
    54     
       
    55     
       
    56 protected: // from MBubbleMediaReader
       
    57     
       
    58     virtual void StartReadingL( 
       
    59         const TSize& aTargetSize, 
       
    60         const TReal& aScaleFactor,
       
    61         const TRect& aClipRect, 
       
    62         MBubbleMediaReaderObserver* aObserver ) = 0;
       
    63 
       
    64     virtual TInt SetScaleAndClip(
       
    65         const TSize& aTargetSize,
       
    66         const TReal& aScaleFactor,
       
    67         const TRect& aClipRect ) = 0;        
       
    68     
       
    69     virtual void CancelReading() = 0;
       
    70     
       
    71     virtual const TSize SourceSize() const = 0;
       
    72     
       
    73     virtual TBool IsAnimation() const = 0;
       
    74     
       
    75     virtual const CFbsBitmap* FrameBuffer() const;
       
    76     
       
    77     virtual const CFbsBitmap* Mask() const;
       
    78     
       
    79     virtual void Play() = 0;
       
    80     
       
    81     virtual void Stop() = 0;
       
    82 
       
    83 public:
       
    84     CBubbleMediaReader();
       
    85 
       
    86 protected: // data
       
    87     // Not owned
       
    88     const CFbsBitmap* iFrameBuffer;
       
    89     // Not owned
       
    90     const CFbsBitmap* iMask;
       
    91     // Not owned
       
    92     MBubbleMediaReaderObserver* iObserver;
       
    93     };
       
    94 
       
    95 
       
    96 #endif // BMMEDIAREADER_H