phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpplugincommon.h
changeset 21 92ab7f8d0eab
child 22 6bb1b21d2484
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     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 CPPLUGINCOMMON_H
       
    19 #define CPPLUGINCOMMON_H
       
    20 
       
    21 #include <qvariant.h>
       
    22 #include "cptelephonyutilsdefs.h"
       
    23 
       
    24 class CpPluginPlatInterface;
       
    25 class XQSettingsManager;
       
    26 
       
    27 using namespace CpTelephonyUtils;
       
    28 
       
    29 /*!
       
    30     \class Tools
       
    31     \brief The static functionality.
       
    32  */
       
    33 class CPTELEPHONYUTILS_EXPORT Tools : public QObject
       
    34 {
       
    35     Q_OBJECT
       
    36     
       
    37 public:
       
    38     static CpPluginPlatInterface* loadCpPlugin( const QString& name );
       
    39     static bool unloadCpPlugin( const QString& name );
       
    40 
       
    41 public:
       
    42     /*!
       
    43       Is VoIP currently supported
       
    44       */
       
    45     static bool voipSupported();
       
    46 
       
    47     /*!
       
    48       Is video currently supported
       
    49       */
       
    50     static bool videoSupported();
       
    51 
       
    52     /*!
       
    53       Service code conversion
       
    54       */
       
    55     static BasicServiceGroups convertEtelMobileServiceCode(int serviceCode);
       
    56 
       
    57     /*!
       
    58       Error code text conversion
       
    59       */
       
    60     static bool errorCodeTextMapping(const int errorcode, QString &errorText);
       
    61 
       
    62 };
       
    63 
       
    64 /*!
       
    65     \class SettingsWrapper
       
    66     \brief Wraps central repository and P&S dependency.
       
    67  */
       
    68 class CPTELEPHONYUTILS_EXPORT CpSettingsWrapper : public QObject
       
    69 {
       
    70     Q_OBJECT
       
    71 public:
       
    72     CpSettingsWrapper(QObject *parent = NULL);
       
    73     ~CpSettingsWrapper();
       
    74 public:
       
    75     /*!
       
    76       Show call duration setting
       
    77       */
       
    78     bool showCallDuration();
       
    79     int setShowCallDuration(bool value);
       
    80 
       
    81     /*!
       
    82       Soft reject text setting
       
    83       */
       
    84     void readSoftRejectText( QString &text, bool &userDefined );
       
    85     int writeSoftRejectText(const QString &text, bool userDefined );
       
    86 
       
    87     /*!
       
    88       Number grouping support
       
    89       */
       
    90     bool numberGroupingSupported() const;
       
    91     
       
    92     /*!
       
    93      Call waiting distiquish not provisioned support
       
    94      */
       
    95     bool isFeatureCallWaitingDistiquishNotProvisionedEnabled();
       
    96     
       
    97     /*!
       
    98      Checks if phone is in offline mode or not.
       
    99      Return true if phone is in offline mode.
       
   100      Return false if phone is not in offline mode.
       
   101      */
       
   102     bool isPhoneOffline() const;
       
   103 
       
   104 private:
       
   105     /*!
       
   106       Read cenrep value. 
       
   107       */
       
   108     QVariant readCenrepValue( const long int uid, const unsigned long int key) const;
       
   109     
       
   110     /*!
       
   111       Read cenrep string. 
       
   112       */
       
   113     QString readCenrepString( const long int uid, const unsigned long int key) const;
       
   114     
       
   115     /*!
       
   116       Write cenrep value or string. 
       
   117       */
       
   118     int writeCenrepValue( const long int uid, const unsigned long int key,
       
   119         const QVariant &settingsKeyValue ) const;
       
   120 
       
   121 private: // Data
       
   122     // Own
       
   123     XQSettingsManager* m_Settings;
       
   124 };
       
   125 
       
   126 #endif // CPPLUGINCOMMON_H