inc/musindicatorapi.h
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     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:  Provides means for confirmation query and availability
       
    15                  indications.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_MUSINDICATORAPI_H
       
    22 #define C_MUSINDICATORAPI_H
       
    23 
       
    24 
       
    25 #include "musindicatorobserver.h"
       
    26 #include "musunittesting.h"
       
    27 #include "mussoundplayerobserver.h"
       
    28 #include <e32base.h>
       
    29 #include <e32property.h>
       
    30 
       
    31 
       
    32 class CMusIndicatorDsa;
       
    33 class CAknGlobalMsgQuery;
       
    34 class CMusSoundPlayer;
       
    35 
       
    36 
       
    37 /**
       
    38  *  MusIndicatorApi provides means to indicate availability
       
    39  *  of videosharing to user.
       
    40  *  @lib musindicator.lib
       
    41  */
       
    42 class CMusIndicatorApi : public CActive, MMusSoundPlayerObserver
       
    43     {
       
    44 
       
    45 public:
       
    46 
       
    47     /**  Different notes */
       
    48     enum TVsPopupQuery
       
    49         {
       
    50         EVsRoamingActivationQuery /**
       
    51                                    * Displays a query prompting for
       
    52                                    * activation of VS when roaming.
       
    53                                    */
       
    54         };
       
    55 
       
    56     /**
       
    57      * Two-phased constructor.
       
    58      *
       
    59      * @param aObserver Reference to observer interface.
       
    60      * return Pointer to newly created instance of CMusIndicatorApi.
       
    61      */
       
    62     IMPORT_C static CMusIndicatorApi* NewL(
       
    63         MMusIndicatorObserver& aObserver );
       
    64 
       
    65     /**
       
    66      * Two-phased constructor.
       
    67      *
       
    68      * @param aObserver Reference to observer interface.
       
    69      * return Pointer to newly created instance of CMusIndicatorApi.
       
    70      */
       
    71     IMPORT_C static CMusIndicatorApi* NewLC(
       
    72         MMusIndicatorObserver& aObserver );
       
    73         
       
    74 
       
    75     /**
       
    76      * Two-phased constructor.
       
    77      *
       
    78      * return Pointer to newly created instance of CMusIndicatorApi.
       
    79      */
       
    80     IMPORT_C static CMusIndicatorApi* NewL();
       
    81 
       
    82     /**
       
    83      * Destructor.
       
    84      */
       
    85     ~CMusIndicatorApi();
       
    86 
       
    87     /**
       
    88      * Indicates availability of video sharing.
       
    89      */
       
    90     IMPORT_C void IndicateAvailabilityL();
       
    91 
       
    92 protected:
       
    93 
       
    94 // from base class CActive.
       
    95 
       
    96     /**
       
    97      * From CActive.
       
    98      * Handles completion of an outstanding asynchronous request.
       
    99      */
       
   100     virtual void RunL();
       
   101 
       
   102     /**
       
   103      * From CActive.
       
   104      * Cancels an outstanding asynchronous request.
       
   105      */
       
   106     virtual void DoCancel();
       
   107 
       
   108     /**
       
   109      * From CActive.
       
   110      * Handles a leave occurring in the request completion event handler RunL.
       
   111      *
       
   112      * @param aError Error code of occured leave.
       
   113      */
       
   114     virtual TInt RunError( TInt aError );
       
   115 
       
   116 // from base class MMusSoundPlayerObserver.
       
   117 
       
   118     /**
       
   119      * From MMusSoundPlayerObserver.
       
   120      * Notifies of sound playing complete.
       
   121      *
       
   122      * @param aError Errorcode associated with playback.
       
   123      */
       
   124     virtual void PlaySoundComplete( TInt aError );
       
   125 
       
   126 private:
       
   127 
       
   128     CMusIndicatorApi( MMusIndicatorObserver* aObserver );
       
   129 
       
   130     void ConstructL();
       
   131 
       
   132 	 /**
       
   133      * Indicating availability of VS.
       
   134      *
       
   135      * @param aShown ETrue set indicator on and EFalse to Indicator off.
       
   136      */
       
   137 	void Indicator( TBool aShown );
       
   138 	
       
   139     /**
       
   140      * Plays indication tone.
       
   141      */
       
   142     void PlayToneL();
       
   143 
       
   144     void StartLiveSharingL();
       
   145     void ToggleIndicatorL();
       
   146     TBool IsSubscriber() const;
       
   147     
       
   148         
       
   149 private: // data
       
   150 
       
   151     /**
       
   152      * Pointer to indicator window
       
   153      * Own.
       
   154      */
       
   155     CMusIndicatorDsa* iIndicatorWindow;
       
   156 
       
   157     /**
       
   158      * Sound player.
       
   159      * Own.
       
   160      */
       
   161     CMusSoundPlayer* iSoundPlayer;
       
   162 
       
   163     /**
       
   164      * Reference to observer interface.
       
   165      * Own.
       
   166      */
       
   167     MMusIndicatorObserver* iObserver;
       
   168     
       
   169     RProperty iProperty;
       
   170             
       
   171     MUS_UNITTEST( UT_CMusIndicatorApi )
       
   172 
       
   173     };
       
   174 
       
   175 #endif // C_MUSINDICATORAPI_H