phonesrv_plat/network_handling_engine_api/inc/NWHandlingEngine.h
changeset 0 ff3b6d0fd310
child 3 a4a774cb6ea7
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  This file defines the interface of the Network Handling
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef NWHandlingEngine_H
       
    21 #define NWHandlingEngine_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <RMmCustomAPI.h>
       
    26 
       
    27 
       
    28 // CONSTANTS
       
    29 // Max length of network country code.
       
    30 const TInt KNWCountryCodeLength = 4; // This value is defined in multimode etel definition document.
       
    31 // Max length of network identity code.
       
    32 const TInt KNWIdentityLength = 8; // This value is defined in multimode etel definition document.
       
    33 // Max length of network display alpha tag
       
    34 const TInt KNWDisplayTagLength = 30;   // New EtelMM API defition describe this value to be 32, but etelmm.h contains value 30. 
       
    35 // Max length of network short name.
       
    36 const TInt KNWShortNameLength = 10; // New EtelMM API defition describe this value to be 8, but etelmm.h contains value 10. 
       
    37 // Max length of network long name.
       
    38 const TInt KNWLongNameLength = 20; // New EtelMM API defition describe this value to be 16, but etelmm.h contains value 20. 
       
    39 // Max length of service provider name.
       
    40 const TInt KNWServiceProviderNameLength = 16;
       
    41 // Max length of network provider name.
       
    42 const TInt KNWProviderNameLength = 25;
       
    43 // Max length of MCN name.
       
    44 const TInt KNWMCNNameLength = 20;
       
    45 // Max length of VIAG text tag
       
    46 const TInt KNWViagTextTagLength = 13;
       
    47 // Max length of PLMN field
       
    48 const TInt KNWPLMNFieldLength = 251;
       
    49 
       
    50 
       
    51 // DATA TYPES
       
    52 // MCN name
       
    53 typedef TBuf<KNWMCNNameLength> TNWMCNName;
       
    54 // Viag text tag
       
    55 typedef TBuf<KNWViagTextTagLength> TNWViagTextTag;
       
    56 // MCC in GSM and TDMA
       
    57 typedef TBuf<KNWCountryCodeLength> TNWCountryCode;
       
    58 // MNC in GSM and SID in TDMA
       
    59 typedef TBuf<KNWIdentityLength> TNWIdentity;
       
    60 // Network Alpha-tag
       
    61 typedef TBuf<KNWDisplayTagLength> TNWDisplayTag;
       
    62 // The short name of the network operator
       
    63 typedef TBuf<KNWShortNameLength> TNWShortName;
       
    64 // The long name of the network operator
       
    65 typedef TBuf<KNWLongNameLength> TNWLongName;
       
    66 // Service provider name
       
    67 typedef TBuf<KNWServiceProviderNameLength> TNWServiceProviderName;
       
    68 // The PLMN Field
       
    69 typedef TBuf<KNWPLMNFieldLength> TNWPLMNField;
       
    70 // Network provider name
       
    71 typedef TBuf<KNWProviderNameLength> TNWProviderName;
       
    72 // The Programmable Operator Name type.
       
    73 typedef RMmCustomAPI::TOperatorNameInfo TNWOperatorNameInfo;
       
    74 // Display of the registered PLMN. 
       
    75 typedef TUint32 TNWDisplayRequirementsFlags;
       
    76 
       
    77 
       
    78 enum TNWRegistrationStatus
       
    79     {
       
    80     ENWRegistrationUnknown,
       
    81     ENWNotRegisteredNoService,
       
    82     ENWNotRegisteredEmergencyOnly,
       
    83     ENWNotRegisteredSearching,
       
    84     ENWRegisteredBusy,
       
    85     ENWRegisteredOnHomeNetwork,
       
    86     ENWRegistrationDenied,
       
    87     ENWRegisteredRoaming
       
    88     };
       
    89 
       
    90 enum TNWMode
       
    91     {
       
    92     ENWModeUnknown,
       
    93     ENWModeUnregistered,
       
    94     ENWModeGsm,
       
    95     ENWModeAmps,
       
    96     ENWModeCdma95,
       
    97     ENWModeCdma2000,
       
    98     ENWModeWcdma,
       
    99     ENWModeTdcdma
       
   100     };
       
   101 
       
   102 enum TNWStatus
       
   103     {
       
   104     ENWStatusUnknown,
       
   105     ENWStatusAvailable,
       
   106     ENWStatusCurrent,
       
   107     ENWStatusForbidden
       
   108     };
       
   109 
       
   110 enum TNWDisplayRequirements
       
   111     {
       
   112     ENWDisplayPLMNNotRequired = 0x00000001,
       
   113     ENWDisplayPLMNRequired = 0x00000002,
       
   114     ENWDisplaySPNRequired = 0x00000004,
       
   115     ENWDisplaySPNNotRequired = 0x00000008
       
   116     };
       
   117 
       
   118 enum TNWViagIndicatorType //enum for viag indicator type
       
   119     {
       
   120     ENWViagIndicatorTypeNone,
       
   121     ENWViagIndicatorTypeHomeZone,
       
   122     ENWViagIndicatorTypeCityZone
       
   123     };
       
   124 
       
   125 enum TNWMCNIndicatorType //enum for mcn indicator type
       
   126     {
       
   127     ENWMCNIndicatorTypeNone,
       
   128     ENWMCNIndicatorTypeActive
       
   129     };
       
   130 
       
   131 // CDMA enumerations for TNWInfo
       
   132 enum TNWNoServiceMode
       
   133     {
       
   134     ENWNotRegisteredOutOfRange,
       
   135     ENWNotRegisteredPowerSaveMode
       
   136     };
       
   137 
       
   138 // CDMA enumerations for TNWInfo
       
   139 enum TNWVoicePrivacyStatus
       
   140     {
       
   141     ENWVoicePrivacyStatusOff,
       
   142     ENWVoicePrivacyStatusOn,
       
   143     ENWVoicePrivacyStatusUnknown
       
   144     };
       
   145 
       
   146 enum TNWRead
       
   147     {
       
   148     ESPNEFRead,
       
   149     ENPNEFRead,
       
   150     EProgEFRead,
       
   151     EViagEFRead,
       
   152     EFullFileChange
       
   153     };
       
   154 
       
   155 #ifdef RD_PHONE_NG
       
   156 enum TNWNetworkSelectionSetting
       
   157     {
       
   158     ENWNetworkSelectionUnknown,
       
   159     ENWNetworkSelectionAutomatic,
       
   160     ENWNetworkSelectionManual
       
   161     };    
       
   162 #endif // RD_PHONE_RG
       
   163 // CLASS DECLARATION
       
   164 
       
   165 //Network info definition
       
   166 struct TNWInfo
       
   167     {
       
   168     TNWRegistrationStatus iRegistrationStatus;              // Network registration status
       
   169     TNWMode iNetworkMode;                                   // Mode of the network
       
   170     TNWStatus iStatus;                                      // Status of the Network
       
   171     TNWCountryCode iCountryCode;                            // MCC in GSM and TDMA 
       
   172     TNWIdentity iNetworkId;                                 // MNC in GSM and SID in TDMA
       
   173     TNWDisplayTag iDisplayTag;                              // Network Alpha-tag
       
   174     TNWShortName iShortName;                                // The short name of the operator
       
   175     TNWLongName iLongName;                                  // The long name of the operator
       
   176     TNWViagIndicatorType iViagIndicatorType;                // Zone indicator type
       
   177     TNWViagTextTag iViagTextTag;                            // Viag text tag
       
   178     TNWMCNIndicatorType iMCNIndicatorType;                  // MCN indicator type
       
   179     TNWMCNName iMCNName;                                    // MCN name
       
   180     TNWServiceProviderName iSPName;                         // Service provider name
       
   181     TNWDisplayRequirementsFlags iServiceProviderNameDisplayReq; // Service provider name display required
       
   182     TNWProviderName iNPName;                                // Network provider name
       
   183     TNWOperatorNameInfo iOperatorNameInfo;                  // Operator name
       
   184     TNWNoServiceMode iNoServerMode;                         // 
       
   185     TNWVoicePrivacyStatus iVoicePrivacyStatus;              // Voice Privacy Status
       
   186     TNWPLMNField iPLMNField;                                // Contains a number of PLMN network names coded as TLV objects
       
   187 #ifdef RD_PHONE_NG
       
   188     TNWNetworkSelectionSetting iSelectionSetting;           // Contains a network selection setting manual/automatic etc.
       
   189 #endif // RD_PHONE_NG
       
   190     };
       
   191 
       
   192 // CLASS DECLARATION
       
   193 
       
   194 /**
       
   195 *  Offers message interface from network handling to client
       
   196 *  
       
   197 *  @lib networkhandling.lib
       
   198 *  @since Series 60_2.8
       
   199 */
       
   200 class MNWMessageObserver
       
   201     {
       
   202     public:
       
   203 
       
   204         enum TNWMessages
       
   205             {
       
   206             // COMMON NETWORK MESSAGES                      0 - 99
       
   207 
       
   208             // Message will be sent when current network information changed
       
   209             ENWMessageNetworkInfoChange,
       
   210             // Message will be sent when network mode changed (e.g.Gsm to Wcdma )
       
   211             ENWMessageNetworkModeChange,
       
   212             // Message will be sent when network registration status changed
       
   213             ENWMessageNetworkRegistrationStatusChange,
       
   214             // Message will be sent when programmable operator name changed
       
   215             ENWMessageProgrammableOperatorInfoChange,
       
   216             // Message will be sent when network provider changed
       
   217             ENWMessageNetworkProviderNameChange,
       
   218             // Message will be sent when service provider changed
       
   219             ENWMessageServiceProviderNameChange,
       
   220             // Message will be sent when NW starts update Operator Name Info
       
   221             ENWMessageProgrammableOperatorInfoUpdating,
       
   222             // Message will be sent when NW starts update Network Service Provider Name
       
   223             ENWMessageNetworkProviderNameUpdating,
       
   224             // Message will be sent when NW starts update Service Provider Name
       
   225             ENWMessageServiceProviderNameUpdating,
       
   226             // Message will be sent when allow refresh is called.
       
   227             ENWMessageAllowRefresh,
       
   228             // Message will be sent when networkSelection setting changed
       
   229 #ifdef RD_PHONE_NG
       
   230             ENWMessageNetworkSelectionSettingChange,
       
   231 #endif // RD_PHONE_NG
       
   232 
       
   233             // GSM SPECIFIC MESSAGES                        100 - 199
       
   234 
       
   235             // Message will be sent when cell re-selection occured
       
   236             ENWMessageNetworkCellReselection              = 100,
       
   237             // Message will be sent when network connection failured
       
   238             ENWMessageNetworkConnectionFailure,
       
   239             // Message will be sent when MCN CBS message was reveived
       
   240             ENWMessageCurrentCellInfoMessage,
       
   241             // Message will be sent when Viag CBS message was reveived
       
   242             // and completely handled.
       
   243             ENWMessageCurrentHomeZoneMessage,
       
   244             // Message will be sent when cell info display changed
       
   245             ENWMessageNetworkIndicatorChange, 
       
   246 
       
   247             // CDMA SPECIFIC MESSAGES                       200 - 299
       
   248 
       
   249             ENWMessageNetworkEmergencyMode                = 200,
       
   250             ENWMessageVoicePrivacyStatusChange,
       
   251             ENWMessageStartSystemSearchRequestCompleteOk,
       
   252             ENWMessageStartSystemSearchRequestCompleteFail,
       
   253             ENWMessageStopProtocolStackRequestCompleteOk,
       
   254             ENWMessageStopProtocolStackRequestCompleteFail
       
   255 
       
   256            };
       
   257 
       
   258         enum TNWOperation
       
   259             {
       
   260             ENWNone,
       
   261             // Fetching Service Provider Name
       
   262             ENWGetServiceProviderName,
       
   263             // Fetching Network Provider Name
       
   264             ENWGetNetworkProviderName,
       
   265             // Fetching Programmable Operator Name
       
   266             ENWGetProgrammableOperatorName
       
   267             };
       
   268 
       
   269         /**
       
   270         * Offers message interface to the client
       
   271         * @param aMessage 
       
   272         * This methods execute time must be short,since code 
       
   273         * starting to run from RunL.
       
   274         */
       
   275         virtual void HandleNetworkMessage( const TNWMessages aMessage ) = 0;
       
   276 
       
   277         /**
       
   278         * Offers error message interface to the client
       
   279         * @param aOperation operation which failed
       
   280         * @param aErrorCode returned Symbian OS error code
       
   281         * 
       
   282         */
       
   283         virtual void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ) = 0;
       
   284     };
       
   285 
       
   286 
       
   287 #endif      // NWHandlingEngine_H   
       
   288             
       
   289 // End of File