bluetooth/btstack/sdp/sdpnetdb.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef SDPNETDB_H
       
    17 #define SDPNETDB_H
       
    18 
       
    19 #include <es_prot.h>
       
    20 #include <bttypes.h>
       
    21 
       
    22 class CSdpClient;
       
    23 class CSdpProtocol;
       
    24 class TSdpState;
       
    25 
       
    26 /**
       
    27    The net db provider access point.
       
    28    This class forms the major interaction point with RNetDatabase classes
       
    29 **/
       
    30 NONSHARABLE_CLASS(CSdpNetDbProvider) : public CNetDBProvdBase
       
    31 	{
       
    32 friend class CSdpProtocol;
       
    33 friend class CSdpClient;
       
    34 public:
       
    35 	// Creation
       
    36 	static CSdpNetDbProvider* NewL(CSdpProtocol& aProtocol);
       
    37 	~CSdpNetDbProvider();
       
    38 	
       
    39 	// CNetDBProvdBase functions
       
    40 	void Query(TDes8& aBuffer);
       
    41 	void Add(TDes8& aBuffer);
       
    42 	void Remove(TDes8& aBuffer);
       
    43 	void CancelCurrentOperation();
       
    44 	// End CNetDBProvdBase functions
       
    45 	
       
    46 	// Notifications from the sdp client
       
    47 	void ClientUp();
       
    48 	void ClientDown();
       
    49 	void QueryComplete(const TDesC8& aData);
       
    50 
       
    51     // Other functions
       
    52 	void Error(TInt aErrorCode);
       
    53 	//From CResolverProvdBase
       
    54 	TInt SecurityCheck(MProvdSecurityChecker *aSecurityChecker);
       
    55 private:
       
    56 	// Creation
       
    57 	CSdpNetDbProvider(CSdpProtocol& aProtocol);
       
    58 	void ConstructL();
       
    59 
       
    60 	// Query Dispatch
       
    61 	void ConnectQuery();
       
    62 	void ServiceQuery();
       
    63 	void AttributeQuery();
       
    64 	void EncodedQuery();
       
    65 	void RetrieveResult();
       
    66 
       
    67 	TInt ReturnResult(const TDesC8& aData);
       
    68 
       
    69 	// From CNetDBProvdBase
       
    70 	TInt CheckCapability(TUint32 aCapability, TUint aType);
       
    71 	TInt CheckCapabilityPerPolicy(const TUint32 aCapability, const TUint aPolicyIndex) const;
       
    72 
       
    73 
       
    74 private:
       
    75 	//Data
       
    76 	TBTDevAddr iRemoteDev;
       
    77 	TDes8* iQueryBuffer;
       
    78 	HBufC8* iResultBuf;
       
    79 
       
    80 	// Links
       
    81 	CSdpProtocol& iProtocol;
       
    82 	CSdpClient*  iClient;
       
    83 	// So we can go on a Que in the client
       
    84 	TDblQueLink    iLink;
       
    85 	//Mixin providing security checking, This is not an owned variable.
       
    86 	MProvdSecurityChecker* iSecurityChecker;
       
    87 	};
       
    88 
       
    89 #endif