radioapp/radioenginewrapper/inc/radiosettings_p.h
branchRCL_3
changeset 19 cce62ebc198e
equal deleted inserted replaced
18:1a6714c53019 19:cce62ebc198e
       
     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 #ifndef RADIOSETTINGS_P_H_
       
    19 #define RADIOSETTINGS_P_H_
       
    20 
       
    21 class MRadioApplicationSettings;
       
    22 
       
    23 class RadioSettingsPrivate
       
    24 {
       
    25     Q_DECLARE_PUBLIC( RadioSettings )
       
    26     Q_DISABLE_COPY( RadioSettingsPrivate )
       
    27 
       
    28     /**
       
    29      * On/Off type flags.
       
    30      *
       
    31      * Bit shifting in the value initialization is used to easily create
       
    32      * progressing bit patterns like so:
       
    33      *  1 << 0 equals 0001 equals 0x1
       
    34      *  1 << 1 equals 0010 equals 0x2
       
    35      *  1 << 2 equals 0100 equals 0x4
       
    36      *  1 << 3 equals 1000 equals 0x8
       
    37      */
       
    38     enum ToggleFlag
       
    39     {
       
    40         EShowFavorites  = 1 << 0
       
    41     };
       
    42     Q_DECLARE_FLAGS( Toggles, ToggleFlag )
       
    43 
       
    44 public:
       
    45 
       
    46     RadioSettingsPrivate( RadioSettings* settingsPublic );
       
    47 
       
    48     ~RadioSettingsPrivate();
       
    49 
       
    50     void init( MRadioApplicationSettings* storage );
       
    51 
       
    52     // First time start
       
    53     bool isFirstTimeStart();
       
    54     void setFirstTimeStartPerformed( bool firstTimeStartPerformed );
       
    55 
       
    56     bool isFlagSet( ToggleFlag flag ) const;
       
    57     void toggleFlag( ToggleFlag flag );
       
    58     void saveFlags();
       
    59 
       
    60 private: // data
       
    61 
       
    62     /**
       
    63      * Pointer to the public class
       
    64      * Not own.
       
    65      */
       
    66     RadioSettings*              q_ptr;
       
    67 
       
    68     Toggles                     mFlags;
       
    69 
       
    70     MRadioApplicationSettings*  mSettingsStorage;
       
    71 
       
    72 };
       
    73 
       
    74 #endif // RADIOSETTINGS_P_H_