bluetoothapitest/bluetoothsvs/T_BTSockAddrAPI/inc/T_BTServiceSecurityData.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 /*
       
     2 * Copyright (c) 2005-2009 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 #if (!defined __T_BT_SERVICE_SECURITYDATA_H__)
       
    20 #define __T_BT_SERVICE_SECURITYDATA_H__
       
    21 
       
    22 //	User Includes
       
    23 #include "DataWrapperBase.h"
       
    24 // Classes to get to protected members
       
    25 #include "T_TRfcommSockAddrChild.h"
       
    26 #include "T_TBTSockAddrChild.h"
       
    27 
       
    28 //	EPOC includes
       
    29 #include <w32std.h>
       
    30 #include <e32std.h>
       
    31 #include <es_sock.h> // TSockAddr address 
       
    32 #include <bt_sock.h> // Bluetooth address classes
       
    33 
       
    34 
       
    35 class CT_BTServiceSecurityData: public CDataWrapperBase
       
    36 	{
       
    37 public:
       
    38 	/**
       
    39 	* Two phase constructor
       
    40 	*/
       
    41 	static CT_BTServiceSecurityData*	NewL();
       
    42 
       
    43 	/**
       
    44 	* Process a command read from the ini file
       
    45 	*
       
    46 	* @param aCommand			The command to process
       
    47 	* @param aSection			The section in the ini containing data for the command
       
    48 	* @param aAsyncErrorIndex	Command index for async calls to return errors to
       
    49 	*
       
    50 	* @return					ETrue if the command is processed
       
    51 	*
       
    52 	* @leave					System wide error
       
    53 	*/
       
    54 	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
       
    55 
       
    56 	/**
       
    57 	* Set the internal iBTServiceSecurity object using the copy constructor
       
    58 	*/	
       
    59 
       
    60 	void CopyObjectL(TAny* aObjectPtr);
       
    61 
       
    62 	/**
       
    63 	* Destructor
       
    64 	*/
       
    65 	~CT_BTServiceSecurityData();
       
    66 
       
    67 	inline virtual TCleanupOperation CleanupOperation();
       
    68 
       
    69 protected:
       
    70 	/**
       
    71 	* Protected constructor. First phase construction
       
    72 	*/
       
    73 	CT_BTServiceSecurityData();
       
    74 
       
    75 	/**
       
    76 	* Return a pointer to the object that the data wraps
       
    77 	*
       
    78 	* @return	pointer to the object that the data wraps
       
    79 	*/
       
    80 	virtual TAny*	GetObject();
       
    81 
       
    82 	/**
       
    83 	* Set the object that the data wraps
       
    84 	*
       
    85 	* @param	aObject object that the wrapper is testing
       
    86 	*
       
    87 	* @leave	KErrNotSupported if the the function is not supported
       
    88 	*/
       
    89 	virtual void	SetObjectL(TAny* aObject);
       
    90 
       
    91 	/**
       
    92 	* The object will no longer be owned by this
       
    93 	*
       
    94 	* @leave	KErrNotSupported if the the function is not supported
       
    95 	*/
       
    96 	virtual void	DisownObjectL();
       
    97 
       
    98 private:
       
    99 	// Implementation of DoCommandL for each of the commands
       
   100 	inline void TBTSSConstruct(const TDesC& aSection);
       
   101 	inline void TBTSSSetAuthentication(const TDesC& aSection);
       
   102 	inline void TBTSSAuthenticationRequired(const TDesC& aSection);
       
   103 	inline void TBTSSSetAuthorisation(const TDesC& aSection);
       
   104 	inline void TBTSSAuthorisationRequired(const TDesC& aSection);
       
   105 	inline void TBTSSSetDenied(const TDesC& aSection);
       
   106 	inline void TBTSSDenied(const TDesC& aSection);
       
   107 	inline void TBTSSSetEncryption(const TDesC& aSection);
       
   108 	inline void TBTSSEncryptionRequired(const TDesC& aSection);
       
   109 	inline void TBTSSSetPasskeyMinLength(const TDesC& aSection);
       
   110 	inline void TBTSSPasskeyMinLength(const TDesC& aSection);
       
   111 	inline void TBTSSSetUid(const TDesC& aSection);
       
   112 	inline void	TBTSSUid(const TDesC& aSection);
       
   113 
       
   114 	/**
       
   115 	* Delete iTBTSockAddr and set to 0
       
   116 	*/
       
   117 	void Cleanup();	
       
   118 
       
   119 	static void CleanupOperation(TAny* aAny);
       
   120 
       
   121 private:
       
   122 	// An object of TBTServiceSecurity class in order to retain state between 
       
   123 	// calls
       
   124     TBTServiceSecurity*		iBTServiceSecurity; 
       
   125 	};
       
   126 
       
   127 #endif /* __T_BT_SERVICE_SECURITYDATA_H__ */