epoc32/include/comms-infras/ss_connselect.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/comms-infras/ss_connselect.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,102 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#if !defined(__SS_CONNSELECT_H__)
    1.20 +#define __SS_CONNSELECT_H__
    1.21 +
    1.22 +#include <ss_select.h>
    1.23 +#include <comms-infras/ss_mcprnodemessages.h>
    1.24 +#include <comms-infras/ss_platsec_apiext.h>
    1.25 +#include <comms-infras/ss_nodemessages_serviceprovider.h>
    1.26 +
    1.27 +namespace ESock
    1.28 +{
    1.29 +
    1.30 +class CSelectionRequest : public CBase,
    1.31 +                          public Messages::ASimpleNodeIdBase,
    1.32 +	                      public MPlatsecApiExt,
    1.33 +						  protected NetInterfaces::TInterfaceControl,
    1.34 +						  public ITFHIERARCHY_1(CSelectionRequest,MPlatsecApiExt)
    1.35 +
    1.36 +/**
    1.37 +Connection selection request.
    1.38 +
    1.39 +@internalTechnology
    1.40 +*/
    1.41 +	{
    1.42 +public:
    1.43 +	typedef ITFHIERARCHY_1(CSelectionRequest,MPlatsecApiExt) TIfStaticFetcherNearestInHierarchy;
    1.44 +
    1.45 +public:
    1.46 +	static CSelectionRequest* NewL(const Messages::TRuntimeCtxId& aRequestingClient, const Messages::TNodeId& aTierManagerId);
    1.47 +	virtual ~CSelectionRequest();
    1.48 +
    1.49 +	void Select(const TSelectionPrefs& aSelectionPreferences);
    1.50 +	void SelectConnPrefList(const RConnPrefList& aConnPrefList);
    1.51 +	void Provision(const Meta::SMetaData* aProvisionConfig);
    1.52 +	void Cancel(); //Cancels all active requests
    1.53 +
    1.54 +	void JoinComplete(const Messages::TNodeId& aSender, TCFPeer::TJoinComplete& aCFMessage);
    1.55 +    void CommsBinderResponse(const TCFServiceProvider::TCommsBinderResponse& aMsg);
    1.56 +	void SelectComplete(const Messages::TNodeId& aSenderId, const Messages::TNodeId& aMcprId, const TProviderInfo& aMcprInfo);
    1.57 +
    1.58 +	// from MPlatsecApiExt
    1.59 +	virtual TInt SecureId(TSecureId& aResult) const;
    1.60 +    virtual TInt VendorId(TVendorId& aResult) const;
    1.61 +    virtual TBool HasCapability(const TCapability aCapability) const;
    1.62 +    virtual TInt CheckPolicy(const TSecurityPolicy& aPolicy) const;
    1.63 +
    1.64 +	void ReturnInterfacePtrL(MPlatsecApiExt*& aInterface);
    1.65 +	virtual NetInterfaces::TInterfaceControl* FetchNodeInterfaceControlL(TInt aInterfaceId);
    1.66 +
    1.67 +protected:
    1.68 +	explicit CSelectionRequest(const Messages::TRuntimeCtxId& aRequestingClient, const Messages::TNodeId& aTierManagerId);
    1.69 +	virtual void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage);
    1.70 +
    1.71 +private:
    1.72 +	TInt FindActiveRequest(const Messages::TRuntimeCtxId& aMcprId);
    1.73 +	void HandleProviderSelection(const Messages::TNodeId& aMcprId);
    1.74 +	void ProviderSelectionFinished(const Messages::TRuntimeCtxId& aMcprId); //Our selection request (SP or SNL) has been fully served -> SelectComplete(NULL).
    1.75 +	void SelectionFinished(); //The whole selection has finished.
    1.76 +	void PostError(const Messages::TNodeSignal::TMessageId& aMessageId, TInt aError);
    1.77 +	void InitialiseDestroy();
    1.78 +
    1.79 +private:
    1.80 +	void SelectionError(const Messages::TRuntimeCtxId& aSenderId, TInt aError); //Selection error
    1.81 +	void CommsBinderRequestError(const Messages::TRuntimeCtxId& aSenderId, Messages::TEBase::TError& aCFMessage); //CommsBinderRequest returned error
    1.82 +
    1.83 +private:
    1.84 +	enum {EIdle = 0x00, ESelecting = 0x01, ECancelling = 0x02, ERequestingCommsBinder = 0x04}; //Selection Status
    1.85 +	TInt iOriginalError;
    1.86 +	TSelectionPrefs iSelectionPreferences;
    1.87 +	Messages::TNodeId iTierManagerId;
    1.88 +	Messages::TNodeId iTopMcprId;
    1.89 +	TProviderInfo iTopMcprInfo;
    1.90 +	Messages::RNodeInterface     iRequestingNode;
    1.91 +    Messages::RRequestOriginator iRequest;
    1.92 +	RArray<Messages::RNodeInterface> iActiveRequests; //List of all service providers (mcprs) currently processing our selection requests
    1.93 +	TUint iSelectionStatus : 4;
    1.94 +	TUint iDestroying      : 1;
    1.95 +	TUint iJoined          : 1;
    1.96 +	ASubSessionPlatsecApiExt* iPlatsecApiExt;
    1.97 +    const Meta::SMetaData* iProvision;
    1.98 +	RConnPrefList iConnPrefList;
    1.99 +	};
   1.100 +
   1.101 +} //namespace ESock
   1.102 +
   1.103 +
   1.104 +#endif //__SS_CONNSELECT_H__
   1.105 +