controlpanelui/src/cpprofilewrapper/src/cpprofilemodel.cpp
branchRCL_3
changeset 14 5f281e37a2f5
parent 13 90fe62538f66
equal deleted inserted replaced
13:90fe62538f66 14:5f281e37a2f5
     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 "cpprofilemodel.h"
       
    19 #include "cpprofilemodel_p.h"
       
    20 #include <QtCore/QStringList>
       
    21 
       
    22 /*!
       
    23    Contructor
       
    24  */
       
    25 CpProfileModel::CpProfileModel(QObject *parent /*=0*/):QObject(parent),
       
    26                                                        d_ptr(new CpProfileModelPrivate())
       
    27 {
       
    28     d_ptr->initialize(this);    
       
    29 }
       
    30 
       
    31 /*!
       
    32    Destrutor
       
    33  */
       
    34 CpProfileModel::~CpProfileModel()
       
    35 {
       
    36     delete d_ptr;
       
    37 }
       
    38 
       
    39 /*!
       
    40    Get profile name with its id
       
    41  */
       
    42 QString CpProfileModel::profileName(int profileId) const
       
    43 {
       
    44     return d_ptr->profileName(profileId);
       
    45 }
       
    46 /*!
       
    47    get profile name list 
       
    48  */
       
    49 QStringList CpProfileModel::profileNames()const
       
    50 {
       
    51     return d_ptr->profileNames();
       
    52 }
       
    53 /*!
       
    54    Activate a profile with its id, return the result code.
       
    55  */
       
    56 int CpProfileModel::activateProfile(int profileId)
       
    57 {
       
    58     return d_ptr->activateProfile(profileId);
       
    59 }
       
    60 
       
    61 /*!
       
    62    Get active profile's id
       
    63  */
       
    64 int CpProfileModel::activeProfileId() const
       
    65 {
       
    66     return d_ptr->activeProfileId();
       
    67 }
       
    68 
       
    69 /*!
       
    70      Get profile settings, store in center repository keys 
       
    71  */
       
    72 void CpProfileModel::profileSettings(int profileId, CpProfileSettings& profileSettings)
       
    73 {
       
    74     d_ptr->profileSettings(profileId, profileSettings);
       
    75 }
       
    76 
       
    77 /*!
       
    78      Set profile settings from center repository keys
       
    79  */
       
    80 void CpProfileModel::setProfileSettings(int profileId, CpProfileSettings& profileSettings )
       
    81 {
       
    82     return d_ptr->setProfileSettings(profileId, profileSettings);
       
    83 }
       
    84 
       
    85 /*!
       
    86      Get ring tone of active profile
       
    87  */
       
    88 QString CpProfileModel::ringTone() const
       
    89 {
       
    90     return d_ptr->ringTone();
       
    91 }
       
    92 
       
    93 /*!
       
    94      Set ring tone for all profiles
       
    95  */
       
    96 void CpProfileModel::setRingTone(const QString& filePath)
       
    97 {
       
    98     d_ptr->setRingTone(filePath);
       
    99 }
       
   100 
       
   101 /*!
       
   102      Return ringing volume of device
       
   103  */
       
   104 int CpProfileModel::masterVolume() const
       
   105 {
       
   106     return d_ptr->masterVolume();
       
   107 }
       
   108 
       
   109 /*!
       
   110      Set device's ringing volume
       
   111  */
       
   112 void CpProfileModel::setMasterVolume(int volume)
       
   113 {
       
   114     return d_ptr->setMasterVolume(volume);
       
   115 }
       
   116 
       
   117 /*!
       
   118      Return the master vibra's status of device
       
   119  */
       
   120 bool CpProfileModel::masterVibra() const
       
   121 {
       
   122     return d_ptr->masterVibra();
       
   123 }
       
   124 
       
   125 /*!
       
   126      Set the master vibra's status of device
       
   127  */
       
   128 void CpProfileModel::setMasterVibra(bool isVibra)
       
   129 {
       
   130     d_ptr->setMasterVibra(isVibra);
       
   131 }
       
   132 
       
   133 /*!
       
   134      Return the silence mode of device
       
   135  */
       
   136 bool CpProfileModel::silenceMode() const
       
   137 {
       
   138     return d_ptr->silenceMode();
       
   139 }
       
   140 
       
   141 /*!
       
   142      Set silence mode for deivce
       
   143  */
       
   144 void CpProfileModel::setSilenceMode(bool isSilence)
       
   145 {
       
   146     d_ptr->setSilenceMode(isSilence);
       
   147 }
       
   148 
       
   149 /*!
       
   150    Get profile's ring tone, if the profile id is invalid, always return an empty string
       
   151    \param profileId profile's id
       
   152  */
       
   153 QString CpProfileModel::ringTone(int profileId)const
       
   154 {
       
   155     return d_ptr->ringTone(profileId);
       
   156 }
       
   157 
       
   158 /*!
       
   159    Set ring tone for a profile, if the profile id is invalid, nothing happens
       
   160    \param profileId profile's id
       
   161    \param filePath ring tone's path
       
   162  */
       
   163 void CpProfileModel::setRingTone(int profileId, const QString& filePath)
       
   164 {
       
   165     d_ptr->setRingTone(profileId, filePath);
       
   166 }
       
   167 
       
   168 /*!
       
   169    Get message tone's name, if the profile id is invalid, always return an empty string
       
   170    \param profileId profile's id
       
   171  */
       
   172 QString CpProfileModel::messageTone(int profileId) const
       
   173 {
       
   174     return d_ptr->messageTone(profileId);
       
   175 }
       
   176 
       
   177 /*!
       
   178    Set message tone for a profile, if the profile id is invalid, nothing happens
       
   179    \param profileId profile's id
       
   180    \param filePath message tone's path
       
   181  */
       
   182 void CpProfileModel::setMessageTone(int profileId, const QString& filePath)
       
   183 {
       
   184     d_ptr->setMessageTone(profileId, filePath);
       
   185 }
       
   186 
       
   187 /*!
       
   188    Get email tone's name, if the profile id is invalid, always return an empty string
       
   189    \param profileId profile's id
       
   190  */
       
   191 QString CpProfileModel::emailTone(int profileId) const
       
   192 {
       
   193     return d_ptr->emailTone(profileId);
       
   194 }
       
   195 
       
   196 /*!
       
   197    Set email tone for a profile, if the profile id is invalid, nothing happens
       
   198    \param profileId profile's id
       
   199    \param filePath message tone's path
       
   200  */
       
   201 void CpProfileModel::setEmailTone(int profileId, const QString& filePath)
       
   202 {
       
   203     d_ptr->setEmailTone(profileId,filePath);
       
   204 }
       
   205 
       
   206 /*!
       
   207    Get reminder tone's name, if the profile id is invalid, always return an empty string
       
   208    \param profileId profile's id
       
   209  */
       
   210 QString CpProfileModel::reminderTone(int profileId) const
       
   211 {
       
   212     return d_ptr->reminderTone(profileId);
       
   213 }
       
   214 
       
   215 /*!
       
   216    Set reminder tone for a profile, if the profile id is invalid, nothing happens
       
   217    \param profileId profile's id
       
   218    \param filePath reminder tone's path
       
   219  */
       
   220 void CpProfileModel::setReminderTone(int profileId, const QString& filePath)
       
   221 {
       
   222     d_ptr->setReminderTone(profileId,filePath);
       
   223 }
       
   224 
       
   225 /*!
       
   226    Get notification tone's status, if the profile id is invalid, always return false
       
   227    \param profileId profile's id
       
   228    \return return the status of notification tone, true value stands for the tone being on
       
   229  */
       
   230 bool CpProfileModel::notificationTone(int profileId) const
       
   231 {
       
   232     return d_ptr->notificationTone(profileId);
       
   233 }
       
   234 
       
   235 /*!
       
   236    Set notification tone's status for a profile, if the profile id is invalid, nothing happens
       
   237    \param profileId profile's id
       
   238    \return isActive the status of notification tone
       
   239  */
       
   240 void CpProfileModel::setNotificationTone(int profileId, bool isActive)
       
   241 {
       
   242     d_ptr->setNotificationTone(profileId, isActive);
       
   243 }
       
   244 
       
   245 /*!
       
   246      Get key & touch screen tone's value, if the profile id is invalid, always return 0
       
   247  */
       
   248 int CpProfileModel::keyTouchScreenTone(int profileId) const
       
   249 {
       
   250     return d_ptr->keyTouchScreenTone(profileId);
       
   251 }
       
   252 
       
   253 /*!
       
   254      set key & touch screen tone, if the profile id is invalid, nothing happens
       
   255      \param profileId identify the profile
       
   256      \param level 0-5
       
   257  */
       
   258 void CpProfileModel::setKeyTouchScreenTone(int profileId, int level)
       
   259 {
       
   260     d_ptr->setKeyTouchScreenTone(profileId,level);
       
   261 }
       
   262 
       
   263 /*!
       
   264    Get key & touch screen vibra's value, if the profile id is invalid, always return 0
       
   265    \param profileId identify the profile
       
   266  */
       
   267 int CpProfileModel::keyTouchScreenVibra(int profileId) const
       
   268 {
       
   269     return d_ptr->keyTouchScreenVibra(profileId);
       
   270 }
       
   271 
       
   272 /*!
       
   273    Set key touch screen vibar for a profile, if the profile id is invalid, nothing happens
       
   274    \param profileId identify the profile
       
   275    \param level 0-5
       
   276  */
       
   277 void CpProfileModel::setKeyTouchScreenVibra(int profileId, int level)
       
   278 {
       
   279     d_ptr->setKeyTouchScreenVibra(profileId,level);
       
   280 }
       
   281 
       
   282 // End of file
       
   283