sysstatemgmt/ssmmapperutility/inc/ssmmapperutility.h
changeset 0 4e1aa6a622a0
child 13 cef4ff1e6c4f
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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 * Declaration of CSsmMapperUtility class.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef SSMMAPPERUTILITY_H
       
    20 #define SSMMAPPERUTILITY_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class TSsmState;
       
    25 
       
    26 /**
       
    27 * Utility class for mapping Uids, getting feature
       
    28 * and system states and cenrep values.
       
    29 *
       
    30 */
       
    31 class CSsmMapperUtility : public CBase
       
    32     {
       
    33 public:
       
    34     
       
    35     /**
       
    36      * Two-phased constructor. Clients of mapper utility
       
    37      * should use this method for creating instance.
       
    38      */
       
    39     IMPORT_C static CSsmMapperUtility* NewL();
       
    40 
       
    41     /**
       
    42      * Destructor
       
    43      */
       
    44     IMPORT_C virtual ~CSsmMapperUtility();
       
    45 
       
    46     /**
       
    47      * Methods for mapping p&s, cenrep and feature Uids
       
    48      *
       
    49      * @param aUid The Uid to map
       
    50      * @return The mapped Uid 
       
    51      */
       
    52     virtual TUid PsUid( const TUid& aUid );
       
    53     virtual TUid CrUid( const TUid& aUid );
       
    54     virtual TUid FeatureUid( const TUid& aUid );
       
    55 
       
    56     /**
       
    57      * Get the current system state
       
    58      *
       
    59      * @param aState On return contains the current state
       
    60      * @return KErrNone if system state read successfully.
       
    61      *         Otherwise one of Symbian error codes. 
       
    62      */
       
    63     virtual TInt GetCurrentState( TSsmState& aState ) const;
       
    64 
       
    65     /**
       
    66      * Gets the requested feature Uid's status
       
    67      *
       
    68      * @param aUid Requested feature Uid
       
    69      * @return ETrue if feature supported, otherwise EFalse
       
    70      */
       
    71     IMPORT_C TBool FeatureStatus( const TUid& aUid );
       
    72 
       
    73     /**
       
    74      * Gets the requested cenrep key's value
       
    75      *
       
    76      * @param aUid Requested cenrep Uid
       
    77      * @param aKey Requested cenrep key
       
    78      * @param aValue On return contains value of requested key
       
    79      * @return KErrNone if value read successfully.
       
    80      *         Otherwise one of Symbian error codes.
       
    81      */
       
    82     IMPORT_C TInt CrValue( const TUid& aUid, TUint32 aKey, TInt& aValue );
       
    83 
       
    84     /**
       
    85      * Gets the requested cenrep key's value
       
    86      *
       
    87      * @param aUid Requested cenrep Uid
       
    88      * @param aKey Requested cenrep key
       
    89      * @param aValue On return contains value of requested key
       
    90      * @return KErrNone if descriptor read successfully.
       
    91      *         Otherwise one of Symbian error codes.
       
    92      */
       
    93     IMPORT_C TInt CrValue( const TUid& aUid, TUint32 aKey, TDes& aValue );
       
    94 
       
    95     /**
       
    96      * Gets the path to command lists
       
    97      *
       
    98      * @param aCmdListPath Default path. Will be modified if called from test code.
       
    99      */
       
   100     virtual void GetCommandListPath( TDes& aCmdListPath );
       
   101 
       
   102     /**
       
   103      * Checks the capabilities of client
       
   104      *
       
   105      * @aMessage Client message
       
   106      * @return ETrue if capabilities ok, otherwise EFalse
       
   107      */
       
   108     virtual TBool CheckCaps( const RMessagePtr2& aMessage );
       
   109     
       
   110     /**
       
   111     * First phase constructor. Exported for 
       
   112     * deriver classes.
       
   113     */
       
   114     IMPORT_C CSsmMapperUtility();
       
   115 
       
   116 private:
       
   117     
       
   118     /**
       
   119     * Second phase of construction.
       
   120     */
       
   121     void ConstructL();
       
   122 
       
   123 private:
       
   124 
       
   125     // Extension library handle
       
   126     RLibrary iExtensionLib;
       
   127         
       
   128     // Extension instance. Can be NULL when extension is missing. Own.
       
   129     CSsmMapperUtility *iExtension;
       
   130     };
       
   131 
       
   132 #endif // SSMMAPPERUTILITY_H