mmsharing/mmshengine/tsrc/ut_engine/inc/musengstubs.h
branchRCL_3
changeset 22 73a1feb507fb
parent 16 ce86b6d44a6d
child 23 bc78a40cd63c
equal deleted inserted replaced
21:33a5d2bbf6fc 22:73a1feb507fb
    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"
       
    29 #include "musengsessiondurationtimerobserver.h"
    23 #include "musengsessiondurationtimerobserver.h"
    30 #include "musengaudioroutingobserver.h"
    24 #include "musengaudioroutingobserver.h"
    31 #include "musengvolumechangeobserver.h"
    25 #include "musengdisplayhandler.h"
    32 
    26 #include "mussipprofileuser.h"
       
    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>
    34 
    35 
    35 // DUMMY CLASSES
    36 // DUMMY CLASSES
    36 
    37 
    37 class CSIPTransactionBase
    38 class CSIPTransactionBase
    38     {
    39     {
    65 /**
    66 /**
    66 * Class to implement all the interfaces provided by MusEngine
    67 * Class to implement all the interfaces provided by MusEngine
    67 */        
    68 */        
    68 class CMusEngObserverStub : public CBase, 
    69 class CMusEngObserverStub : public CBase, 
    69                             public MMusEngSessionDurationTimerObserver,
    70                             public MMusEngSessionDurationTimerObserver,
    70                             public MMusEngSessionObserver,
       
    71                             public MMusEngOutSessionObserver,
       
    72                             public MMusEngLiveSessionObserver,
       
    73                             public MMusEngClipSessionObserver,
       
    74                             public MMusEngReceiveSessionObserver,
       
    75                             public MMusEngAudioRoutingObserver,
    71                             public MMusEngAudioRoutingObserver,
    76                             public MMusEngVolumeChangeObserver
    72                             public MMusSipProfileUser
    77     {
    73     {
    78     
    74     public: // Constructors and destructor
    79     public:
       
    80 
    75 
    81         CMusEngObserverStub();
    76         CMusEngObserverStub();
    82             
       
    83         ~CMusEngObserverStub();
    77         ~CMusEngObserverStub();
    84         
    78 
    85         // From MMusEngSessionDurationTimerObserver
    79     public: // From MMusEngSessionDurationTimerObserver
    86         
    80     
    87         void UpdateTimerEvent();
    81         void UpdateTimerEvent();        
    88         
    82         
    89         // From MMusEngSessionObserver
    83     public: // From MMusEngAudioRoutingObserver
    90         
    84         
    91         void SessionEstablished();
    85         void AudioRoutingChanged();
    92         void SessionTerminated(); 
    86         
    93         void SessionConnectionLost();
    87     public: // From MMusSipProfileUser    
    94         void SessionFailed();
    88             
    95         void StreamIdle();
    89         TBool IsRoamingBetweenAPsAllowed();
    96         void StreamStreaming();
    90         void ProfileRegistered();
    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 );
       
   155         
    91         
   156     public: // Helper
    92     public: // Helper
   157     
    93     
   158         /**
    94         /**
   159         * ETrue if all boolean member variables are set to EFalse and all the
    95         * ETrue if all boolean member variables are set to EFalse and all the
   168         void Reset();
   104         void Reset();
   169 
   105 
   170     public: // Data  
   106     public: // Data  
   171         
   107         
   172         TBool iUpdateTimerEventCalled;
   108         TBool iUpdateTimerEventCalled;
   173         
   109         TBool iAudioRoutingChangedCalled;       
   174         TBool iSessionEstablishedCalled;
   110         TBool iRoamingBetweenAPsAllowed;
   175         TBool iSessionTerminatedCalled;
   111         TBool iProfileRegisteredCalled;
   176         TBool iSessionConnectionLostCalled;
   112     };
   177         TBool iSessionFailedCalled;
   113 
   178         TBool iStreamIdleCalled;
   114 class TMusEngDisplayHandlerStub : public MMusEngDisplayHandler
   179         TBool iStreamStreamingCalled;
   115     {
   180         TBool iSessionTimeChangedCalled;
   116 public:
   181         TBool iInactivityTimeoutCalled;
   117     
   182         
   118     TMusEngDisplayHandlerStub();
   183         TBool iSessionRejectedCalled;
   119     
   184     	TBool iSessionBadRequestCalled;
   120     void Reset();
   185     	TBool iSessionUnauthorizedCalled;
   121     
   186     	TBool iSessionPaymentRequiredCalled;
   122 public: // From MMusEngDisplayHandler
   187     	TBool iSessionRecipientNotFoundCalled;
   123     
   188     	TBool iSessionProxyAuthenticationRequiredCalled;
   124     TRect Rect() const;
   189     	TBool iSessionRequestTimeOutCalled;
   125 
   190     	TBool iSessionUnsupportedMediaTypeCalled;
   126     void SetRectL( const TRect& aRect );
   191     	TBool iSessionBusyHereCalled;
   127             
   192     	TBool iSessionRequestCancelledCalled;
   128     void SetSecondaryRectL( const TRect& aSecondaryRect );
   193     	TBool iDiskFullCalled;
   129             
   194     	
   130     TRect SecondaryRect() const;
   195     	TBool iEndOfClipCalled;
   131             
   196     	TBool iRewindFromEnd;
   132     void EnableDisplayL( TBool aEnable );
   197     	TBool iTranscodingNeededCalled;
   133             
   198     	TBool iTranscodingCompletedInitCalled;
   134     TBool IsDisplayEnabled();
   199     	TBool iTranscodingCompletedFinalizeCalled;
   135             
   200     	TBool iTranscodingFailedCalled;
   136     TDisplayOrientation OrientationL();
   201     	
   137             
   202     	TBool iIncomingSessionPreNotificationCalled;
   138     void SetOrientationL( TDisplayOrientation aOrientation );
   203         TBool iIncomingSessionCalled;
   139             
   204         TBool iStreamBufferingCalled;
   140     TBool IsDisplayActive();
   205         
   141 
   206         TBool iAudioRoutingChangedCalled;
   142 public:
   207         TBool iShowNote;
   143     
   208         TBool iAudioRouteChangeAllowed;
   144     TRect iRect;
   209         
   145     TRect iSecondaryRect;
   210         TInt iTranscodingProgressedPercentage;
   146     TBool iIsEnabled;
   211         TBool iSessionTemporarilyNotAvailable;
   147     TDisplayOrientation iOrientation;
   212         HBufC* iIncomingSessionOriginator;
   148     TBool iIsActive;
   213         
   149     };
       
   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;
   214         TInt iVolume;
   298         TInt iVolume;
   215         TBool iDueUnknowCapas;
   299     };
   216         TBool iOrientationRefreshEndedCalled;
   300 
       
   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;
   217     };
   341     };
   218 
   342 
   219 
   343 
   220 // Dummy implementations
   344 // Dummy implementations
   221 inline void CActiveScheduler::Start()
   345 inline void CActiveScheduler::Start()