multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/inc/CMCETestUIEngineProfileContainer.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 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:    See class definition below.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CMCETESTUIENGINEPROFILECONTAINER_H__
       
    21 #define __CMCETESTUIENGINEPROFILECONTAINER_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <sipprofileregistryobserver.h>
       
    25 #include <sipconnectionobserver.h>
       
    26 #include <sipprofileregistry.h>
       
    27 
       
    28 #include "CMCETestUIEngine.h"
       
    29 
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CSIP;
       
    33 
       
    34 
       
    35 
       
    36 // CLASS DEFINITION
       
    37 /**
       
    38  * CMCETestUIEngineProfileContainer implements a container for multiple 
       
    39  * profiles and control whether they are in use or not.
       
    40  * Its task is also to observe profile registry events and pass the information
       
    41  * via CMCETestUIEngine to user interface.
       
    42  */
       
    43 class CMCETestUIEngineProfileContainer
       
    44 	: public CBase,
       
    45       public MSIPProfileRegistryObserver,
       
    46       public MSIPConnectionObserver
       
    47 	{
       
    48 	
       
    49 	public:	// Constructors and destructor
       
    50 
       
    51 		/**
       
    52 		 * Static constructor.
       
    53 		 */
       
    54 		static CMCETestUIEngineProfileContainer* NewL( 
       
    55 		            CMCETestUIEngine& aEngine, CSIP& aSip );
       
    56 
       
    57     	/**
       
    58     	* Destructor.
       
    59     	*/
       
    60 		virtual ~CMCETestUIEngineProfileContainer();
       
    61 
       
    62 	private:
       
    63 
       
    64         /**
       
    65         * C++ first phase constructor.
       
    66         */		
       
    67         CMCETestUIEngineProfileContainer( CMCETestUIEngine& aEngine, 
       
    68 		                                  CSIP& aSip );
       
    69 
       
    70         /**
       
    71         * C++ default constructor. Not implemented.
       
    72         */		
       
    73         CMCETestUIEngineProfileContainer();
       
    74 
       
    75     	/**
       
    76         * Symbian second-phase constructor
       
    77         */
       
    78 		void ConstructL();
       
    79 
       
    80 	public: // From MSIPProfileRegistryObserver
       
    81 	
       
    82         void ProfileRegistryEventOccurred(TUint32 aProfileId, TEvent aEvent);
       
    83         void ProfileRegistryErrorOccurred(TUint32 aProfileId, TInt aError);
       
    84 
       
    85    public: // From MSIPConnectionObserver, all dummies
       
    86 
       
    87 		void IncomingRequest (CSIPServerTransaction* aTransaction);
       
    88 		void IncomingRequest (CSIPServerTransaction* aTransaction,
       
    89 					          CSIPDialog& aDialog);
       
    90 		void IncomingResponse (CSIPClientTransaction& aTransaction);
       
    91 		void IncomingResponse (CSIPClientTransaction& aTransaction,
       
    92 							   CSIPDialogAssocBase& aDialogAssoc);
       
    93 		void IncomingResponse (CSIPClientTransaction& aTransaction,
       
    94 							   CSIPInviteDialogAssoc* aDialogAssoc);
       
    95 		void IncomingResponse (CSIPClientTransaction& aTransaction,
       
    96                                CSIPRegistrationBinding& aRegistration);
       
    97 		void ErrorOccured (TInt aError,
       
    98                                    CSIPTransactionBase& aTransaction);
       
    99 		void ErrorOccured (TInt aError,
       
   100 				                   CSIPClientTransaction& aTransaction,
       
   101 					               CSIPRegistrationBinding& aRegistration);
       
   102 		void ErrorOccured (
       
   103 					TInt aError,
       
   104 				    CSIPTransactionBase& aTransaction,
       
   105 					CSIPDialogAssocBase& aDialogAssoc);
       
   106 		void ErrorOccured (TInt aError, CSIPRefresh& aSIPRefresh);
       
   107 		void ErrorOccured (TInt aError,					
       
   108 					               CSIPRegistrationBinding& aRegistration);
       
   109 		void ErrorOccured (TInt aError,			
       
   110 					               CSIPDialogAssocBase& aDialogAssoc);
       
   111         void InviteCompleted (CSIPClientTransaction& aTransaction);
       
   112         void InviteCanceled (CSIPServerTransaction& aTransaction);
       
   113 		void ConnectionStateChanged (CSIPConnection::TState aState);			
       
   114 
       
   115     public : // new methods
       
   116 
       
   117 		/**
       
   118 		 * @return Reference to profile registry user interface.
       
   119 		 */
       
   120         inline CSIPProfileRegistry& ProfileRegistry()
       
   121 				{ return *iProfileRegistry; };
       
   122 
       
   123 		/**
       
   124 		 * Gets available profiles that are not in use yet.
       
   125 		 * 
       
   126 		 * @return Reference to array of unused available profiles
       
   127 		 */ 
       
   128         const RPointerArray<CMCETestUIEngineProfile>& AvailableProfiles();
       
   129 
       
   130 		/**
       
   131 		 * Gets profiles that are allready in use.
       
   132 		 * 
       
   133 		 * @return Reference to array of used profiles
       
   134 		 */          
       
   135         const RPointerArray<CMCETestUIEngineProfile>& UsedProfiles();
       
   136 
       
   137 		/**
       
   138 		 * @return ETrue if profile given as parameter is in use
       
   139 		 */   
       
   140         TBool IsProfileInUse( CMCETestUIEngineProfile& aProfile );
       
   141 
       
   142 		/**
       
   143 		 * Marks profile given as parameter to be in use.
       
   144 		 */           
       
   145         void TakeProfileIntoUseL( CMCETestUIEngineProfile& aProfile );
       
   146 
       
   147         /**
       
   148          * Gets default profile
       
   149          * 
       
   150          * @return Wrapper for default profile
       
   151          */
       
   152         CMCETestUIEngineProfile& GetDefaultProfileL();
       
   153 
       
   154 	private: // data
       
   155 
       
   156 		/// SIP stack. Not Owned.
       
   157 		CSIP& iSip;
       
   158 
       
   159 		/// User interface to profile registry. Owned.
       
   160 		CSIPProfileRegistry* iProfileRegistry;
       
   161 		
       
   162 		/// Array of profiles retrieved from profile registry. Owned
       
   163 		RPointerArray< CMCETestUIEngineProfile > iProfiles;
       
   164 
       
   165 		/// Array of profiles taken to use. Owned.
       
   166 		RPointerArray< CMCETestUIEngineProfile > iUsedProfiles;
       
   167 	    
       
   168         /// Reference to UI Engine
       
   169         CMCETestUIEngine& iEngine;
       
   170 
       
   171 	};
       
   172 
       
   173 #endif // __CMCETESTUIENGINEPROFILECONTAINER_H__