startupservices/Startup/inc/StartupUserWelcomeNote.h
branchRCL_3
changeset 20 c2c61fdca848
parent 0 2e3d3ce01487
equal deleted inserted replaced
19:924385140d98 20:c2c61fdca848
       
     1 /*
       
     2 * Copyright (c) 2002 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:  
       
    15 *           This class is the container class of the CStartupUerWelcomeNote.
       
    16 *           It is used for showing user defined image or text.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef STARTUPUSERWELCOMENOTE_H
       
    22 #define STARTUPUSERWELCOMENOTE_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <coecntrl.h>
       
    26 #include "startup.hrh"
       
    27 #include "startupdomaincrkeys.h"
       
    28 
       
    29 // CONSTANTS
       
    30 const TInt KStartupTBufMaxLength( 100 );
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    34 class CStartupView;
       
    35 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    36 class CStartupModel;
       
    37 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    38 class CStartupAppUi;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 *  This class takes care of showing user welcome note to the user.
       
    44 *  User welcome note type can be predefined default animation,
       
    45 *  user defined image or text.
       
    46 */
       
    47 class CStartupUserWelcomeNote
       
    48   : public CCoeControl
       
    49 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    50   , MCoeControlObserver
       
    51 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    52     {
       
    53     public:  // Constructors and destructor
       
    54 
       
    55 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    56         /**
       
    57         * Two-phased constructor.
       
    58         *
       
    59         * @param aView The compound control that is the container for this
       
    60         * control.
       
    61         */
       
    62         static CStartupUserWelcomeNote* NewL(
       
    63             CStartupAppUi& aStartupAppUi,
       
    64             const TRect& aRect,
       
    65             CStartupView& aView );
       
    66 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    67         /**
       
    68         *  C++ default constructor.
       
    69         */
       
    70         CStartupUserWelcomeNote( CStartupAppUi& aStartupAppUi );
       
    71 
       
    72         /**
       
    73         * Two-phased constructor.
       
    74         */
       
    75         static CStartupUserWelcomeNote* NewL( CStartupAppUi& aStartupAppUi, const TRect& aRect);
       
    76 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    77 
       
    78         /**
       
    79         *  Destructor
       
    80         */
       
    81         ~CStartupUserWelcomeNote();
       
    82 
       
    83         /**
       
    84         *  Returns the information about the type of 
       
    85         *  the selected welcome note. This also consider
       
    86         *  the product variant types of welcome note.
       
    87         *  Return type can be animation, text or image.
       
    88         */
       
    89         TStartupNoteTypeInformation NoteTypeInformation();
       
    90 
       
    91 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
    92         /**
       
    93         *  This handles the key events in this control.
       
    94         */
       
    95         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
    96 
       
    97         /**
       
    98         *  This cancels iNoteCancelTimer
       
    99         */
       
   100         void CancelNoteCancelTimer();
       
   101 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   102 
       
   103         /**
       
   104         *  This function performs the actual user welcome note showing.
       
   105         */
       
   106         void StartL();
       
   107 
       
   108 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   109         /**
       
   110         *  Update screen with white bitmap.
       
   111         */
       
   112         void DrawBlankScreen() const;
       
   113 
       
   114         /**
       
   115         *  EPOC default constructor
       
   116         */
       
   117         void ConstructL(const TRect& aRect);
       
   118 
       
   119         /**
       
   120         *  Sets the iUserWelcomeNoteShowing member value
       
   121         *  @return   void
       
   122         */
       
   123         void SetUserWelcomeNoteShowing(TBool aValue);
       
   124 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   125 
       
   126     private:
       
   127         
       
   128         /**
       
   129         *  Returns the component specified by aIndex parameter.
       
   130         */
       
   131         CCoeControl* ComponentControl(TInt aIndex) const;
       
   132 
       
   133 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   134         /**
       
   135         *  Handles the event of the control.
       
   136         */
       
   137         void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
       
   138 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   139 
       
   140         /**
       
   141         *  Loads the data about selected welcome note info from the Cental Repository.
       
   142         */
       
   143         TInt GetUserWelcomeNoteTypeInfo();
       
   144 
       
   145         /**
       
   146         *  Shows the text type of user welcome note.
       
   147         */
       
   148         void ShowInformationNoteWrapperL();
       
   149 
       
   150         /**
       
   151         *  Returns information about the selected user welcome note type.
       
   152         *  Text, image or default(no note).
       
   153         */
       
   154         TStartupWelcomeNoteType UserWelcomeNoteType();
       
   155 
       
   156         /**
       
   157         *  Draws a image type of welcome note to the center of 
       
   158         *  the screen. Both user selected image and operator
       
   159         *  image as a product variant feature.
       
   160         */
       
   161         void DrawImageWelcomeNote();
       
   162 
       
   163         TInt CheckImage( const TDesC& aPath);
       
   164 
       
   165 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   166     private:
       
   167 
       
   168         /**
       
   169         *  C++ default constructor.
       
   170         *
       
   171         * @param aView The compound control that is the container for this
       
   172         * control.
       
   173         */
       
   174         CStartupUserWelcomeNote( CStartupAppUi& aStartupAppUi, CStartupView& aView );
       
   175 
       
   176         /**
       
   177         * Second phase constructor.
       
   178         */
       
   179         void ConstructL( const TRect& aRect );
       
   180 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   181 
       
   182     private: // Data
       
   183 
       
   184 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   185         /** Parent control for the animation control(s). */
       
   186         CStartupView& iView;
       
   187 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   188 
       
   189         //Used for showing user selected image
       
   190         CFbsBitmap* iBitmap; //owns
       
   191         
       
   192         //contains the type information of the user welcome note as selected from
       
   193         //General Settings (variant information doesn't include in this)
       
   194         TStartupWelcomeNoteType iNoteType;
       
   195 
       
   196         //contains the possible variation information of the default user welcome note
       
   197         TStartupUserWelcomeNoteDefaultVariationType iNoteDefaultVariationType;
       
   198 
       
   199         //is used for storing image path information
       
   200         TBuf<KStartupTBufMaxLength> iNotePath;
       
   201 
       
   202         //is used for storing text note information
       
   203         TBuf<KStartupTBufMaxLength> iNoteText;
       
   204 
       
   205         //is used for storing image path information
       
   206         TBuf<KStartupTBufMaxLength> iNoteOperPath;
       
   207 
       
   208         //is used for storing text note information
       
   209         TBuf<KStartupTBufMaxLength> iNoteOperText;
       
   210 
       
   211 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   212         //stores the information about the execution state
       
   213         //of the application. This information is used
       
   214         //in drawing properly in current situation.
       
   215         TStartupDrawInfo iDrawUpdateInfo;
       
   216 
       
   217         //is uded for guarantee that RStarterSession is made
       
   218         //and used only once when RemoveSplashScreen is called.
       
   219         //In other words it is used for preventing needless work...
       
   220         TBool iSplashScreenRemoved;
       
   221 
       
   222         //is used in redrawing in various execution phases (DoDrawingL()-function)
       
   223         TStartupNoteTypeInformation iWelcomeNoteType;
       
   224 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   225 
       
   226         //is used when user cancels the welcome note showing by
       
   227         //pressing any key. 
       
   228         CStartupAppUi& iStartupAppUi; //uses
       
   229 
       
   230 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   231         //is used when user cancels the welcome note showing by
       
   232         //pressing any key. The reason for using callback in OfferKeyEvent()
       
   233         //guarantees that EKeyWasConsumed is returned properly before application
       
   234         //continues the tight execution.
       
   235         CPeriodic* iNoteCancelTimer; //owns
       
   236 
       
   237         //used for telling when the UWN is showing
       
   238         TBool iUserWelcomeNoteShowing;
       
   239 
       
   240         //used for telling if UWN is cancelled by user.
       
   241         TBool iUserWelcomeNoteCancelled;
       
   242 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
       
   243     };
       
   244 
       
   245 #endif      // STARTUPUSERWELCOMENOTE_H
       
   246             
       
   247 // End of File