mmsharing/mmshengine/inc/musengsession.h
branchRCL_3
changeset 33 bc78a40cd63c
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
       
     1 /*
       
     2 * Copyright (c) 2005 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MUSENGSESSION_H
       
    20 #define MUSENGSESSION_H
       
    21 
       
    22 // USER INCLUDES
       
    23 #include "musunittesting.h"
       
    24 #include "musengvolumechangeobserver.h"
       
    25 
       
    26 //SYSTEM INCLUDES
       
    27 #include <e32base.h>
       
    28 
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CMusEngTelephoneUtils;
       
    32 class CMusSipProfileHandler;
       
    33 class CRepository;
       
    34 class MMusEngAudioRoutingObserver;
       
    35 class MMusEngVolumeChangeObserver;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 * Base class for Multimedia Sharing Engine sessions, inherited by
       
    41 * CMusEngMceSession.
       
    42 *
       
    43 * CMusEngSession encapsulates all common activities example using
       
    44 * resources.
       
    45 *
       
    46 * @lib musengine.lib
       
    47 */
       
    48 class CMusEngSession : public CBase,
       
    49                        public MMusEngVolumeChangeObserver
       
    50     {
       
    51     MUS_UNITTEST( UT_CMusEngSession )
       
    52     
       
    53     public:
       
    54 
       
    55         /**
       
    56         * Desctructor, finalize session
       
    57         *
       
    58         */
       
    59         ~CMusEngSession();
       
    60 
       
    61 
       
    62     public:  // API FUNCTIONS
       
    63 
       
    64         /**
       
    65         * Returns currently assigned drawing area
       
    66         *
       
    67         * @return TRect This session drawing area recttangle
       
    68         */
       
    69         IMPORT_C TRect Rect() const;
       
    70 
       
    71         /**
       
    72         * Sets new drawing area
       
    73         *
       
    74         * @param TRect This session new drawing area rectangle
       
    75         */
       
    76         IMPORT_C void SetRectL( const TRect& aRect );
       
    77 
       
    78         /**
       
    79         * Checks if audio routing can be changed using EnableLoudspeakerL
       
    80         * 
       
    81         * @return ETrue if audio routing can be changed using EnableLoudspeakerL
       
    82         */
       
    83         IMPORT_C TBool AudioRoutingCanBeChanged() const;
       
    84         
       
    85         /**
       
    86 		* Checks if audio routing is headset
       
    87 		* 
       
    88 		* @return ETrue if audio routing is headset
       
    89 		*/
       
    90         IMPORT_C TBool IsAudioRoutingHeadset() const;
       
    91 		
       
    92         /**
       
    93 		* Checks if audio routing is LoudSpeaker
       
    94 		* 
       
    95 		* @return ETrue if audio routing is LoudSpeaker and 
       
    96 		* currentMode != iAudioOutputAtStartup
       
    97 		*/
       
    98         IMPORT_C TBool IsAudioRoutingLoudSpeaker() const;
       
    99         /**
       
   100         * Activates/deactivates loadspeaker
       
   101         *
       
   102         * @param TBool Enable or disable loudspeaker
       
   103         * @param TBool Show activation dialog
       
   104         */
       
   105         IMPORT_C void EnableLoudspeakerL( TBool aEnable, TBool aShowDialog );
       
   106 
       
   107         /**
       
   108         * Checks is loudspeaker enabled or disabled.
       
   109         *
       
   110         * @return TBool true if enabled
       
   111         */
       
   112         IMPORT_C TBool IsLoudSpeakerEnabled() const;
       
   113 
       
   114         /**
       
   115         * Returns current volume level
       
   116         */
       
   117         IMPORT_C TInt VolumeL() const;
       
   118 
       
   119         /**
       
   120         * Mutes CS call microphone.
       
   121         */
       
   122         IMPORT_C void MuteMicL( TBool aMute );
       
   123 
       
   124         /**
       
   125         * Returns current CS call mic mute state.
       
   126         */
       
   127         IMPORT_C TBool IsMicMutedL();
       
   128         
       
   129         /**
       
   130         * Sets audio routing observer. Can be set to NULL in order to indicate
       
   131         * ending of observing changes in audio routing.
       
   132         */
       
   133         IMPORT_C void SetAudioRoutingObserver( 
       
   134                                     MMusEngAudioRoutingObserver* aObserver );
       
   135         
       
   136         /**
       
   137         * Sets volume level change observer. Can be set to NULL in order to indicate
       
   138         * ending of observing changes in volume level.
       
   139         */
       
   140         IMPORT_C void SetVolumeChangeObserver( 
       
   141                                     MMusEngVolumeChangeObserver* aObserver );
       
   142 
       
   143     public:  // VIRTUAL API FUNCTIONS
       
   144         
       
   145         /**
       
   146         * Increases volume level by one.
       
   147         */
       
   148         IMPORT_C virtual void VolumeUpL();
       
   149 
       
   150         /**
       
   151         * Decreases volume level by one.
       
   152         */
       
   153         IMPORT_C virtual void VolumeDownL();
       
   154         
       
   155         /**
       
   156         * Set volume value
       
   157         * @param aVal the value of volume 
       
   158         */
       
   159         IMPORT_C virtual void SetVolumeL( TInt aVal );
       
   160         
       
   161         /**
       
   162         * Enables or disables display. Call to this function is considered
       
   163         * as a permission or denial to draw to the display.
       
   164         */
       
   165         virtual void EnableDisplayL( TBool aEnable ) = 0;
       
   166 
       
   167         /**
       
   168         * Mutes current audio stream meaning that any audio is not played or
       
   169         * sent to network.
       
   170         */
       
   171         virtual void MuteL() = 0;
       
   172 
       
   173         /**
       
   174         * Unmute current audio stream meaning that all the audio is played
       
   175         * and if needed also sent to network.
       
   176         */
       
   177         virtual void UnmuteL() = 0;
       
   178         
       
   179         /**
       
   180          *
       
   181          */
       
   182         virtual void RefreshOrientationL() = 0;
       
   183 
       
   184 
       
   185 	protected: // INTERNAL 
       
   186 
       
   187         virtual void RectChangedL() = 0;
       
   188 
       
   189 
       
   190         //from MMusEngVolumeChangeObserver
       
   191         virtual void VolumeChanged( TInt aVolume, TBool aAudioRouteChanged );
       
   192         
       
   193     protected:
       
   194 
       
   195         /**
       
   196         * Constructor, private cannot be instantiate
       
   197         *
       
   198         * @param aRect reserved drawing area for this session
       
   199         */
       
   200         CMusEngSession( const TRect& aRect );
       
   201 
       
   202 
       
   203     protected:
       
   204 
       
   205         /**
       
   206         * second-phase constructor, called by those session specific 
       
   207         * constructors
       
   208         */
       
   209         void ConstructL();
       
   210 
       
   211 
       
   212     private: // MEMBERS
       
   213 
       
   214         /**
       
   215         * Drawing area rect.
       
   216         */
       
   217         TRect iRect;
       
   218 
       
   219         /**
       
   220         * Telephone utilities.
       
   221         */
       
   222         CMusEngTelephoneUtils* iTelephoneUtils;
       
   223         
       
   224         /**
       
   225         * Volume change observer
       
   226         */
       
   227         MMusEngVolumeChangeObserver* iVolumeObserver;
       
   228 
       
   229     };
       
   230 
       
   231 #endif //MUSENGSESSION_H