phonesrv_plat/phone_settings_api/inc/MPsetNetworkSelect.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *       MPsetNetworkSelect defines interface to get network information and  
       
    16 *       select network. MPsetNetworkInfoObserver is used to handle completion 
       
    17 *       of function calls of this class. All the methods are asynchronous.    
       
    18 *       Observer handles completion                                           
       
    19 *
       
    20 *
       
    21 */
       
    22 
       
    23 
       
    24 #ifndef     MPSETNETWORKSELECT_H
       
    25 #define     MPSETNETWORKSELECT_H
       
    26 
       
    27 //  INCLUDES
       
    28 #include <e32base.h>
       
    29 
       
    30 //  FORWARD DECLARATIONS
       
    31 class MPsetNetworkInfoObserver;
       
    32 
       
    33 //  CLASS DEFINITIONS 
       
    34 /**
       
    35 *  MPsetNetworkSelect class is virtual class for network selection.
       
    36 *  @lib phonesettings.lib
       
    37 *  @since 1.0
       
    38 */
       
    39 class   MPsetNetworkSelect
       
    40     {
       
    41     public:
       
    42 
       
    43         //Length of codes (MNC and MCC)
       
    44         enum
       
    45             {
       
    46             EPSetNetMcc = 4,
       
    47             EPSetNetMnc = 8
       
    48             };
       
    49 
       
    50         //TNetworkId contains network ID and country ID
       
    51         struct TNetworkId
       
    52             {
       
    53             TBuf<EPSetNetMcc> iCountryCode;
       
    54             TBuf<EPSetNetMnc> iNetworkCode;
       
    55             };
       
    56 
       
    57         //Length of network names
       
    58         enum
       
    59             {
       
    60             ENetShortNameSize = 20,
       
    61             ENetLongNameSize = 30
       
    62             };
       
    63 
       
    64         //Network selection mode
       
    65         enum TSelectMode
       
    66             {
       
    67             ENetSelectModeAutomatic,
       
    68             ENetSelectModeManual
       
    69             };
       
    70 
       
    71         //Status of network
       
    72         enum TNetworkStatus
       
    73             {
       
    74             ENetStatUnknown,
       
    75             ENetStatAvailable,
       
    76             ENetStatCurrent,
       
    77             ENetStatForbidden
       
    78             };
       
    79         //Network access type
       
    80         enum TNetworkAccess
       
    81             {
       
    82             ENetNetworkGSM,
       
    83             ENetNetworkWCDMA,
       
    84             ENetNetworkGSMandWCDMA
       
    85             };
       
    86 
       
    87         //Information about network
       
    88         struct TNetworkInfo
       
    89             {
       
    90             TNetworkId iId;
       
    91             TNetworkStatus iStatus;
       
    92             TSelectMode iMode;
       
    93             TNetworkAccess iAccess;
       
    94             TBuf<ENetShortNameSize> iShortName;
       
    95             TBuf<ENetLongNameSize> iLongName;
       
    96             };        
       
    97 
       
    98         //Current status of the network
       
    99         enum TCurrentNetworkStatus
       
   100             {
       
   101             ENotRegisteredNotSearching,
       
   102             ERegisteredOnHomeNetwork,
       
   103             ENotRegisteredSearching,
       
   104             ERegistrationDenied,
       
   105             EUnknown,
       
   106             ERegisteredRoaming
       
   107             };
       
   108 
       
   109         //Current information about the network
       
   110         struct TCurrentNetworkInfo
       
   111             {
       
   112             TCurrentNetworkStatus iStatus;
       
   113             TUint iLocationAreaCode;
       
   114             TUint iCellId;
       
   115             };
       
   116 
       
   117     public:
       
   118   
       
   119         /**
       
   120         * Puts network retrieve results into array.
       
   121         *
       
   122         */
       
   123         virtual void GetAvailableNetworksL() = 0; 
       
   124           
       
   125         /**
       
   126         * Returns current network information.
       
   127         *
       
   128         * @param aInfo Current network information
       
   129         * @return Returns error code.
       
   130         */
       
   131         virtual TInt GetCurrentNetworkInfo( 
       
   132             MPsetNetworkSelect::TCurrentNetworkInfo& aInfo ) = 0;
       
   133           
       
   134         /**
       
   135         * Returns current network selection mode.
       
   136         *
       
   137         * @param aMode Network selection mode
       
   138         * @return Returns error code.
       
   139         */
       
   140         virtual TInt GetNetworkSelectMode( TSelectMode& aMode) = 0;
       
   141           
       
   142         /**
       
   143         * Sets network, also for selecting automatic/manual mode.
       
   144         *
       
   145         * @param aInfo Network information
       
   146         */
       
   147         virtual void SelectNetworkL( const TNetworkInfo& aInfo ) = 0;
       
   148           
       
   149         /**
       
   150         * CancelProcess-function, cancels the requests.
       
   151         */
       
   152         virtual void CancelProcess() = 0;
       
   153     };
       
   154 
       
   155 #endif // MPSETNETWORKSELECT_H
       
   156 // end of file