datacommsserver/esockserver/esock_messages/inc/mobilitymessagesecom.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2008-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 #if !defined(MOBILITYMESSAGESECOM_H_INCLUDED)
       
    17 #define MOBILITYMESSAGESECOM_H_INCLUDED
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <comms-infras/metadata.h>
       
    21 #include <comms-infras/api_ext_msg.h>
       
    22 #include <comms-infras/mobilitymessages.h>
       
    23 
       
    24 class MMobilityProtocolResp;
       
    25 
       
    26 namespace ESock
       
    27 {
       
    28 
       
    29 const TInt KMobilityMessagesImplementationUid = 0x102732e5;
       
    30 
       
    31 /** Types of the mobility message interface represented by CMessage.
       
    32 @publishedPartner
       
    33 @released
       
    34 */
       
    35 enum TMobilityMsgImplementations
       
    36     {
       
    37     EMobilityMessageAny                 = Meta::KNetMetaTypeAny, //Any mobility message type
       
    38     EPreferredCarrierAvailable          = 0x00000001,
       
    39     ENewCarrierActive                   = 0x00000002,
       
    40     };
       
    41 
       
    42 /**
       
    43 	Mobility message factory.
       
    44 
       
    45 	@internalComponent
       
    46 	@released since v9.2
       
    47 */
       
    48 class CMobilityMsgFactory : public CBase
       
    49    {
       
    50 public:
       
    51    static Meta::SMetaDataECom* NewMessageL(TAny* aParams);
       
    52    };
       
    53 
       
    54 class CPreferredCarrierAvailable : public CCommsMobilityApiExtRespMsg
       
    55 /**
       
    56 Preferred carrier available message.
       
    57 
       
    58 @publishedPartner
       
    59 @released
       
    60 */
       
    61    {
       
    62    friend class CMobilityMsgFactory;
       
    63 
       
    64 public:
       
    65 	/**
       
    66 	 Dispatches the message.
       
    67 	
       
    68 	 @param aProtocol The protocol used for dispatching the response message.
       
    69 	 */
       
    70 	void DispatchL(MMobilityProtocolResp& aProtocol);
       
    71 
       
    72 	/**
       
    73 	 Creates a new CNewCarrierActive response message
       
    74 	
       
    75 	 @return A pointer to a message instance if successful, otherwise leaves with error code.
       
    76      */
       
    77 	inline static CPreferredCarrierAvailable* NewL();
       
    78 	
       
    79 	inline TAccessPointInfo OldAPInfo() const;
       
    80 	inline void SetOldAPInfo(TAccessPointInfo aAPInfo);
       
    81 		  
       
    82 	/**
       
    83 	 Returns the new access point information.
       
    84 	
       
    85 	 @return The value of iNewAP.	
       
    86 	 */
       
    87 	inline TAccessPointInfo NewAPInfo() const;
       
    88 	/**
       
    89 	 Sets the new access point information.
       
    90 	
       
    91 	 @param aAPInfo The "new access point" information - iNewAP will be set to that value.
       
    92 	 */
       
    93 	inline void SetNewAPInfo(TAccessPointInfo aAPInfo);
       
    94 	
       
    95 	inline TBool IsUpgrade() const;
       
    96 	inline void SetIsUpgrade(TBool aIsUpgrade);
       
    97    
       
    98 	/**
       
    99 	 Returns the value of the seamless flag.
       
   100 	
       
   101 	 @return The value of iIsSeamless.	
       
   102 	 */
       
   103 	inline TBool IsSeamless() const;
       
   104 	
       
   105 	/**
       
   106 	 Sets the new access point information.
       
   107 	
       
   108 	 @param aAPInfo The "new access point" information - iNewAP will be set to that value.
       
   109 	 */
       
   110 	inline void SetIsSeamless(TBool aIsSeamless);
       
   111 
       
   112 	DATA_VTABLE
       
   113 
       
   114 protected:
       
   115 	CPreferredCarrierAvailable();
       
   116 
       
   117 protected:
       
   118 	TAccessPointInfo iOldAP;
       
   119 	TAccessPointInfo iNewAP;
       
   120 	TBool iIsUpgrade;
       
   121 	/** Flag indicating whether this is an seamless message */
       
   122 	TBool iIsSeamless;
       
   123    };
       
   124 
       
   125 class CNewCarrierActive : public CCommsMobilityApiExtRespMsg
       
   126 /**
       
   127 New carrier active message.
       
   128 
       
   129 @publishedPartner
       
   130 @released
       
   131 */
       
   132    {
       
   133    friend class CMobilityMsgFactory;
       
   134 
       
   135 public:
       
   136 	/**
       
   137 	 Dispatches the message.
       
   138 	
       
   139 	 @param aProtocol The protocol used for dispatching the response message.
       
   140      */
       
   141 	void DispatchL(MMobilityProtocolResp& aProtocol);
       
   142    
       
   143 	/**
       
   144 	 Creates a new CNewCarrierActive response message
       
   145 	
       
   146 	 @return A pointer to a message instance if successful, otherwise leaves with error code.
       
   147      */
       
   148 	inline static CNewCarrierActive* NewL();
       
   149    
       
   150 	/**
       
   151 	 Returns the new access point information.
       
   152 	
       
   153 	 @return The value of iNewAP.	
       
   154 	 */	
       
   155 	inline TAccessPointInfo NewAPInfo() const;
       
   156    
       
   157 	/**
       
   158 	 Sets the new access point information.
       
   159 	
       
   160 	 @param aAPInfo The "new access point" information - iNewAP will be set to that value.
       
   161 	 */
       
   162 	inline void SetNewAPInfo(TAccessPointInfo aAPInfo);
       
   163    	
       
   164 	/**
       
   165 	 Returns the value of the seamless flag.
       
   166 	
       
   167 	 @return The value of iIsSeamless.	
       
   168 	 */
       
   169    	inline TBool IsSeamless() const;
       
   170 	
       
   171    	/**
       
   172 	 Sets the new access point information.
       
   173 	
       
   174 	 @param aAPInfo The "new access point" information - iNewAP will be set to that value.
       
   175 	 */
       
   176 	inline void SetIsSeamless(TBool aIsSeamless);
       
   177 
       
   178    	DATA_VTABLE
       
   179 
       
   180 protected:
       
   181    	CNewCarrierActive();
       
   182 
       
   183 protected:
       
   184    	TAccessPointInfo iNewAP;
       
   185 	/** Flag indicating whether this is an seamless message */
       
   186    	TBool iIsSeamless;
       
   187    };
       
   188 
       
   189 #include <comms-infras/mobilitymessagesecom.inl>
       
   190 
       
   191 } //namespace ESock
       
   192 
       
   193 #endif // MOBILITYMESSAGESECOM_H_INCLUDED
       
   194