phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetpreferences.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 14:58:25 +0300
changeset 22 6bb1b21d2484
child 27 2f8f8080a020
permissions -rw-r--r--
Revision: 201011 Kit: 201015

/*
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
 *
 * Contributors:
 *
 * Description:  
 *
 */

#ifndef INFOWIDGETPREFERENCES_H
#define INFOWIDGETPREFERENCES_H

#include <QObject>
#include <QFlags>

// Preference string values
const char DISPLAY_SETTING_ON[]    = "On";
const char DISPLAY_SETTING_OFF[]     = "Off";

class InfoWidgetPreferences : public QObject
{
    Q_OBJECT

public: 
    enum DisplaySetting {
        DisplayOff = 0, 
        DisplayOn    
    }; 
    
    enum Option {
        DisplayHomeZone = 0x1,
        DisplayMcn = 0x2,
        DisplayActiveLine = 0x4, 
        DisplaySatText = 0x8 
    };
    Q_DECLARE_FLAGS(Options, Option)

public:
    InfoWidgetPreferences(QObject *parent = NULL);
    ~InfoWidgetPreferences();

    void loadPreferences();
    void storePreferences();
    
public:
    QString preference(Option preferenceId) const;
    void setPreference(Option preferenceId, const QString &preferenceString);
    
    int visibleItemCount(); 
    
private:
    Q_DISABLE_COPY(InfoWidgetPreferences)

    InfoWidgetPreferences::Options m_options; 
};

Q_DECLARE_OPERATORS_FOR_FLAGS(InfoWidgetPreferences::Options)

#endif // INFOWIDGETPREFERENCES_H