cellular/telephonysettings/xqbindings/psetwrapper/src/psetnetworkwrapper.cpp
changeset 12 ae8abd0db65c
child 13 e32024264ebb
equal deleted inserted replaced
0:ff3b6d0fd310 12:ae8abd0db65c
       
     1 /*
       
     2  * Copyright (c) 2009 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  *
       
    16  */
       
    17 
       
    18 #include <QtGlobal>
       
    19 #include "psetnetworkwrapper.h"
       
    20 #include "psetnetworkwrapper_p.h"
       
    21 #include "logging.h"
       
    22 
       
    23 /*!
       
    24     \class PSetNetworkWrapper
       
    25     \brief TODO: description
       
    26 */
       
    27 
       
    28 /*!
       
    29     \enum PSetNetworkWrapper::ErrorCode
       
    30     
       
    31     This enumeration defines error codes used by PSetNetworkWrapper.
       
    32 */
       
    33 /*!
       
    34     \var PSetNetworkWrapper::ErrNoError
       
    35          Indicates that no error has happened.
       
    36 */
       
    37 
       
    38 // TODO: better commenting for NetworkAccessMode enumeration
       
    39 /*!
       
    40     \enum NetworkAccessMode
       
    41     This enumeration defines possible network access modes.
       
    42 */
       
    43 /*!
       
    44     \var PSetNetworkWrapper::AccessModeDual
       
    45          Dual mode.
       
    46 */
       
    47 /*!
       
    48     \var PSetNetworkWrapper::AccessModeUmts
       
    49          3g/UMTS network mode.
       
    50 */
       
    51 /*!
       
    52     \var PSetNetworkWrapper::AccessModeGsm
       
    53          2g/GSM network mode.
       
    54 */
       
    55 
       
    56 /*! 
       
    57      \struct PSetNetworkWrapper::NetworkId
       
    58      NetworkId contains network and country identifiers. 
       
    59 */
       
    60 // TODO: is that valid way to document struct members
       
    61 /*!
       
    62     \var PSetNetworkWrapper::NetworkId::m_countryCode
       
    63          Country code. Maximum length is 4.
       
    64 */
       
    65 /*!
       
    66     \var PSetNetworkWrapper::NetworkId::m_networkCode
       
    67          Network code. Maximum length is 8.
       
    68 */
       
    69 
       
    70 /*!
       
    71     \enum PSetNetworkWrapper::NetworkSelectionMode
       
    72     Network selection mode.
       
    73 */
       
    74 /*!
       
    75     \var PSetNetworkWrapper::SelectionModeManual
       
    76          Specific network is selected manually.
       
    77 */
       
    78 /*!
       
    79     \var PSetNetworkWrapper::SelectionModeAutomatic
       
    80          Network is selected automatically without user interaction.
       
    81 */
       
    82 
       
    83 /*!
       
    84     \enum PSetNetworkWrapper::NetworkStatus
       
    85     Status of a network.
       
    86 */
       
    87 // TODO: enumerator comments
       
    88 /*!
       
    89     \var PSetNetworkWrapper::StatusUnknown
       
    90 */
       
    91 /*!
       
    92     \var PSetNetworkWrapper::StatusAvailable
       
    93 */
       
    94 /*!
       
    95     \var PSetNetworkWrapper::StatusCurrent
       
    96 */
       
    97 /*!
       
    98     \var PSetNetworkWrapper::StatusForbidden
       
    99 */
       
   100 
       
   101 /*!
       
   102     \enum PSetNetworkWrapper::NetworkAccessType
       
   103     Network access type.
       
   104 */
       
   105 // TODO: enumerator comments
       
   106 /*!
       
   107     \var PSetNetworkWrapper::AccessTypeGsm
       
   108 */
       
   109 /*!
       
   110     \var PSetNetworkWrapper::AccessTypeWcdma
       
   111 */
       
   112 
       
   113 /*! 
       
   114      \struct PSetNetworkWrapper::NetworkInfo
       
   115      Encapsulates information about network.
       
   116 */
       
   117 // TODO: struct member commenting
       
   118 
       
   119 /*! void PSetNetworkWrapper::networkAccessModeGot(
       
   120         PSetNetworkWrapper::NetworkAccessMode mode)
       
   121     
       
   122     This signal is emitted when the current network access mode query has been
       
   123     completed. 
       
   124 */
       
   125 
       
   126 /*!
       
   127   PSetNetworkWrapper::PSetNetworkWrapper
       
   128  */
       
   129 PSetNetworkWrapper::PSetNetworkWrapper(
       
   130     CPsetContainer &psetContainer, QObject *parent) 
       
   131     :
       
   132     QObject(parent), 
       
   133     m_privateImpl(new PSetNetworkWrapperPrivate(*this, psetContainer))
       
   134 {
       
   135     DPRINT << ": IN";
       
   136     
       
   137     Q_CHECK_PTR(m_privateImpl);
       
   138     
       
   139     DPRINT << ": OUT";
       
   140 }
       
   141 
       
   142 /*!
       
   143   PSetNetworkWrapper::~PSetNetworkWrapper
       
   144  */
       
   145 PSetNetworkWrapper::~PSetNetworkWrapper()
       
   146 {
       
   147     DPRINT << ": IN";
       
   148     
       
   149     delete m_privateImpl;
       
   150     
       
   151     DPRINT << ": OUT";
       
   152 }
       
   153 
       
   154 /*!
       
   155     Puts network retrieve results into array.
       
   156 */
       
   157 void PSetNetworkWrapper::getAvailableNetworks()
       
   158 {
       
   159     DPRINT;
       
   160     
       
   161     m_privateImpl->getAvailableNetworks();
       
   162 }
       
   163 
       
   164 /*!
       
   165     Returns current network selection mode.
       
   166     
       
   167     \param  aMode   Network selection mode.
       
   168     \return Error code.
       
   169 */
       
   170 PSetNetworkWrapper::ErrorCode PSetNetworkWrapper::getNetworkSelectionMode(
       
   171     PSetNetworkWrapper::NetworkSelectionMode& mode) const
       
   172 {
       
   173     DPRINT;
       
   174     
       
   175     return m_privateImpl->getNetworkSelectionMode(mode);
       
   176 }
       
   177 
       
   178 /*!
       
   179     Selects network, also for selecting automatic/manual mode.
       
   180     \param   aInfo   Network information.
       
   181 */
       
   182 void PSetNetworkWrapper::selectNetwork( 
       
   183     const PSetNetworkWrapper::NetworkInfo& info)
       
   184 {
       
   185     DPRINT;
       
   186     
       
   187     m_privateImpl->selectNetwork(info);
       
   188 }
       
   189 
       
   190 /*!
       
   191     Cancels ongoing request if any.
       
   192 */
       
   193 void PSetNetworkWrapper::cancelRequest()
       
   194 {
       
   195     DPRINT;
       
   196     
       
   197     m_privateImpl->cancelRequest();
       
   198 }
       
   199 
       
   200 /*!
       
   201     Starts to query network access mode. Result is informed with a
       
   202     networkAccessModeGot() signal.
       
   203 */
       
   204 void PSetNetworkWrapper::getNetworkAccessMode() const
       
   205 {
       
   206     DPRINT;
       
   207     
       
   208     m_privateImpl->getNetworkAccessMode();
       
   209 }
       
   210 
       
   211 /*!
       
   212   Sets network access mode.
       
   213   \param  mode    Network access mode. 
       
   214   \return ErrorCode.
       
   215 */
       
   216 void PSetNetworkWrapper::setNetworkAccessMode(
       
   217     PSetNetworkWrapper::NetworkAccessMode mode)
       
   218 {
       
   219     DPRINT;
       
   220     
       
   221     m_privateImpl->setNetworkAccessMode(mode);
       
   222 }
       
   223 
       
   224 // End of File.