phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetpreferences_s.cpp
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 40 bab96b7ed1a4
parent 46 bc5a64e5bc3c
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
     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 "infowidgetpreferences.h"
       
    19 #include "infowidgetlogging.h"
       
    20 
       
    21 // ---------------------------------------------------------------------------
       
    22 // ---------------------------------------------------------------------------
       
    23 //
       
    24 InfoWidgetPreferences::InfoWidgetPreferences(IHsWidgetPreferenceService &preferenceService, 
       
    25     QObject* parent)
       
    26     : QObject(parent)
       
    27 {
       
    28     DPRINT << "DUMMY IMPLEMENTATION";
       
    29 
       
    30     m_options = InfoWidgetPreferences::DisplayActiveLine|
       
    31             InfoWidgetPreferences::DisplayMcn|
       
    32             InfoWidgetPreferences::DisplaySatText|
       
    33             InfoWidgetPreferences::DisplayHomeZone;
       
    34 }
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 InfoWidgetPreferences::~InfoWidgetPreferences()
       
    40 {
       
    41     DPRINT << "DUMMY IMPLEMENTATION";
       
    42 }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 void InfoWidgetPreferences::loadPreferences()
       
    48 {
       
    49     DPRINT << "DUMMY IMPLEMENTATION";
       
    50 }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 void InfoWidgetPreferences::storePreferences()
       
    56 {
       
    57     DPRINT << "DUMMY IMPLEMENTATION";
       
    58 }
       
    59 
       
    60 
       
    61 /*!
       
    62     InfoWidgetPreferences::preference() 
       
    63 */
       
    64 QString InfoWidgetPreferences::preference(Option preferenceId)
       
    65 {
       
    66     DPRINT << "DUMMY IMPLEMENTATION";
       
    67     DPRINT << ": preference id: " << static_cast<int>(preferenceId); 
       
    68     
       
    69     QString preferenceString;
       
    70     if (m_options.testFlag(preferenceId)) {
       
    71         preferenceString = DISPLAY_SETTING_ON; 
       
    72     } else {
       
    73         preferenceString = DISPLAY_SETTING_OFF;  
       
    74     } 
       
    75     
       
    76     return preferenceString; 
       
    77 }
       
    78 
       
    79 /*!
       
    80     InfoWidgetPreferences::setPreference() 
       
    81 */
       
    82 void InfoWidgetPreferences::setPreference(Option preferenceId, 
       
    83         QString preferenceString)
       
    84 {
       
    85     DPRINT << "DUMMY IMPLEMENTATION";
       
    86     DPRINT << ": preference id: " << static_cast<int>(preferenceId);
       
    87     DPRINT << ": preference string: " << preferenceString; 
       
    88 
       
    89     DPRINT << ": initial options: " << m_options;
       
    90     
       
    91     if (preferenceString.compare(DISPLAY_SETTING_ON) == 0) {
       
    92         m_options |= preferenceId; 
       
    93     } else {
       
    94         m_options &= ~preferenceId; 
       
    95     }
       
    96     
       
    97     DPRINT << ": modified options: " << m_options;
       
    98 }
       
    99 
       
   100 // End of File.
       
   101