mmsharing/mmshui/inc/musuieventcontroller.h
changeset 0 f0cf47e981f9
child 11 ff8a573c0e2e
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     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 MUSUIEVENTCONTROLLER_H
       
    20 #define MUSUIEVENTCONTROLLER_H
       
    21 
       
    22 #include "musuipropertyobserver.h"
       
    23 #include "musuicallbackobserver.h"
       
    24 #include "musuibitmapdecoderobserver.h"
       
    25 #include "musresourceproperties.h"
       
    26 #include "musuidefinitions.h"
       
    27 #include "musmanagercommon.h"
       
    28 #include "musuimmcobserver.h"
       
    29 #include "musunittesting.h"
       
    30 
       
    31 #include "musengsessionobserver.h"
       
    32 #include "musengaudioroutingobserver.h"
       
    33 
       
    34 #include <aknappui.h>        // CAknAppUiBase::TAppUiOrientation
       
    35 
       
    36 class CMusUiCallbackService;
       
    37 class MMusUiEventObserver;
       
    38 class CMusUiMmcMonitor;
       
    39 class CMusUiPropertyWatch;
       
    40 class CMusUiBitmapDecoder;
       
    41 class CFbsBitmap;
       
    42 class CMusEngMceSession;
       
    43 class MMusUiSharingObserver;
       
    44 class CMusUiActivityManager;
       
    45 class CMusUiResourceHandler;
       
    46 
       
    47 using namespace MultimediaSharing;
       
    48 
       
    49 
       
    50 /**
       
    51  *
       
    52  *
       
    53  * @lib musui.exe
       
    54  */
       
    55 class CMusUiEventController : public CBase, 
       
    56                               public MMusUiPropertyObserver, 
       
    57                               public MMusUiCallbackObserver,
       
    58                               public MMusUiMmcObserver,
       
    59                               public MMusEngSessionObserver,
       
    60                               public MMusEngAudioRoutingObserver
       
    61     {
       
    62 
       
    63 public: // enumerations
       
    64 
       
    65     enum TMusUiShutdownState
       
    66             {
       
    67             EMusUiShutdownNotDefined,
       
    68             EMusUiShutdownStarted,
       
    69             EMusUiShutdownVideoSaved,
       
    70             EMusUiShutdownContactSavingQueried,
       
    71             EMusUiShutdownOver
       
    72             };    
       
    73 
       
    74 
       
    75 public:
       
    76 
       
    77     /**
       
    78     * 
       
    79     */
       
    80 	virtual ~CMusUiEventController();
       
    81 
       
    82 	
       
    83 protected:
       
    84 
       
    85     /**
       
    86     * 
       
    87     */
       
    88 	void ConstructL();
       
    89 	
       
    90     /**
       
    91     * 
       
    92     */
       
    93 	CMusUiEventController( MMusUiEventObserver& aEventObserver,
       
    94 	                       MMusUiSharingObserver& aSharingObserver );
       
    95 
       
    96 
       
    97 public:	// From MMusUiPropertyObserver
       
    98 
       
    99     /**
       
   100     * Sets the property key value common to all sharing types.
       
   101     * To be overridden for specific key values.
       
   102     * CMusUiPropertyWatch calls MMusUiPropertyObserver::PropertyChanged,
       
   103     * when P&S key values change
       
   104     *
       
   105     * @param TUint aKey - The Property key
       
   106     * @param TInt aValue - The value of the Property key
       
   107     */
       
   108     virtual	void PropertyChanged( const TUint aKey, const TInt aValue );
       
   109 	
       
   110     /**
       
   111     * 
       
   112     */
       
   113 	virtual void HandlePropertyError( const TInt aReason );
       
   114 
       
   115 
       
   116 public:	// From MMusUiCallbackObserver
       
   117 
       
   118     /**
       
   119     * Handles async events common to all session types.
       
   120     * Should be called if child classes are not able to handle the call.
       
   121     */
       
   122     virtual void HandleAsyncEventL( TMusUiAsyncEvent aEventId );
       
   123 
       
   124     /**
       
   125     * Error handler for HandleAsyncEventL.
       
   126     */
       
   127     virtual TInt HandleAsyncError( TInt aError );
       
   128 
       
   129 
       
   130 public:	// From MMusUiMmcObserver
       
   131 
       
   132     /**
       
   133     * 
       
   134     */
       
   135     virtual void MmcRemoved();
       
   136 
       
   137 
       
   138 public: // From 
       
   139 
       
   140     /**
       
   141     * Handles session establishment procedures common to all session types.
       
   142     */
       
   143     virtual void SessionEstablished();
       
   144     
       
   145 
       
   146 public: // From MMusEngAudioRoutingObserver
       
   147     
       
   148     /**
       
   149     * Indicates that some other application has changed audio routing.
       
   150     *
       
   151     */
       
   152     virtual void AudioRoutingChanged( TBool aShowNote );
       
   153     
       
   154     /**
       
   155     * Before doing audio routing, permission is asked
       
   156     *
       
   157     */
       
   158     virtual TBool AudioRouteChangeAllowed() const;
       
   159     
       
   160 
       
   161 public:	// New functions
       
   162 	
       
   163 	/**
       
   164     * 
       
   165     */
       
   166 	void SetRect( const TRect& aRect );
       
   167 
       
   168     /**
       
   169     * 
       
   170     */
       
   171     const TDesC& MusContactName();
       
   172     
       
   173     /**
       
   174     * 
       
   175     */
       
   176 	const TDesC& MusVideoCodecValue();
       
   177 
       
   178     /**
       
   179     * 
       
   180     */
       
   181 	const TDesC& MusTelNumberValue();
       
   182     
       
   183     /**
       
   184     * 
       
   185     */
       
   186     const TDesC& SessionTimeFormatted( const TTimeIntervalSeconds& aSeconds );
       
   187     
       
   188     /**
       
   189     * 
       
   190     */
       
   191     void SaveContactQueryL();
       
   192     
       
   193     /**
       
   194     * 
       
   195     */
       
   196     void HandleError( const TInt aError );
       
   197 
       
   198     /**
       
   199     * Starts shutdown process
       
   200     */
       
   201     void HandleExitL();
       
   202 
       
   203     /**
       
   204     * 
       
   205     */
       
   206     void AsyncQueryDialogAcceptedL( TBool aAccepted );
       
   207     
       
   208     /**
       
   209     * 
       
   210     */
       
   211     TBool ExitOccured();
       
   212     
       
   213     /**
       
   214     *
       
   215     */
       
   216     TBool AudioRoutingCanBeChanged();
       
   217     
       
   218     /**
       
   219     * 
       
   220     */
       
   221     TBool IsLoudSpeakerEnabled();
       
   222     
       
   223     /**
       
   224     * 
       
   225     */
       
   226     TBool DeviceHasDedicatedVolumeKeys();
       
   227     
       
   228     /**
       
   229     * Queries flag for session state
       
   230     */
       
   231     TBool ConnectionEstablished() const;
       
   232     
       
   233     /**
       
   234     * Set session initialization state
       
   235     */
       
   236     void SetConnectionInitialized( TBool aConnectionInitialized );
       
   237     
       
   238     /**
       
   239     * Queries flag for session state
       
   240     */
       
   241     TBool ConnectionInitialized() const;
       
   242     
       
   243     /**
       
   244     * 
       
   245     */
       
   246     void EnableDisplayL( TBool aEnable );
       
   247     
       
   248     /**
       
   249     * 
       
   250     */
       
   251     void ChangeOrientationL( CAknAppUiBase::TAppUiOrientation aOrientation );
       
   252     
       
   253     /**
       
   254     * 
       
   255     */
       
   256     TBool ToolbarVolumeSelected();
       
   257     
       
   258     /**
       
   259     *
       
   260     */ 
       
   261     TBool IsMicMutedL();
       
   262     
       
   263     /**
       
   264     * Function to be overridden in sibling classes
       
   265     * @return EFalse by default
       
   266     */
       
   267     virtual TBool ManualAddressTyped() const;
       
   268     
       
   269     /**
       
   270     * 
       
   271     */
       
   272     virtual void HandleForegroundEventL( TBool aForeground );
       
   273     
       
   274     /**
       
   275     * 
       
   276     */
       
   277     virtual void OfferToolbarEventL( TInt aCommand );
       
   278     
       
   279     /**
       
   280     * 
       
   281     */
       
   282     virtual void HandleCommandL( TInt aCommand );
       
   283 
       
   284     /**
       
   285     * Returns a pointer to engine side session.
       
   286     */
       
   287     virtual CMusEngMceSession* EngineSession() = 0;
       
   288     
       
   289     /**
       
   290     * 
       
   291     */
       
   292     virtual const TDesC& TypedAddress() const = 0;
       
   293     
       
   294     /**
       
   295     * 
       
   296     */
       
   297     virtual void DeleteEngineSession() = 0;
       
   298     
       
   299 
       
   300 protected:    // New functions
       
   301 
       
   302     /**
       
   303     * General functionality of exit procedure
       
   304     */
       
   305     virtual void ExitProcedureL( TBool aUserAcceptance );
       
   306     
       
   307     /**
       
   308     * Handles status changes common to all sharing types.
       
   309     * To be overridden in sibling classes for sharing type specific 
       
   310     * status changes.
       
   311     */
       
   312     virtual void HandleChangedStatusL( TMusAvailabilityStatus aStatus );    
       
   313     
       
   314     
       
   315 protected:
       
   316         
       
   317     /**
       
   318     * 
       
   319     */
       
   320 	MMusUiEventObserver& iEventObserver;
       
   321 	
       
   322     /**
       
   323     *
       
   324     */
       
   325     MMusUiSharingObserver& iSharingObserver;
       
   326     
       
   327     /**
       
   328     * 
       
   329     */
       
   330 	CMusUiCallbackService* iCallbackService;
       
   331 
       
   332     /**
       
   333     * Flag of the connection state
       
   334     */
       
   335 	TBool iConnectionEstablished;
       
   336 	
       
   337 	/**
       
   338     * Flag of the connection state
       
   339     */
       
   340 	TBool iConnectionInitialized;
       
   341 
       
   342     /**
       
   343     * 
       
   344     */
       
   345 	TFileName iVideoFilePath;
       
   346 	
       
   347     /**
       
   348     * 
       
   349     */
       
   350 	TFileName iLocalizedVideoFilePath;
       
   351 	
       
   352     /**
       
   353     * 
       
   354     */
       
   355 	TFileName iVideoFileNamePlain;
       
   356 	
       
   357 	/**
       
   358     * 
       
   359     */
       
   360 	TInt iSipProfileId;
       
   361 	
       
   362 	/**
       
   363     * 
       
   364     */
       
   365 	TInt iContactId;
       
   366 	
       
   367 	/**
       
   368     * 
       
   369     */
       
   370 	HBufC* iContactName;
       
   371 
       
   372     /**
       
   373     * 
       
   374     */
       
   375 	HBufC* iTelNumber;
       
   376 	
       
   377     /**
       
   378     * 
       
   379     */
       
   380 	HBufC* iDialogPrompt;
       
   381     
       
   382     /**
       
   383     * 
       
   384     */
       
   385 	HBufC* iVideoCodec;
       
   386 	
       
   387     /**
       
   388     * 
       
   389     */
       
   390     TBool iForeground;
       
   391 
       
   392     /**
       
   393     * ETrue if operator specific functionality is needed 
       
   394     */
       
   395     TBool iOperatorSpecificFunctionality;
       
   396     
       
   397     /**
       
   398     *
       
   399     */
       
   400     CMusUiResourceHandler* iResourceHandler;
       
   401     
       
   402 	/**
       
   403     * 
       
   404     */
       
   405     TMusUiShutdownState iShutdownState;
       
   406     
       
   407     
       
   408 private:
       
   409 	
       
   410     /**
       
   411     * 
       
   412     */
       
   413 	CMusUiMmcMonitor* iMmcMonitor;
       
   414 	
       
   415 	/**
       
   416     * 
       
   417     */
       
   418     CMusUiActivityManager* iActivityManager;
       
   419 
       
   420     /**
       
   421     * 
       
   422     */
       
   423     CMusUiPropertyWatch* iStatusPropertyWatch; 
       
   424 
       
   425     /**
       
   426     * 
       
   427     */
       
   428     TBuf<7> iTimeBuffer;
       
   429     
       
   430     /**
       
   431      * Flag of the Volume item in the Toolbar
       
   432      */
       
   433     TBool iToolbarVolumeSelected;
       
   434     
       
   435     /**
       
   436     * Flag indicating whether call has ended
       
   437     */
       
   438     TBool iActiveCall;
       
   439     
       
   440     MUS_UNITTEST( UT_CMusUiEventController )
       
   441     MUS_UNITTEST( UT_CMusUiLiveSharingController )
       
   442     MUS_UNITTEST( UT_CMusUiClipSharingController )
       
   443     MUS_UNITTEST( UT_CMusUiReceiveController )
       
   444     };
       
   445 
       
   446 #endif // MUSUIEVENTCONTROLLER_H
       
   447 
       
   448 // end of file