fmradio/fmradio/src/fmradiopreset.cpp
changeset 0 f3d95d9c00ab
child 6 3cb097cb90f8
equal deleted inserted replaced
-1:000000000000 0:f3d95d9c00ab
       
     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:  fmradio preset station information
       
    15 *
       
    16 */
       
    17 
       
    18 #include "fmradiopreset.h"
       
    19 
       
    20 // ======== MEMBER FUNCTIONS ========
       
    21 
       
    22 // ----------------------------------------------------------------------------
       
    23 // CFMRadioPreset::CFMRadioPreset
       
    24 // Default constructor
       
    25 // ----------------------------------------------------------------------------
       
    26 //
       
    27 CFMRadioPreset::CFMRadioPreset() : iNameIsValid( ETrue )
       
    28     {
       
    29     }
       
    30 
       
    31 // ---------------------------------------------------------------------------
       
    32 // CFMRadioPreset::ConstructL
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 void CFMRadioPreset::ConstructL()
       
    36     {
       
    37     }
       
    38 
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // CFMRadioPreset::NewL
       
    42 // Two-phase constructor of CFMRadioPreset
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 CFMRadioPreset* CFMRadioPreset::NewL() 
       
    46     {
       
    47     CFMRadioPreset* self = new ( ELeave ) CFMRadioPreset;
       
    48     CleanupStack::PushL( self );
       
    49     self->ConstructL();
       
    50     CleanupStack::Pop( self );
       
    51     return self;
       
    52     }
       
    53 
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // CFMRadioPreset::~CFMRadioPreset
       
    57 // Destructor
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 CFMRadioPreset::~CFMRadioPreset()
       
    61     {
       
    62     iStationName.Close();
       
    63     }
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // CFMRadioPreset::SetPresetNameL
       
    67 // ---------------------------------------------------------------------------
       
    68 //
       
    69 void CFMRadioPreset::SetPresetNameL( const TDesC& aName )
       
    70     {
       
    71     iStationName.Close();
       
    72     iStationName.CreateL( aName );
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // CFMRadioPreset::PresetName
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 TDesC& CFMRadioPreset::PresetName()
       
    80     {
       
    81     return iStationName;
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // CFMRadioPreset::SetPresetNameValid
       
    86 // ---------------------------------------------------------------------------
       
    87 //
       
    88 void CFMRadioPreset::SetPresetNameValid( TBool aValid )
       
    89     {
       
    90     iNameIsValid = aValid;
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // CFMRadioPreset::PresetNameValid
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 TBool CFMRadioPreset::PresetNameValid()
       
    98     {
       
    99     return iNameIsValid;
       
   100     }
       
   101  
       
   102 // ---------------------------------------------------------------------------
       
   103 // CFMRadioPreset::SetPresetFrequency
       
   104 // ---------------------------------------------------------------------------
       
   105 //
       
   106 void CFMRadioPreset::SetPresetFrequency( TInt aFrequency  )
       
   107     {
       
   108     iStationFrequency = aFrequency;
       
   109     }
       
   110 
       
   111 // ---------------------------------------------------------------------------
       
   112 // CFMRadioPreset::PresetFrequency
       
   113 // ---------------------------------------------------------------------------
       
   114 //
       
   115 TInt CFMRadioPreset::PresetFrequency()
       
   116     {
       
   117     return iStationFrequency;
       
   118     }