mmsharing/mmshengine/tsrc/ut_engine/inc/musengstubs.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
    18 
    18 
    19 
    19 
    20 #ifndef UT_MUSSTUBS_H
    20 #ifndef UT_MUSSTUBS_H
    21 #define UT_MUSSTUBS_H
    21 #define UT_MUSSTUBS_H
    22 
    22 
       
    23 
       
    24 #include "musengsessionobserver.h"
       
    25 #include "musengoutsessionobserver.h"
       
    26 #include "musenglivesessionobserver.h"
       
    27 #include "musengclipsessionobserver.h"
       
    28 #include "musengreceivesessionobserver.h"
    23 #include "musengsessiondurationtimerobserver.h"
    29 #include "musengsessiondurationtimerobserver.h"
    24 #include "musengaudioroutingobserver.h"
    30 #include "musengaudioroutingobserver.h"
    25 #include "musengdisplayhandler.h"
    31 #include "musengvolumechangeobserver.h"
    26 #include "mussipprofileuser.h"
    32 
    27 #include "muspropertyobserver.h"
       
    28 
       
    29 #include <lcsessionobserver.h>
       
    30 #include <lcuiprovider.h>
       
    31 #include <lcwindow.h>
       
    32 #include <lcaudiocontrol.h>
       
    33 #include <e32base.h>
    33 #include <e32base.h>
    34 #include <ecom.h>
       
    35 
    34 
    36 // DUMMY CLASSES
    35 // DUMMY CLASSES
    37 
    36 
    38 class CSIPTransactionBase
    37 class CSIPTransactionBase
    39     {
    38     {
    66 /**
    65 /**
    67 * Class to implement all the interfaces provided by MusEngine
    66 * Class to implement all the interfaces provided by MusEngine
    68 */        
    67 */        
    69 class CMusEngObserverStub : public CBase, 
    68 class CMusEngObserverStub : public CBase, 
    70                             public MMusEngSessionDurationTimerObserver,
    69                             public MMusEngSessionDurationTimerObserver,
       
    70                             public MMusEngSessionObserver,
       
    71                             public MMusEngOutSessionObserver,
       
    72                             public MMusEngLiveSessionObserver,
       
    73                             public MMusEngClipSessionObserver,
       
    74                             public MMusEngReceiveSessionObserver,
    71                             public MMusEngAudioRoutingObserver,
    75                             public MMusEngAudioRoutingObserver,
    72                             public MMusSipProfileUser
    76                             public MMusEngVolumeChangeObserver
    73     {
    77     {
    74     public: // Constructors and destructor
    78     
       
    79     public:
    75 
    80 
    76         CMusEngObserverStub();
    81         CMusEngObserverStub();
       
    82             
    77         ~CMusEngObserverStub();
    83         ~CMusEngObserverStub();
    78 
    84         
    79     public: // From MMusEngSessionDurationTimerObserver
    85         // From MMusEngSessionDurationTimerObserver
    80     
    86         
    81         void UpdateTimerEvent();        
    87         void UpdateTimerEvent();
    82         
    88         
    83     public: // From MMusEngAudioRoutingObserver
    89         // From MMusEngSessionObserver
    84         
    90         
    85         void AudioRoutingChanged();
    91         void SessionEstablished();
    86         
    92         void SessionTerminated(); 
    87     public: // From MMusSipProfileUser    
    93         void SessionConnectionLost();
    88             
    94         void SessionFailed();
    89         TBool IsRoamingBetweenAPsAllowed();
    95         void StreamIdle();
    90         void ProfileRegistered();
    96         void StreamStreaming();
       
    97         void SessionTimeChanged( const TTimeIntervalSeconds& aSeconds );
       
    98         void InactivityTimeout();
       
    99 
       
   100 
       
   101         // From MMusEngOutSessionObserver
       
   102 
       
   103         void SessionRejected();
       
   104     	void SessionBadRequest(); // 400 
       
   105     	void SessionUnauthorized(); // 401 
       
   106     	void SessionPaymentRequired(); // 402
       
   107     	void SessionRecipientNotFound(); // 404 
       
   108     	void SessionProxyAuthenticationRequired(); // 407
       
   109     	void SessionRequestTimeOut(); // 408
       
   110     	void SessionUnsupportedMediaType(); // 415
       
   111     	void SessionBusyHere(); // 486
       
   112     	void SessionRequestCancelled(); // 487 
       
   113     	void SessionTemporarilyNotAvailable(); // 480
       
   114 
       
   115         // From MMusEngLiveSessionObserver
       
   116         
       
   117         void DiskFull();
       
   118         void OrientationRefreshEnded();
       
   119         
       
   120         // From MMusEngClipSessionObserver    
       
   121         
       
   122         void EndOfClip(); 
       
   123         
       
   124         void TranscodingNeeded(TBool aDueUnknowCapas);
       
   125         
       
   126         void TranscodingProgressed( TInt aPercentage );     
       
   127 
       
   128         void TranscodingCompletedInit();
       
   129 
       
   130         void TranscodingCompletedFinalize();
       
   131 
       
   132         void TranscodingFailed();
       
   133         
       
   134         void RewindFromEndL();
       
   135 
       
   136 
       
   137         // From MMusEngReceiveSessionObserver    
       
   138         
       
   139         void IncomingSessionPreNotification();
       
   140 
       
   141         void IncomingSession( const TDesC& aOriginator, 
       
   142                               const TDesC& aOriginatorIdentity );
       
   143         
       
   144         void StreamBuffering();
       
   145     
       
   146     
       
   147         // From MMusEngAudioRoutingObserver
       
   148         
       
   149         void AudioRoutingChanged( TBool aShowNote );
       
   150         
       
   151         TBool AudioRouteChangeAllowed() const;
       
   152         
       
   153         // From MMusEngVolumeChangeObserver
       
   154         void VolumeChanged( TInt aVolume, TBool aAudioRouteChanged );
    91         
   155         
    92     public: // Helper
   156     public: // Helper
    93     
   157     
    94         /**
   158         /**
    95         * ETrue if all boolean member variables are set to EFalse and all the
   159         * ETrue if all boolean member variables are set to EFalse and all the
   104         void Reset();
   168         void Reset();
   105 
   169 
   106     public: // Data  
   170     public: // Data  
   107         
   171         
   108         TBool iUpdateTimerEventCalled;
   172         TBool iUpdateTimerEventCalled;
   109         TBool iAudioRoutingChangedCalled;       
   173         
   110         TBool iRoamingBetweenAPsAllowed;
   174         TBool iSessionEstablishedCalled;
   111         TBool iProfileRegisteredCalled;
   175         TBool iSessionTerminatedCalled;
   112     };
   176         TBool iSessionConnectionLostCalled;
   113 
   177         TBool iSessionFailedCalled;
   114 class TMusEngDisplayHandlerStub : public MMusEngDisplayHandler
   178         TBool iStreamIdleCalled;
   115     {
   179         TBool iStreamStreamingCalled;
   116 public:
   180         TBool iSessionTimeChangedCalled;
   117     
   181         TBool iInactivityTimeoutCalled;
   118     TMusEngDisplayHandlerStub();
   182         
   119     
   183         TBool iSessionRejectedCalled;
   120     void Reset();
   184     	TBool iSessionBadRequestCalled;
   121     
   185     	TBool iSessionUnauthorizedCalled;
   122 public: // From MMusEngDisplayHandler
   186     	TBool iSessionPaymentRequiredCalled;
   123     
   187     	TBool iSessionRecipientNotFoundCalled;
   124     TRect Rect() const;
   188     	TBool iSessionProxyAuthenticationRequiredCalled;
   125 
   189     	TBool iSessionRequestTimeOutCalled;
   126     void SetRectL( const TRect& aRect );
   190     	TBool iSessionUnsupportedMediaTypeCalled;
   127             
   191     	TBool iSessionBusyHereCalled;
   128     void SetSecondaryRectL( const TRect& aSecondaryRect );
   192     	TBool iSessionRequestCancelledCalled;
   129             
   193     	TBool iDiskFullCalled;
   130     TRect SecondaryRect() const;
   194     	
   131             
   195     	TBool iEndOfClipCalled;
   132     void EnableDisplayL( TBool aEnable );
   196     	TBool iRewindFromEnd;
   133             
   197     	TBool iTranscodingNeededCalled;
   134     TBool IsDisplayEnabled();
   198     	TBool iTranscodingCompletedInitCalled;
   135             
   199     	TBool iTranscodingCompletedFinalizeCalled;
   136     TDisplayOrientation OrientationL();
   200     	TBool iTranscodingFailedCalled;
   137             
   201     	
   138     void SetOrientationL( TDisplayOrientation aOrientation );
   202     	TBool iIncomingSessionPreNotificationCalled;
   139             
   203         TBool iIncomingSessionCalled;
   140     TBool IsDisplayActive();
   204         TBool iStreamBufferingCalled;
   141 
   205         
   142 public:
   206         TBool iAudioRoutingChangedCalled;
   143     
   207         TBool iShowNote;
   144     TRect iRect;
   208         TBool iAudioRouteChangeAllowed;
   145     TRect iSecondaryRect;
   209         
   146     TBool iIsEnabled;
   210         TInt iTranscodingProgressedPercentage;
   147     TDisplayOrientation iOrientation;
   211         TBool iSessionTemporarilyNotAvailable;
   148     TBool iIsActive;
   212         HBufC* iIncomingSessionOriginator;
   149     };
   213         
   150 
       
   151 class CLcSessionObserverStub : public CBase, public MLcSessionObserver
       
   152     {
       
   153     public: // Constructors and destructor
       
   154 
       
   155         CLcSessionObserverStub();
       
   156         ~CLcSessionObserverStub();
       
   157         
       
   158     public: // From MLcSessionObserver
       
   159         
       
   160         void StateChanged( MLcSession& aSession );
       
   161     
       
   162         void StateChanged( MLcVideoPlayer& aPlayer );
       
   163     
       
   164         void Updated( MLcSession& aSession );
       
   165 
       
   166         void Updated( MLcVideoPlayer& aPlayer );
       
   167     
       
   168         void Failed( 
       
   169             MLcSession& aSession,
       
   170             TInt aError );
       
   171     
       
   172         void Failed( 
       
   173             MLcVideoPlayer& aPlayer, 
       
   174             TInt aError );
       
   175     
       
   176         void SessionTimeChanged( 
       
   177             MLcSession& aSession,
       
   178             const TTimeIntervalSeconds& aSeconds );
       
   179 
       
   180     public: // New functions
       
   181         
       
   182         void Reset();    
       
   183         TBool IsReseted();
       
   184         
       
   185     public: // Data
       
   186         
       
   187         enum TCalledFunction
       
   188             {
       
   189             EUnknown,
       
   190             ESessionStateChanged,
       
   191             EPlayerStateChanged,
       
   192             ESessionUpdated,
       
   193             EPlayerUpdated,
       
   194             ESessionFailed,
       
   195             EPlayerFailed,
       
   196             ESessionTimeChanged
       
   197             };  
       
   198         
       
   199         TInt iCalledFunction;
       
   200         MLcSession* iCurrentSession;
       
   201         MLcVideoPlayer* iCurrentPlayer;
       
   202         TInt iSessionTime;
       
   203         TInt iError;
       
   204     }; 
       
   205 
       
   206 
       
   207 class CLcUiProviderStub : public CBase, public MLcUiProvider
       
   208     {
       
   209     public: // Constructors and destructor
       
   210 
       
   211         CLcUiProviderStub();
       
   212         ~CLcUiProviderStub();
       
   213         
       
   214     public: // From MLcUiProvider
       
   215         
       
   216         TBool SelectRecipient( 
       
   217             MDesCArray& aRecipientAddresses, 
       
   218             TDes& aSelectedRecipientAddress );        
       
   219         
       
   220         TBool InputRecipient( TDes& aRecipientAddress );
       
   221         
       
   222         void HandleForegroundStatus( TBool aForeground );
       
   223         
       
   224         void BlockUi( TBool aBlocked );
       
   225         
       
   226     public: // New functions
       
   227         
       
   228         void Reset();
       
   229         
       
   230     public: // Data
       
   231         
       
   232         enum TCalledFunction
       
   233             {
       
   234             EUnknown,
       
   235             ESelectRecipient,
       
   236             EInputRecipient,
       
   237             EHandleForegroundStatus
       
   238             };  
       
   239         
       
   240         TInt iForeground;
       
   241         TInt iCalledFunction;
       
   242         TPtrC iRecipient;
       
   243         TBool iSimulatedReturnValue;     
       
   244     };
       
   245 
       
   246 
       
   247 class TLcWindowStub : public MLcWindow
       
   248     {
       
   249     public: // Constructor     
       
   250         TLcWindowStub();
       
   251     
       
   252     public: // From MLcWindow      
       
   253         void EnableLcWindowL( TBool aEnable );
       
   254         TBool IsLcWindowEnabled();    
       
   255         void SetLcWindowRectL( TRect aRect );
       
   256         TRect LcWindowRect();
       
   257         void SetLcWindowOrientationL( TLcWindowOrientation aOrientation );
       
   258         TLcWindowOrientation LcWindowOrientationL();
       
   259         
       
   260     public: // New functions
       
   261         
       
   262         void Reset();
       
   263         
       
   264     private: // Data
       
   265         TBool iEnabled;
       
   266         TRect iRect;
       
   267         TLcWindowOrientation iOrientation;
       
   268     };
       
   269 
       
   270 
       
   271 class TLcAudioControlStub : public MLcAudioControl
       
   272     {
       
   273     public: // Constructor
       
   274         TLcAudioControlStub();    
       
   275     
       
   276     public:
       
   277         TBool IsLcAudioMutedL();
       
   278         void MuteLcAudioL( TBool aMute );       
       
   279         TBool IsLcMicMutedL();    
       
   280         void MuteLcMicL( TBool aMute );
       
   281         TBool IsEnablingLcLoudspeakerAllowed();   
       
   282         void EnableLcLoudspeakerL( TBool aEnabled );
       
   283         TBool IsLcLoudspeakerEnabled();
       
   284         TInt LcVolumeL();
       
   285         void SetLcVolumeL( TInt aValue );    
       
   286         void IncreaseLcVolumeL();
       
   287         void DecreaseLcVolumeL();
       
   288  
       
   289     public: // New functions
       
   290         
       
   291         void Reset();        
       
   292         
       
   293     private: // Data      
       
   294         TBool iAudioMuted;
       
   295         TBool iMicMuted;
       
   296         TBool iEnablingLoudspeakerAllowed;
       
   297         TBool iLoudspeakerEnabled;
       
   298         TInt iVolume;
   214         TInt iVolume;
   299     };
   215         TBool iDueUnknowCapas;
   300 
   216         TBool iOrientationRefreshEndedCalled;
   301 class TMusPropertyObserverStub : public MMusPropertyObserver
       
   302     {
       
   303     public:
       
   304     
       
   305         enum TMusPropertyObserverFunction
       
   306             {
       
   307             ENone, // default value
       
   308             EPropertyChanged,
       
   309             EHandlePropertyError
       
   310             };
       
   311 
       
   312     
       
   313         TMusPropertyObserverStub()
       
   314             {
       
   315             iCalledFunction = ENone;
       
   316             iKey = 0;
       
   317             iValue = 0;
       
   318             iReason = 0;
       
   319             }
       
   320     
       
   321         void PropertyChanged( const TUint aKey, const TInt aValue )
       
   322             {
       
   323             iCalledFunction = EPropertyChanged;
       
   324             iKey = aKey;
       
   325             iValue = aValue;
       
   326             }
       
   327 
       
   328 
       
   329         void HandlePropertyError( const TInt aReason )
       
   330             {
       
   331             iCalledFunction = EHandlePropertyError;
       
   332             iReason = aReason;
       
   333             }
       
   334 
       
   335     public: // data
       
   336 
       
   337         TMusPropertyObserverFunction iCalledFunction;
       
   338         TInt iKey;
       
   339         TInt iValue;
       
   340         TInt iReason;
       
   341     };
   217     };
   342 
   218 
   343 
   219 
   344 // Dummy implementations
   220 // Dummy implementations
   345 inline void CActiveScheduler::Start()
   221 inline void CActiveScheduler::Start()