startupservices/startupanimation/sanimctrl/inc/sanimctrl.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Declaration of CSAnimCtrl class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SANIMCTRL_H
       
    20 #define SANIMCTRL_H
       
    21 
       
    22 #include <coecntrl.h>
       
    23 #include "sanimobserver.h"
       
    24 
       
    25 class CFbsBitmap;
       
    26 class CSAnimEngine;
       
    27 
       
    28 /**
       
    29 *  Start-up Animation UI control class.
       
    30 *  Draws animation centered to the control.
       
    31 *
       
    32 *  @lib sanimctrl.lib
       
    33 *  @since S60 3.2
       
    34 */
       
    35 class CSAnimCtrl : public CCoeControl, public MSAnimObserver
       
    36     {
       
    37 
       
    38 public:
       
    39 
       
    40     /**
       
    41     * Constructs a CSAnimCtrl object.
       
    42     *
       
    43     * @since S60 3.2
       
    44     *
       
    45     * @param aRect Rectangle designated for the control.
       
    46     * @param aContainer The compound control that is the container for this control.
       
    47     * @return The new object
       
    48     */
       
    49     IMPORT_C static CSAnimCtrl* NewL(
       
    50         const TRect& aRect,
       
    51         const CCoeControl& aContainer );
       
    52 
       
    53     /**
       
    54     * Destructor.
       
    55     *
       
    56     * @since S60 3.2
       
    57     */
       
    58     virtual ~CSAnimCtrl();
       
    59 
       
    60     /**
       
    61     * Load the parts of the show (image/animation and/or tone) from file(s).
       
    62     * Completes immediately with KErrNone if the show has no parts.
       
    63     *
       
    64     * @since S60 3.2
       
    65     *
       
    66     * @param aImageFileName Identifies the image file to use.
       
    67     * @param aFrameDelay Frame delay to use.
       
    68     * @param aScalingEnabled Identifies whether to try to scale the image to fit
       
    69     * the screen size or just use the target size of the animation as it is.
       
    70     * @param aAnimRepeatCount How many times to repeat the animation.
       
    71     * Zero indicates infinite.
       
    72     * @param aToneFileName Identifies the tone file to use.
       
    73     * @param aVolume Volume level to use.
       
    74     * @param aVolumeRamp Volume ramp: the period over which the volume level is
       
    75     * to rise smoothly from nothing to the normal volume level.
       
    76     * @param aToneRepeatCount How many times to repeat the tone.
       
    77     * @param aStatus Request to complete when loading is complete.
       
    78     */
       
    79     virtual void Load(
       
    80         const TDesC& aImageFileName,
       
    81         const TTimeIntervalMicroSeconds32& aFrameDelay,
       
    82         const TBool aScalingEnabled,
       
    83         const TInt aAnimRepeatCount,
       
    84         const TDesC& aToneFileName,
       
    85         const TInt aVolume,
       
    86         const TTimeIntervalMicroSeconds& aVolumeRamp,
       
    87         const TInt aToneRepeatCount,
       
    88         TRequestStatus& aStatus );
       
    89 
       
    90     /**
       
    91     * Start the show (image/animation and/or tone).
       
    92     * Completes immediately with KErrNone if the show has no parts.
       
    93     *
       
    94     * @since S60 3.2
       
    95     *
       
    96     * @param aStatus Request to complete when all parts of the show have
       
    97     * finished.
       
    98     */
       
    99     virtual void Start( TRequestStatus& aStatus );
       
   100 
       
   101     /**
       
   102     * Cancel activity.
       
   103     *
       
   104     * @since S60 3.2
       
   105     */
       
   106     virtual void Cancel();
       
   107 
       
   108     /**
       
   109     * Clear drawing data.
       
   110     *
       
   111     * @since S60 3.2
       
   112     */
       
   113     virtual void Clear();
       
   114 
       
   115 protected:
       
   116 
       
   117     /**
       
   118     * From CCoeControl.
       
   119     *
       
   120     * @since S60 3.2
       
   121     *
       
   122     * @return The number of controls contained in this control.
       
   123     */
       
   124     virtual TInt CountComponentControls() const;
       
   125 
       
   126     /**
       
   127     * From CCoeControl.
       
   128     *
       
   129     * @since S60 3.2
       
   130     *
       
   131     * @param aIndex Identifies the component control to return.
       
   132     * @return The component control at index given as parameter.
       
   133     */
       
   134     virtual CCoeControl* ComponentControl( TInt aIndex ) const;
       
   135 
       
   136     /**
       
   137     * From CCoeControl.
       
   138     *
       
   139     * @since S60 3.2
       
   140     *
       
   141     * @param aRect The rectangle to draw into.
       
   142     */
       
   143     virtual void Draw( const TRect& aRect ) const;
       
   144 
       
   145     /**
       
   146     * Draw an animation frame on the screen with a mask.
       
   147     * From MSAnimObserver.
       
   148     *
       
   149     * @since S60 3.2
       
   150     *
       
   151     * @param aFrame Contains the animation frame to draw on the screen.
       
   152     * @param aMask Contains mask for the animation frame to draw on the screen.
       
   153     */
       
   154     virtual void UpdateScreen( const CFbsBitmap& aFrame, const CFbsBitmap& aMask );
       
   155 
       
   156     /**
       
   157     * Draw an animation frame on the screen without a mask.
       
   158     * From MSAnimObserver.
       
   159     *
       
   160     * @since S60 3.2
       
   161     *
       
   162     * @param aFrame Contains the animation frame to draw on the screen.
       
   163     */
       
   164     virtual void UpdateScreen( const CFbsBitmap& aFrame );
       
   165 
       
   166 protected:
       
   167 
       
   168     /**
       
   169     * First phase constructor.
       
   170     *
       
   171     * @since S60 3.2
       
   172     */
       
   173     IMPORT_C CSAnimCtrl();
       
   174 
       
   175     /**
       
   176     * Second phase constructor for derived classes.
       
   177     *
       
   178     * @since S60 3.2
       
   179     *
       
   180     * @param aRect Rectangle designated for the control.
       
   181     * @param aContainer The compound control that is the container for this control.
       
   182     */
       
   183     IMPORT_C void BaseConstructL(
       
   184         const TRect& aRect,
       
   185         const CCoeControl& aContainer );
       
   186 
       
   187 private:
       
   188 
       
   189     /** Copy constructor. */
       
   190     CSAnimCtrl( const CSAnimCtrl& );
       
   191     /** Assignment operator. */
       
   192     CSAnimCtrl& operator=( const CSAnimCtrl& );
       
   193 
       
   194 protected: // data
       
   195 
       
   196     /** Start-up Animation engine. Owned. May not be NULL. */
       
   197     CSAnimEngine* iEngine;
       
   198 
       
   199     /** Bitmap to draw next. Not owned. May be NULL. */
       
   200     const CFbsBitmap* iImage;
       
   201 
       
   202     /** Mask for the bitmap to draw next. Not owned. May be NULL. */
       
   203     const CFbsBitmap* iMask;
       
   204 
       
   205     /** Background colour to use when drawing. */
       
   206     TRgb iBackgroundColour;
       
   207 
       
   208 private: // data
       
   209 
       
   210     TAny* iReserved1; /** Reserved for future use. */
       
   211     TAny* iReserved2; /** Reserved for future use. */
       
   212     TInt iReserved3; /** Reserved for future use. */
       
   213     TInt iReserved4; /** Reserved for future use. */
       
   214 
       
   215     };
       
   216 
       
   217 #endif // SANIMCTRL_H