radioapp/radioenginewrapper/src/radiosettings_p.cpp
branchRCL_3
changeset 20 93c594350b9a
parent 19 cce62ebc198e
equal deleted inserted replaced
19:cce62ebc198e 20:93c594350b9a
     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 "radiosettings.h"
       
    19 #include "radiosettings_p.h"
       
    20 #include "mradioapplicationsettings.h"
       
    21 
       
    22 
       
    23 /*!
       
    24  *
       
    25  */
       
    26 RadioSettingsPrivate::RadioSettingsPrivate( RadioSettings* settingsPublic ) :
       
    27     q_ptr( settingsPublic ),
       
    28     mFlags( 0 )
       
    29 {
       
    30 }
       
    31 
       
    32 /*!
       
    33  *
       
    34  */
       
    35 RadioSettingsPrivate::~RadioSettingsPrivate()
       
    36 {
       
    37 }
       
    38 
       
    39 /*!
       
    40  *
       
    41  */
       
    42 void RadioSettingsPrivate::init( MRadioApplicationSettings* storage )
       
    43 {
       
    44     mSettingsStorage = storage;
       
    45     if ( mSettingsStorage ) {
       
    46         mFlags = Toggles( mSettingsStorage->UiFlags() );
       
    47     }
       
    48 }
       
    49 
       
    50 /*!
       
    51  *
       
    52  */
       
    53 bool RadioSettingsPrivate::isFirstTimeStart()
       
    54 {
       
    55     if ( mSettingsStorage ) {
       
    56         return mSettingsStorage->IsFirstTimeStart();
       
    57     }
       
    58     return false;
       
    59 }
       
    60 
       
    61 /*!
       
    62  *
       
    63  */
       
    64 void RadioSettingsPrivate::setFirstTimeStartPerformed( bool firstTimeStartPerformed )
       
    65 {
       
    66     if ( mSettingsStorage ) {
       
    67         mSettingsStorage->SetFirstTimeStartPerformed( firstTimeStartPerformed );
       
    68     }
       
    69 }
       
    70 
       
    71 /*!
       
    72  *
       
    73  */
       
    74 bool RadioSettingsPrivate::isFlagSet( ToggleFlag flag ) const
       
    75 {
       
    76     return mFlags.testFlag( flag );
       
    77 }
       
    78 
       
    79 /*!
       
    80  *
       
    81  */
       
    82 void RadioSettingsPrivate::toggleFlag( ToggleFlag flag )
       
    83 {
       
    84     mFlags ^= flag;
       
    85 }
       
    86 
       
    87 /*!
       
    88  *
       
    89  */
       
    90 void RadioSettingsPrivate::saveFlags()
       
    91 {
       
    92     if ( mSettingsStorage ) {
       
    93         mSettingsStorage->SetUiFlags( mFlags );
       
    94     }
       
    95 }