epoc32/include/comms-infras/cs_mobility_apiext.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 cs_mobility_apiext.h
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedAll
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef CS_MOBILITY_APIEXT_H
       
    25 #define CS_MOBILITY_APIEXT_H
       
    26 
       
    27 #include <es_sock.h>
       
    28 #include <comms-infras/cs_api_ext.h> //For RCommsApiExtension
       
    29 #include <comms-infras/api_ext_msg.h> //For CCommsApiExtensionMsg manipulation, used only with RCommsMobilityApiExt
       
    30 
       
    31 class RCommsMobilityApiExt : public RCommsApiExtension<EMobilityApiExt>
       
    32 /**
       
    33 Comms Mobility API extension for client not running an Active Scheduler.
       
    34 
       
    35 This class can actually be used by any client, one running an Active Scheduler 
       
    36 and one that is not. However, if the Active Scheduler is present, 
       
    37 it is recommended to use CActiveCommsMobilityApiExt which is much simpler.
       
    38 
       
    39 @see CActiveCommsMobilityApiExt
       
    40 
       
    41 @internalTechnology
       
    42 @released
       
    43 */
       
    44 	{
       
    45 public:
       
    46 	IMPORT_C explicit RCommsMobilityApiExt();
       
    47 	IMPORT_C void Close();
       
    48 
       
    49 	IMPORT_C void RegisterForMobilityNotification(TDes8& aResponseEventBuf, TRequestStatus& aStatus);
       
    50 	IMPORT_C void CancelMobilityNotification();
       
    51 
       
    52 	IMPORT_C void MigrateToPreferredCarrier();
       
    53 	IMPORT_C void IgnorePreferredCarrier();
       
    54 	IMPORT_C void NewCarrierAccepted();
       
    55 	IMPORT_C void NewCarrierRejected();
       
    56 	};
       
    57 
       
    58 class MMobilityProtocolResp
       
    59 /**
       
    60 Comms Mobility API extension protocol.
       
    61 Used with CActiveCommsMobilityApiExt to reqister for mobility response messages.
       
    62 
       
    63 @publishedAll
       
    64 @released
       
    65 */
       
    66 	{
       
    67 public:
       
    68 	virtual void PreferredCarrierAvailable(TAccessPointInfo aOldAP, TAccessPointInfo aNewAP, TBool aIsUpgrade, TBool aIsSeamless) = 0;
       
    69 	virtual void NewCarrierActive(TAccessPointInfo aNewAP, TBool aIsSeamless) = 0;
       
    70 	virtual void Error(TInt aError) = 0;
       
    71 	};
       
    72 
       
    73 class CActiveCommsMobilityApiExt : public CActive
       
    74 /**
       
    75 Comms Mobility API extension for client running an Active Scheduler.. Whenever an Active 
       
    76 Scheduler is present, this API is recommended over RCommsMobilityApiExt because of its simplicity.
       
    77 
       
    78 With few important exceptions, CActiveCommsMobilityApiExt exports very similar APIs to RCommsMobilityApiExt
       
    79 
       
    80 @see RCommsMobilityApiExt
       
    81 
       
    82 @publishedAll
       
    83 @released
       
    84 */
       
    85 	{
       
    86 public:
       
    87 	IMPORT_C static CActiveCommsMobilityApiExt* NewL(RCommsSubSession& aExtensionProvider,MMobilityProtocolResp& aProtocol);
       
    88 	IMPORT_C ~CActiveCommsMobilityApiExt();
       
    89 
       
    90 	IMPORT_C void MigrateToPreferredCarrier();
       
    91 	IMPORT_C void IgnorePreferredCarrier();
       
    92 	IMPORT_C void NewCarrierAccepted();
       
    93 	IMPORT_C void NewCarrierRejected();
       
    94 
       
    95 protected:
       
    96     void ConstructL(RCommsSubSession& aExtensionProvider);
       
    97     explicit CActiveCommsMobilityApiExt(MMobilityProtocolResp& aProtocol);
       
    98 
       
    99 private:
       
   100   	void DoCancel();
       
   101 	void RunL();
       
   102 	TInt RunError(TInt aError);
       
   103 
       
   104 private:
       
   105 	MMobilityProtocolResp& iProtocol;
       
   106 	RCommsMobilityApiExt iExtApi;
       
   107 	RBuf8 iResponseBuf;
       
   108 	};
       
   109 
       
   110 #endif   // CS_MOBILITY_APIEXT_H