phoneuis/BubbleManager/Inc/BMMediaReaderInterface.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:  Media reader interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MBUBBLEMEDIAREADER_H
       
    20 #define MBUBBLEMEDIAREADER_H
       
    21 
       
    22 class CFbsBitmap;
       
    23 class MBubbleMediaReaderObserver;
       
    24 
       
    25 /**
       
    26  *  Media reader interface.
       
    27  *
       
    28  *  @lib BubbleManager
       
    29  *  @since S60 v3.2
       
    30  */
       
    31 class MBubbleMediaReader
       
    32     {
       
    33 
       
    34 public:
       
    35     // === LOADING CONTROL ====================================================
       
    36     
       
    37     /**
       
    38      * Factory method to create a reader for given file.
       
    39      *
       
    40      * @since S60 v3.2
       
    41      * @param aTargetSize Image/frame is loaded to this size.
       
    42      * @param aScaleFactor Scaling factor (normally the ratio 
       
    43      *                     between target size and clip rect).
       
    44      * @param aClipRect Clip rect, relative to source dimensions.
       
    45      * @param aObserver Observer for reader events.
       
    46      */
       
    47     virtual void StartReadingL(
       
    48         const TSize& aTargetSize,
       
    49         const TReal& aScaleFactor,
       
    50         const TRect& aClipRect, 
       
    51         MBubbleMediaReaderObserver* aObserver  ) = 0;
       
    52     
       
    53     /**
       
    54      * Update scale and clip parameters for currently viewed bitmap.
       
    55      *
       
    56      * @since S60 v3.2
       
    57      * @param aTargetSize  Maximum size for destination bitmap.
       
    58      * @param aScaleFactor Scaling factor (normally the ratio between target
       
    59                            size and clip rect).
       
    60      * @param aClipRect    Clip rect, relative to source dimensions.
       
    61      * @return System wide error code.
       
    62      */
       
    63     virtual TInt SetScaleAndClip(
       
    64         const TSize& aTargetSize,
       
    65         const TReal& aScaleFactor,
       
    66         const TRect& aClipRect ) = 0;
       
    67     
       
    68     /**
       
    69      * Cancels reading in progress.
       
    70      *
       
    71      * @since S60 v3.2
       
    72      */
       
    73     virtual void CancelReading() = 0;
       
    74     
       
    75     // === DATA ACCESS ========================================================
       
    76     /**
       
    77      * Gets size of source image/frame.
       
    78      *
       
    79      * @since S60 v3.2
       
    80      * @return Size of source image.
       
    81      */
       
    82     virtual const TSize SourceSize() const = 0;
       
    83     
       
    84     /**
       
    85      * Checks if source is animation.
       
    86      *
       
    87      * @since S60 v3.2
       
    88      * @return ETrue if source is animation.
       
    89      */
       
    90     virtual TBool IsAnimation() const = 0;
       
    91     
       
    92     /**
       
    93      * Gets pointer to frame buffer.
       
    94      *
       
    95      * @since S60 v3.2
       
    96      * @return Pointer to frame buffer.
       
    97      */
       
    98     virtual const CFbsBitmap* FrameBuffer() const = 0;
       
    99     
       
   100     /**
       
   101      * Gets mask for the current frame in frame buffer.
       
   102      *
       
   103      * @since S60 v3.2
       
   104      * @return Pointer to mask frame.
       
   105      */
       
   106     virtual const CFbsBitmap* Mask() const = 0;
       
   107     
       
   108     // === ANIMATION CONTROL ==================================================
       
   109     /**
       
   110      * Starts animation.
       
   111      *
       
   112      * @since S60 v3.2
       
   113      */
       
   114     virtual void Play() = 0;
       
   115     
       
   116     /**
       
   117      * Stops animation.
       
   118      *
       
   119      * @since S60 v3.2
       
   120      */
       
   121     virtual void Stop() = 0;
       
   122     
       
   123     // Virtual destructor
       
   124     virtual ~MBubbleMediaReader() {};
       
   125     };
       
   126 
       
   127 
       
   128 #endif // MBUBBLEMEDIAREADER_H