devicesrv_plat/powersave_plugin_api/inc/psmsettingsprovider.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2007 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:  PSM Settings Provider API for plug-ins
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef PSMSETTINGSPROVIDER_H
       
    21 #define PSMSETTINGSPROVIDER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <psmtypes.h>
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30  * PSM Settings Provider class for PSM plug-ins settings
       
    31  *
       
    32  */
       
    33 class MPsmSettingsProvider
       
    34     {
       
    35 public:
       
    36 
       
    37     /**
       
    38      * Current mode where to switch to.
       
    39      *
       
    40      * @return Mode where we are currently switching to.
       
    41      */
       
    42     virtual TPsmsrvMode Mode() = 0;
       
    43 
       
    44     /**
       
    45      * Changes the values. Backups current settings and returns changed settings. 
       
    46      * Plug-ins should give same settings set no matter what the mode is. PSM server takes care 
       
    47      * of setting correct values back to parameter aPsmConfigArray.
       
    48      *
       
    49      * @param[in, out] aPsmConfigArray Contains current settings, on exit, contains updated settings
       
    50      * @param[in] aRepository Specific reposiroty UID where these settings are in. Identifies the
       
    51      *                        configuration file located in PSM servers private folder
       
    52      * @leave KErrNotFound if no settings are found for this plugin
       
    53      */
       
    54     virtual void BackupAndGetSettingsL( RConfigInfoArray& aPsmConfigArray, 
       
    55                                         const TUint32 aRepository ) = 0;
       
    56 
       
    57     /**
       
    58      * Gets configuration set for current mode without doing any backups. Only reads 
       
    59      * configurations for currently active power save mode. If current mode is not 
       
    60      * a power save mode, returns settings from backup storage.
       
    61      *
       
    62      * Gets prefilled config array as a parameter, and only those settings that are in array
       
    63      * are got, for example if there is three different settings for this repository and one 
       
    64      * wants to get only information which config Id is 2, only one config info with config Id
       
    65      * 2 should exists in aParamConfigArray
       
    66      *
       
    67      * @param[in, out] aPsmConfigArray Prefilled config info array. Each prefilled config info 
       
    68      *                                 must contain at least config Id
       
    69      * @param[in] aRepository Specific reposiroty UID where these settings are in
       
    70      * @return A system wide error code
       
    71      */
       
    72     virtual void GetSettingsL( RConfigInfoArray& aPsmConfigArray, 
       
    73                                const TUint32 aRepository ) = 0;
       
    74 
       
    75     /**
       
    76      * Backups settings that exists in aPsmConfigArray. Note that any existing config information
       
    77      * with same config Id in aRepository is overriden with new values from aPsmConfigArray.
       
    78      *
       
    79      * @param[in] aPsmConfigArray Contains settings to store into backup
       
    80      * @param[in] aRepository Specific reposiroty UID where these settings are in
       
    81      * @leave KErrWrite if device is not in any power save mode,
       
    82      *        a system wide error code
       
    83      */
       
    84     virtual void BackupSettingsL( const RConfigInfoArray& aPsmConfigArray, 
       
    85                                   const TUint32 aRepository ) = 0;
       
    86 
       
    87     };
       
    88 
       
    89 #endif //PSMSETTINGSPROVIDER_H
       
    90 
       
    91 // End of File
       
    92 
       
    93