phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.cpp
changeset 27 2f8f8080a020
equal deleted inserted replaced
22:6bb1b21d2484 27:2f8f8080a020
       
     1 /*
       
     2 * Copyright (c) 2010 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 // System includes
       
    18 
       
    19 // User includes
       
    20 
       
    21 #include "cellulardatasettings.h"
       
    22 #include "cellulardatasettings_s60_p.h"
       
    23 #include "cppluginlogging.h"
       
    24 
       
    25 /*!
       
    26     \class CellularDataSettings
       
    27     \brief Class for maintaining and updating the Cellular Data Settings.
       
    28 
       
    29 */
       
    30 
       
    31 // External function prototypes
       
    32 
       
    33 // Local constants
       
    34 
       
    35 // ======== LOCAL FUNCTIONS ========
       
    36 
       
    37 // ======== MEMBER FUNCTIONS ========
       
    38 
       
    39 /*!
       
    40     Constructor.
       
    41 */
       
    42 
       
    43 CellularDataSettings::CellularDataSettings() :
       
    44     QObject(),
       
    45     d_ptr(new CellularDataSettingsPrivate(this))
       
    46 {
       
    47     DPRINT;
       
    48 }
       
    49 
       
    50 /*!
       
    51     Destructor.
       
    52 */
       
    53 
       
    54 CellularDataSettings::~CellularDataSettings()
       
    55 {
       
    56     DPRINT << ": IN";
       
    57     
       
    58     delete d_ptr;
       
    59     
       
    60     DPRINT << ": OUT";
       
    61 }
       
    62 
       
    63 /*!
       
    64     Getter for setting "Cellular data usage in home network".
       
    65 */
       
    66 
       
    67 int CellularDataSettings::dataUseHome()
       
    68 {
       
    69     DPRINT;
       
    70     
       
    71     return d_ptr->dataUseHome();
       
    72 }
       
    73 
       
    74 /*!
       
    75     Setter for setting "Cellular data usage in home network".
       
    76 */
       
    77 
       
    78 void CellularDataSettings::setDataUseHome(int value)
       
    79 {
       
    80     DPRINT << ": IN";
       
    81     
       
    82     // The value must be valid
       
    83     Q_ASSERT(value <= DataUsageHomeWlanOnly);
       
    84     d_ptr->setDataUseHome(value);
       
    85     
       
    86     DPRINT << ": OUT";
       
    87 }
       
    88     
       
    89 /*!
       
    90     Getter for setting "Cellular data usage when roaming".
       
    91 */
       
    92 
       
    93 int CellularDataSettings::dataUseRoam()
       
    94 {
       
    95     DPRINT;
       
    96     
       
    97     return d_ptr->dataUseRoam();
       
    98 }
       
    99 
       
   100 /*!
       
   101     Getter for setting "Cellular data usage when roaming".
       
   102 */
       
   103 
       
   104 void CellularDataSettings::setDataUseRoam(int value)
       
   105 {
       
   106     DPRINT << ": IN";
       
   107     
       
   108     // The value must be valid
       
   109     Q_ASSERT(value <= DataUsageAbroadWlanOnly);
       
   110     d_ptr->setDataUseRoam(value);
       
   111     
       
   112     DPRINT << ": OUT";
       
   113 }