mmsharing/mmshui/inc/musuisendcontroller.h
branchRCL_3
changeset 33 bc78a40cd63c
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
       
     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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MUSUISENDCONTROLLER_H
       
    20 #define MUSUISENDCONTROLLER_H
       
    21 
       
    22 #include "musuieventcontroller.h"
       
    23 #include "musengoutsessionobserver.h"
       
    24 #include "musunittesting.h"
       
    25 
       
    26 #include "musengoutsessionobserver.h"
       
    27 #include <AknProgressDialog.h>
       
    28 
       
    29 class MMusUiSendObserver;
       
    30 class CMusEngMceOutSession;
       
    31 class CDirectoryLocalizer;
       
    32 
       
    33 /**
       
    34  *
       
    35  *
       
    36  * @lib musui.exe
       
    37  */
       
    38 class CMusUiSendController : public CMusUiEventController,
       
    39                              public MMusEngOutSessionObserver
       
    40     {
       
    41 
       
    42 public:
       
    43 
       
    44 	virtual ~CMusUiSendController();
       
    45 	
       
    46 	
       
    47 public:	// From CMusUiEventController:
       
    48     
       
    49     /**
       
    50     * Returns a pointer to engine side session.
       
    51     */
       
    52     virtual CMusEngMceSession* EngineSession();
       
    53     
       
    54     /**
       
    55     *
       
    56     */
       
    57     virtual const TDesC& TypedAddress() const;
       
    58     
       
    59     /**
       
    60     *
       
    61     */
       
    62     virtual TBool ManualAddressTyped() const;
       
    63     
       
    64     /**
       
    65     * Makes out session specific preparations for engine session deletion.
       
    66     */
       
    67     virtual void DeleteEngineSession();
       
    68        
       
    69 
       
    70 public:	// From MMusUiPropertyObserver
       
    71 
       
    72     virtual void HandlePropertyError( const TInt aReason );
       
    73 
       
    74 
       
    75 public: // From MMusUiCallbackObserver
       
    76 
       
    77     /**
       
    78     * Handles async events common to outgoing session types.
       
    79     * Should be called if child classes are not able to handle the call.
       
    80     */
       
    81     virtual void HandleAsyncEventL( TMusUiAsyncEvent aEventId );
       
    82 
       
    83     
       
    84 public:	// new functions:
       
    85 
       
    86     /**
       
    87     * Returns a pointer to engine side session.
       
    88     */
       
    89     virtual CMusEngMceOutSession* EngineOutSession() = 0;
       
    90 
       
    91     virtual void InviteL( const TDesC& aRecipient ) = 0;
       
    92     
       
    93     virtual void HandleSliderValueChangeL( TInt aNewLevel ) = 0;
       
    94 
       
    95     void StartInvitationL();
       
    96 
       
    97     void InviteL();
       
    98     
       
    99 	void CancelInvitationL();
       
   100     
       
   101     virtual void HandleForegroundEventL( TBool aForeground );
       
   102    
       
   103     virtual void PlayL();
       
   104     
       
   105     virtual void PauseL();
       
   106     
       
   107     TBool IsPlayingL();
       
   108     
       
   109 
       
   110 public: // from MMusEngSessionObserver
       
   111 	
       
   112     virtual void SessionEstablished();
       
   113 
       
   114 
       
   115 public: // from MMusEngOutSessionObserver
       
   116 	
       
   117     virtual	void SessionRejected();                     // e.g. 603 DECLINE
       
   118 	
       
   119 	virtual void SessionBadRequest();                   // 400 
       
   120 	
       
   121 	virtual void SessionUnauthorized();                 // 401 
       
   122 	
       
   123 	virtual void SessionPaymentRequired();              // 402
       
   124 	
       
   125 	virtual void SessionRecipientNotFound();            // 404
       
   126 	
       
   127 	virtual void SessionProxyAuthenticationRequired();  // 407
       
   128 	
       
   129 	virtual void SessionRequestTimeOut();               // 408
       
   130 	
       
   131 	virtual void SessionUnsupportedMediaType();         // 415
       
   132 	
       
   133     virtual void SessionBusyHere();                     // 486
       
   134 
       
   135 	virtual void SessionRequestCancelled();             // 487
       
   136 	
       
   137 	virtual void SessionTemporarilyNotAvailable();      // 480    
       
   138  
       
   139   
       
   140 protected: // Contructors
       
   141 
       
   142     void ConstructL();
       
   143     
       
   144 	CMusUiSendController( MMusUiEventObserver& aEventObserver,
       
   145 	                      MMusUiSharingObserver& aSharingObserver, 
       
   146 	                      MMusUiSendObserver& aSendObserver );
       
   147 
       
   148 
       
   149 protected: // from MusUiEventController    
       
   150     
       
   151     /**
       
   152     * Send specific functionality of exit procedure
       
   153     */
       
   154     virtual void ExitProcedureL( TBool aUserAcceptance );
       
   155 
       
   156     /**
       
   157     * Handles status changes specific to sending side sharing types.
       
   158     * To be overridden in sibling classes for sharing type specific 
       
   159     * status changes. Calls base class version if status change is not
       
   160     * sending side specific.
       
   161     */
       
   162     virtual void HandleChangedStatusL( TMusAvailabilityStatus aStatus ); 
       
   163     
       
   164 
       
   165 protected:
       
   166 
       
   167     /**
       
   168     * 
       
   169     */
       
   170     const TDesC& VideoFileNameL();
       
   171     
       
   172     void ShowInvitingWaitDialogL();
       
   173 
       
   174     void DismissWaitDialog();
       
   175     
       
   176 
       
   177 private: // Helpers
       
   178 
       
   179     void SplitL( const TDesC& aDes, const TDesC& aChar, CDesCArray* aArray );	
       
   180 
       
   181     void SetVideoPathValueL();
       
   182 
       
   183     void ShowVideoSavedDialogL();
       
   184 
       
   185     void DeleteVideoL();
       
   186     
       
   187 	void DeleteFileL();
       
   188     
       
   189 protected:  // Data
       
   190 
       
   191     /*
       
   192     * Interface for outgoing session specific callbacks
       
   193     */
       
   194     MMusUiSendObserver& iSendObserver;
       
   195     
       
   196 	HBufC* iAddress;
       
   197 	
       
   198 	TBool iVideoToBeSaved;
       
   199 	
       
   200 	TBool iManualAddressTyped;
       
   201 	
       
   202     TInt iTriedInvitations;
       
   203 	
       
   204     /**
       
   205     * 
       
   206     */
       
   207     TBool iSipRegistrationPending;
       
   208 	
       
   209 	/**
       
   210     * 
       
   211     */
       
   212 	HBufC* iRemoteSipAddress;
       
   213 
       
   214     /**
       
   215     * 
       
   216     */
       
   217 	HBufC* iRemoteSipAddressProposal;
       
   218 
       
   219 	
       
   220 private: // Data
       
   221 
       
   222     /**
       
   223     * If this variable is ETrue, playback should be continued
       
   224     * when gaining focus. ETrue by default.
       
   225     */
       
   226     TBool iContinuePlayingWhenForeground;
       
   227     
       
   228    /**
       
   229     * 
       
   230     */
       
   231 	HBufC* iVideoFileName;
       
   232 	
       
   233     CDirectoryLocalizer* iLocalizer;
       
   234     
       
   235 protected:   
       
   236     /**
       
   237     * The class is used as a call back service of the wait dialog  
       
   238     */
       
   239     class TWaitDialogCallback : public MProgressDialogCallback
       
   240     	{
       
   241     public:
       
   242     	TWaitDialogCallback( CMusUiSendController& aController );	
       
   243     	void DialogDismissedL( TInt /*aButtonId*/ );
       
   244     	        	    
       
   245     private:
       
   246     	CMusUiSendController& iController;
       
   247     	
       
   248     	}iWaitDialogCallback;
       
   249 
       
   250 	/**
       
   251     * If this variable is ETrue, playback should be continued
       
   252     * when gaining focus. ETrue by default.
       
   253     */
       
   254     };
       
   255 
       
   256 #endif // MUSUISENDCONTROLLER_H
       
   257 
       
   258 // end of file