datacommsserver/esockserver/inc/ss_mobility_apiext.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 1997-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 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef SS_MOBILITY_APIEXT_H
       
    23 #define SS_MOBILITY_APIEXT_H
       
    24 
       
    25 #include <es_sock.h>
       
    26 #include <comms-infras/ss_api_ext.h>
       
    27 #include <comms-infras/mobilitymessages.h>
       
    28 
       
    29 namespace Elements
       
    30 {
       
    31 	class CResponseMsg;
       
    32 }
       
    33 
       
    34 //CCommsMobilitySrvResp is not part of the ESock namespace for compatibility only
       
    35 class CCommsMobilitySrvResp : public ESock::CCommsApiExtResponder
       
    36 /**
       
    37 This is a server side mobility response API extension.
       
    38 
       
    39 CCommsMobilitySrvResp is a self deleting object.
       
    40 Its lifetime originates with a call to SubscribeForMobilityResp(CCommsMobilitySrvResp*)
       
    41 and terminates with a call to any of its exported public API (i.e. PreferredCarrierAvailable(),
       
    42 etc).
       
    43 
       
    44 All exported public APIs are static and take "CCommsMobilitySrvResp*& aThis" as the first
       
    45 parameter which is deleted and assigned NULL during any call to this API.
       
    46 
       
    47 @publishedPartner
       
    48 @released
       
    49 */
       
    50 	{
       
    51 public:
       
    52 	IMPORT_C static void PreferredCarrierAvailable(CCommsMobilitySrvResp*& aThis, TAccessPointInfo aOldAP, TAccessPointInfo aNewAP, TBool aIsUpgrade, TBool aIsSeamless);
       
    53 	IMPORT_C static void NewCarrierActive(CCommsMobilitySrvResp*& aThis, TAccessPointInfo aNewAP, TBool aIsSeamless);
       
    54 	IMPORT_C static void Error(CCommsMobilitySrvResp*& aThis, TInt aError);
       
    55 
       
    56 protected:
       
    57 	explicit CCommsMobilitySrvResp();
       
    58 	virtual ~CCommsMobilitySrvResp();
       
    59 
       
    60 private:
       
    61 	virtual void DoPreferredCarrierAvailable(TAccessPointInfo aOldAP, TAccessPointInfo aNewAP, TBool aIsUpgrade, TBool aIsSeamless) = 0;
       
    62 	virtual void DoNewCarrierActive(TAccessPointInfo aNewAP, TBool aIsSeamless) = 0;
       
    63 	};
       
    64 
       
    65 namespace ESock
       
    66 {
       
    67 
       
    68 class AMobilityProtocolReq : public ESock::AIPCClientInfo, public ESock::AExtensionInterfaceBase<ESock::KMobilityRequestMessagesImplementationUid>
       
    69 /**
       
    70 Interface to be implemented by the client to support mobility API extension on the server side.
       
    71 
       
    72 An example of an empty implementation could look like this:
       
    73 
       
    74 class AExampleMobilityImplementation : public MMobilityProtocolReq
       
    75 	{
       
    76 public:
       
    77 	void MigrateToPreferredCarrier(TSubSessionUniqueId aClientId);
       
    78 	void IgnorePreferredCarrier(TSubSessionUniqueId aClientId);
       
    79 	void NewCarrierAccepted(TSubSessionUniqueId aClientId);
       
    80 	void NewCarrierRejected(TSubSessionUniqueId aClientId);
       
    81 	void SubscribeForMessage(TSubSessionUniqueId aClientId, CCommsMobilitySrvResp* aRespExt);
       
    82 	void CancelSubscription(TSubSessionUniqueId aClientId);
       
    83 	};
       
    84 
       
    85 void AExampleMobilityImplementation::SubscribeForMessage(TSubSessionUniqueId aClientId, CCommsMobilitySrvResp* aRespExt)
       
    86 	{
       
    87 	TAccessPointInfo oldap;
       
    88 	oldap.SetAccessPoint(1); //example access point
       
    89 	TAccessPointInfo newap;
       
    90 	newap.SetAccessPoint(2); //example access point
       
    91 	TBool upgrade = ETrue;   //example upgeade
       
    92 	CCommsMobilitySrvResp::PreferredCarrierAvailable(aRespExt,oldap,newap,upgrade);
       
    93 	}
       
    94 
       
    95 	...
       
    96 
       
    97 @publishedPartner
       
    98 @released
       
    99 */
       
   100 	{
       
   101 public:
       
   102     static const TSupportedCommsApiExt KInterfaceId = EMobilityApiExt;
       
   103 
       
   104 public:
       
   105 	virtual void SubscribeForMessage(TSubSessionUniqueId aClientId, CCommsMobilitySrvResp* aRespExt) = 0;
       
   106 	virtual void CancelSubscription(TSubSessionUniqueId aClientId) = 0;
       
   107 	virtual void MigrateToPreferredCarrier(TSubSessionUniqueId aClientId) = 0;
       
   108 	virtual void IgnorePreferredCarrier(TSubSessionUniqueId aClientId) = 0;
       
   109 	virtual void NewCarrierAccepted(TSubSessionUniqueId aClientId) = 0;
       
   110 	virtual void NewCarrierRejected(TSubSessionUniqueId aClientId) = 0;
       
   111 
       
   112 private:
       
   113 	virtual void CancelExtensionInterface(TSubSessionUniqueId aClientId)
       
   114 		{
       
   115 		CancelSubscription(aClientId);
       
   116 		}
       
   117 	};
       
   118 
       
   119 } //namespace ESock
       
   120 
       
   121 
       
   122 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   123 #include <comms-infras/ss_mobility_apiext_internal.h>
       
   124 #endif
       
   125 
       
   126 
       
   127 #endif
       
   128 // SS_MOBILITY_APIEXT_H
       
   129 
       
   130