qtinternetradio/irqsettings/inc/irqsettings.h
changeset 14 896e9dbc5f19
parent 11 f683e24efca3
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:
    14  * Description:
    15 *
    15  *
    16 */
    16  */
    17 #ifndef IRQSETTINGS_H_
    17 #ifndef IRQSETTINGS_H_
    18 #define IRQSETTINGS_H_
    18 #define IRQSETTINGS_H_
    19 
    19 
    20 #include <QString>
    20 #include "irqsettingsexport.h"
    21 #include <etelmm.h>
       
    22 
       
    23 #include "irqenums.h"
    21 #include "irqenums.h"
    24 #include "irviewdefinitions.h"
    22 #include "irviewdefinitions.h"
       
    23 #include <QString>
       
    24 #include <QMutex>
    25 
    25 
    26 class CIRSettings;
    26 class IRQSettingsPrivate;
    27 
    27 
    28 /**
    28 /**
    29  * This class provides the interface to IR settings component
    29  * This class provides the interface to IR settings component
    30  *
    30  *
    31  * IRQSettings follows a singleton pattern
    31  * IRQSettings follows a singleton pattern
    32  * hence the destructor is private and to destroy it we need to use an API
    32  * hence the destructor is private and to destroy it we need to use an API
    33  *
    33  *
    34  */
    34  */
    35 
    35 
    36 class IRQSettings
    36 class IRQSETTINGS_DLL_EXPORT IRQSettings
    37 {
    37 {
    38 public:
    38 public:
    39 
    39 
    40     /**
    40     /**
    41      *  Get the instance of IRQSettings
    41      *  Get the instance of IRQSettings
    42      *  @return IRQSettings*
    42      *  @return IRQSettings*
    43      */
    43      */
    44     IMPORT_C static IRQSettings* openInstance();
    44     static IRQSettings* openInstance();
    45     IMPORT_C void closeInstance();
    45     void closeInstance();
    46 
    46 
    47     IMPORT_C bool isFlagTermsAndConditions(bool& aFlag);
    47     bool isFlagTermsAndConditions(bool& aFlag);
    48     IMPORT_C void setFlagTermsAndConditions();
    48     void setFlagTermsAndConditions();
    49     IMPORT_C void reSetFlagTermsAndConditions();
    49     void reSetFlagTermsAndConditions();
    50 
    50 
    51     IMPORT_C bool getIRID(QString& aIRID);
    51     bool getIRID(QString& aIRID);
    52     IMPORT_C int getVolumeSetting();
    52     int getVolumeSetting();
    53     IMPORT_C void setVolumeSetting(int aPlayVolume);
    53     void setVolumeSetting(int aPlayVolume);
    54     IMPORT_C void setTimeOut(int aTimeOut);
    54     void setTimeOut(int aTimeOut);
    55     IMPORT_C int getTimeOut();
    55     int getTimeOut();
    56     IMPORT_C void setMaxPresetCount(int aMaxCount);
    56     QString privatePath();
    57     IMPORT_C int maxPresetCount();
    57     int getSongHistoryShow();
    58     IMPORT_C QString privatePath();
    58     void setSongHistoryShow(int aShowFlag);
    59     IMPORT_C int getSongHistoryShow();
       
    60     IMPORT_C void setSongHistoryShow(int aShowFlag);
       
    61 
    59 
    62     /**
    60     /**
    63      * setStartingViewId()
    61      * setStartingViewId()
    64      * Sets the starting view Id in cenrep
    62      * Sets the starting view Id in cenrep
    65      */
    63      */
    66     IMPORT_C void setStartingViewId(unsigned long aStartingViewId);
    64     void setStartingViewId(int aStartingViewId);
    67 
    65 
    68     /**
    66     /**
    69      * getStartingViewId()
    67      * getStartingViewId()
    70      * Gets the starting view Id from cenrep
    68      * Gets the starting view Id from cenrep
    71      */
    69      */
    72     IMPORT_C bool getStartingViewId(TIRViewId& aStartingViewId);
    70     bool getStartingViewId(TIRViewId& aStartingViewId);
    73              
    71 
    74     IMPORT_C void setPreferredQuality(IRQPreferredQuality aQualityValue);
    72     void setPreferredQuality(IRQPreferredQuality aQualityValue);
    75 
    73 
    76     /**
    74     /**
    77      * getPreferredQuality()
    75      * getPreferredQuality()
    78      * Gets the Preferred Quality from cenrep
    76      * Gets the Preferred Quality from cenrep
    79      */    
    77      */
    80     IMPORT_C IRQPreferredQuality getPreferredQuality() const;      
    78     IRQPreferredQuality getPreferredQuality() const;
    81 
    79 
    82     /**
    80     /**
    83      * getGlobalAdvFlag()
    81      * getGlobalAdvFlag()
    84      * Gets the global adv flag from cenrep. True: enable NAE adv
    82      * Gets the global adv flag from cenrep. True: enable NAE adv
    85      */
    83      */
    86     IMPORT_C bool getGlobalAdvFlag(bool& aFlag);
    84     bool getGlobalAdvFlag(bool& aFlag);
    87 
    85 
    88     IMPORT_C bool getManuallyInputtedStationUrl(QString& aUrl);
    86     bool getManuallyInputtedStationUrl(QString& aUrl);
    89     IMPORT_C void setManuallyInputtedStationUrl(const QString& aUrl);
    87     void setManuallyInputtedStationUrl(const QString& aUrl);
    90     IMPORT_C bool getManuallyInputtedStationName(QString& aName);
    88     bool getManuallyInputtedStationName(QString& aName);
    91     IMPORT_C void setManuallyInputtedStationName(const QString& aName);
    89     void setManuallyInputtedStationName(const QString& aName);
       
    90     bool getSearchText(QString& aSearchText);
       
    91     void setSearchText(const QString& aSearchText);
       
    92     
       
    93     int getMinDiskSpaceRequired();    
       
    94     bool getIdentifySongEnabled();
       
    95     int getSongRecognitionAppUid();
       
    96     QString getIsdsUrl();
       
    97     
    92 private:
    98 private:
    93 
    99 
    94     /**
   100     /**
    95      *  Default constructor must be private
   101      *  Default constructor must be private
    96 	 */
   102      */
    97     IRQSettings();
   103     IRQSettings();
    98 
   104 
    99     ~IRQSettings();
   105     ~IRQSettings();
   100 
   106 
   101     /**
       
   102      *  Creates IRQSettings instance
       
   103      */
       
   104     static IRQSettings* createInstance();
       
   105 	static void doCreateInstanceL(IRQSettings * aQsettings);
       
   106     
       
   107     void constructL();
       
   108 
       
   109 private:
   107 private:
   110 
   108 
   111     /**
   109     /**
   112      *  IRQSettings singleton instance
   110      *  IRQSettingsPrivate instance
   113      */
   111      */
   114     CIRSettings* iSettings;
   112     IRQSettingsPrivate* const d_ptr;
   115 
   113 
   116     /**
   114     /**
   117      * Number of objects currently referring to the singleton object IRQSettings
   115      * Number of objects currently referring to the singleton object IRQSettings
   118      */
   116      */
   119     int iSingletonInstances;
   117     int mRefCount;
       
   118 
       
   119     /**
       
   120      * The instance of IRQSettings singleton
       
   121      */
       
   122     static IRQSettings *mInstance;
       
   123 
       
   124     /**
       
   125      * Mutex for the thread-safe of openInstance()
       
   126      */
       
   127     static QMutex mMutex;
   120 };
   128 };
   121 
   129 
   122 #endif /* IRQSETTINGS_H_ */
   130 #endif /* IRQSETTINGS_H_ */