multimediacommsengine/mmcefloorctrlplugin/inc/fcconnectioncontainer.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:    fcconnectioncontainer.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __CFCCONNECTIONCONTAINER_H__
       
    22 #define __CFCCONNECTIONCONTAINER_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <in_sock.h>
       
    26 #include <commdbconnpref.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MFCConnectionNotifier;
       
    30 
       
    31 /**
       
    32  *  interface for opening Connection
       
    33  *
       
    34  *  CFCConnectionContainer defines an interface for opening Connection
       
    35  *
       
    36  *  @lib FCTBCP.lib
       
    37  *  @since S60 v3.0
       
    38  */
       
    39 class CFCConnectionContainer : public CActive
       
    40 	{
       
    41 	public: // Constructors and destructor
       
    42 		/**
       
    43 		* Static constructor.
       
    44 		* @param aNotifier Reference to notifier
       
    45 		* @return An initialized instance of this class.
       
    46 		*/
       
    47 		static CFCConnectionContainer* NewL( MFCConnectionNotifier& aNotifier );
       
    48 
       
    49 		/**
       
    50 		* Destructor.
       
    51 		*/
       
    52 		~CFCConnectionContainer();
       
    53 
       
    54 	public:
       
    55 		/**
       
    56 		* Gets the RConnection
       
    57 		* @return the intance of RConnection
       
    58 		*/ 
       
    59 		RConnection& Connection();
       
    60 		
       
    61 		/**
       
    62 		* Open RConnection after RSocketServer has open
       
    63 		* @param aIapId IapId
       
    64 		* @param aServer a RSocket Server
       
    65 		* @return the error code if there is connection error
       
    66 		*/ 
       
    67 		TInt OpenConnection( TUint32 aIapId, RSocketServ& aServer );
       
    68 
       
    69 		/**
       
    70 		* Close RConnection
       
    71 		*/ 
       
    72 		void CloseConnection();
       
    73 
       
    74 	protected: // From CActive
       
    75 		/**
       
    76 		* Cancel any outstanding request
       
    77 		*/ 
       
    78 		void DoCancel();
       
    79 		
       
    80 		/**
       
    81 		* Handles an active object’s request completion event
       
    82 		*/ 
       
    83 		void RunL();
       
    84 
       
    85 	private: // Constructors
       
    86 		/**
       
    87 		* Constructor
       
    88 		* @param aNotifier, MFCConnectionNotifier
       
    89 		* @return An initialized instance of this class.
       
    90 		*/
       
    91 		CFCConnectionContainer( MFCConnectionNotifier& aNotifier );
       
    92 	
       
    93 	private: // Data
       
    94 		MFCConnectionNotifier& iNotifier;
       
    95 		RConnection	iConnection;
       
    96 		TCommDbConnPref iPrefs;
       
    97 	
       
    98 	private: // For testing purposes
       
    99 		friend class UT_CFCConnectionContainer;
       
   100 		friend class UT_CTBCPFloorControlImpl;
       
   101 		friend class UT_CFCSender;
       
   102 		friend class UT_CFCReceiver;
       
   103 	};
       
   104 
       
   105 #endif	// __CCONNECTIONCONTAINER_H__