phonesrv_plat/phone_settings_api/inc/MPsetNetworkSelect.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     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             };
       
    85 
       
    86         //Information about network
       
    87         struct TNetworkInfo
       
    88             {
       
    89             TNetworkId iId;
       
    90             TNetworkStatus iStatus;
       
    91             TSelectMode iMode;
       
    92             TNetworkAccess iAccess;
       
    93             TBuf<ENetShortNameSize> iShortName;
       
    94             TBuf<ENetLongNameSize> iLongName;
       
    95             };        
       
    96 
       
    97         //Current status of the network
       
    98         enum TCurrentNetworkStatus
       
    99             {
       
   100             ENotRegisteredNotSearching,
       
   101             ERegisteredOnHomeNetwork,
       
   102             ENotRegisteredSearching,
       
   103             ERegistrationDenied,
       
   104             EUnknown,
       
   105             ERegisteredRoaming
       
   106             };
       
   107 
       
   108         //Current information about the network
       
   109         struct TCurrentNetworkInfo
       
   110             {
       
   111             TCurrentNetworkStatus iStatus;
       
   112             TUint iLocationAreaCode;
       
   113             TUint iCellId;
       
   114             };
       
   115 
       
   116     public:
       
   117   
       
   118         /**
       
   119         * Puts network retrieve results into array.
       
   120         *
       
   121         */
       
   122         virtual void GetAvailableNetworksL() = 0; 
       
   123           
       
   124         /**
       
   125         * Returns current network information.
       
   126         *
       
   127         * @param aInfo Current network information
       
   128         * @return Returns error code.
       
   129         */
       
   130         virtual TInt GetCurrentNetworkInfo( 
       
   131             MPsetNetworkSelect::TCurrentNetworkInfo& aInfo ) = 0;
       
   132           
       
   133         /**
       
   134         * Returns current network selection mode.
       
   135         *
       
   136         * @param aMode Network selection mode
       
   137         * @return Returns error code.
       
   138         */
       
   139         virtual TInt GetNetworkSelectMode( TSelectMode& aMode) = 0;
       
   140           
       
   141         /**
       
   142         * Sets network, also for selecting automatic/manual mode.
       
   143         *
       
   144         * @param aInfo Network information
       
   145         */
       
   146         virtual void SelectNetworkL( const TNetworkInfo& aInfo ) = 0;
       
   147           
       
   148         /**
       
   149         * CancelProcess-function, cancels the requests.
       
   150         */
       
   151         virtual void CancelProcess() = 0;
       
   152     };
       
   153 
       
   154 #endif // MPSETNETWORKSELECT_H
       
   155 // end of file