radioapp/radioenginewrapper/inc/radiosettings_p.h
changeset 13 46974bebc798
child 28 075425b8d9a4
equal deleted inserted replaced
0:f3d95d9c00ab 13:46974bebc798
       
     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 
       
    55     bool isFlagSet( ToggleFlag flag ) const;
       
    56     void toggleFlag( ToggleFlag flag );
       
    57     void saveFlags();
       
    58 
       
    59 private: // data
       
    60 
       
    61     /**
       
    62      * Pointer to the public class
       
    63      * Not own.
       
    64      */
       
    65     RadioSettings*              q_ptr;
       
    66 
       
    67     Toggles                     mFlags;
       
    68 
       
    69     MRadioApplicationSettings*  mSettingsStorage;
       
    70 
       
    71 };
       
    72 
       
    73 #endif // RADIOSETTINGS_P_H_