gsprofilesrv_plat/profiles_engine_api/inc/MProfileEngine.h
changeset 0 8c5d936e5675
equal deleted inserted replaced
-1:000000000000 0:8c5d936e5675
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Profile Engine interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __MPROFILEENGINE_H__
       
    21 #define __MPROFILEENGINE_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <Profile.hrh>          // TProfileRingingVolume 
       
    26 
       
    27 // DATA TYPES
       
    28 enum TProfileFeatureId
       
    29     {
       
    30     EProfileFeatureVTRingingTone,
       
    31     EProfileFeatureWmaDemoPlay  // if this is true, demo-play is DISABLED
       
    32     };
       
    33 
       
    34 // FUNCTION PROTOTYPES
       
    35 class MProfileEngine;
       
    36 class RFs;
       
    37 
       
    38 /**
       
    39 * Create profile engine, ownership transfered.
       
    40 *
       
    41 *  @lib ProfileEng.lib
       
    42 *  @since 2.0
       
    43 */
       
    44 IMPORT_C MProfileEngine* CreateProfileEngineL();
       
    45 
       
    46 /**
       
    47 * Create profile engine, ownership transfered.
       
    48 *
       
    49 *  @param aFs An open file server session, ownership is NOT transferred.
       
    50 *  aFs must remain connected for the lifetime of the returned object.
       
    51 *  @lib ProfileEng.lib
       
    52 *  @since 3.0
       
    53 */
       
    54 IMPORT_C MProfileEngine* CreateProfileEngineL( RFs* aFs );
       
    55 
       
    56 // FORWARD DECLARATIONS
       
    57 class MProfile;
       
    58 class MProfilesNamesArray;
       
    59 
       
    60 // CLASS DECLARATION
       
    61 
       
    62 /**
       
    63 *  Profile engine interface.
       
    64 *  This class offers methods to get active profile, active profile ID,
       
    65 *  profile names array and set active profile.
       
    66 *  How to use:
       
    67 *  Create profile engine with CreateProfileEngineL();
       
    68 *      MProfileEngine* profileEngine = CreateProfileEngineL();
       
    69 *  Free resources with MProfileEngine::Release();
       
    70 *      profileEngine->Release();
       
    71 *  or if you release resources in destructor:
       
    72 *      ( iProfileEngine )
       
    73 *          {
       
    74 *          iProfileEngine->Release();
       
    75 *          }
       
    76 *
       
    77 *  If you put this class to CleanupStack then use void CleanupReleasePushL()
       
    78 *     CleanupReleasePushL( *profileEngine );
       
    79 *
       
    80 *
       
    81 *  @lib N/A
       
    82 *  @since 2.0
       
    83 */
       
    84 class MProfileEngine
       
    85     {
       
    86     protected:  // Destructor
       
    87 
       
    88         virtual ~MProfileEngine() {};
       
    89 
       
    90     public:
       
    91 
       
    92         /**
       
    93         * Frees resources.
       
    94         * @since 2.0
       
    95         */
       
    96         virtual void Release() = 0;
       
    97 
       
    98         /**
       
    99         * Return active profile, ownership transfered.
       
   100         * @since 2.0
       
   101         * @return Instance of the MProfile
       
   102         */
       
   103         virtual MProfile* ActiveProfileLC() = 0;
       
   104 
       
   105         /**
       
   106         * Return active profile, ownership transfered.
       
   107         * @since 2.0
       
   108         * @return Instance of the MProfile
       
   109         */
       
   110         virtual MProfile* ActiveProfileL() = 0;
       
   111 
       
   112         /**
       
   113         * Return active profile ID or system error code.
       
   114         * @since 2.0
       
   115         * @return Active profile ID or system error code.
       
   116         */
       
   117         virtual TInt ActiveProfileId() = 0;
       
   118 
       
   119         /**
       
   120         * Return profiles names array, ownership transfered.
       
   121         * @since 2.0
       
   122         * @return Instance of the profiles names array
       
   123         */
       
   124         virtual MProfilesNamesArray* ProfilesNamesArrayLC() = 0;
       
   125 
       
   126         /**
       
   127         * Set active profile if ID is incorrect then leave with KErrNotFound.
       
   128         * @since 2.0
       
   129         * @param aId Profile ID
       
   130         */
       
   131         virtual void SetActiveProfileL( TInt aId ) = 0;
       
   132 
       
   133         /**
       
   134          * Sets the temporary ringing volume of the current active profile to
       
   135          * the given value. Temporary means that if another profile is
       
   136          * activated and after that the original is reactivated the temporary
       
   137          * value will be lost. Leaves with KErrAccessDenied if the ringing
       
   138          * volume setting of the current profile is read-only.
       
   139          * @since 2.6
       
   140          * @param aVolume the new value for the temporary ringing volume level.
       
   141          */
       
   142         virtual void SetTempRingingVolumeL( TProfileRingingVolume aVolume ) = 0;
       
   143 
       
   144         /**
       
   145          * Gets the temporary ringing volume of the current active profile.
       
   146          * Temporary means that if another profile is activated and after
       
   147          * that the original is reactivated the temporary value will be lost.
       
   148          * @since 2.6
       
   149          * @return the temporary ringing volume level of the active profile.
       
   150          */
       
   151         virtual TProfileRingingVolume TempRingingVolumeL() const = 0;
       
   152 
       
   153         /**
       
   154          * Sets the temporary media volume of the current active profile to
       
   155          * the given value. Temporary means that if another profile is
       
   156          * activated and after that the original is reactivated the temporary
       
   157          * value will be lost. Leaves with KErrAccessDenied if the media
       
   158          * volume setting of the current profile is read-only.
       
   159          * @since 2.6
       
   160          * @param aVolume the new value for the temporary media volume level.
       
   161          */
       
   162         virtual void SetTempMediaVolumeL( TProfileRingingVolume aVolume ) = 0;
       
   163 
       
   164         /**
       
   165          * Gets the temporary media volume of the current active profile.
       
   166          * Temporary means that if another profile is activated and after
       
   167          * that the original is reactivated the temporary value will be lost.
       
   168          * @since 2.6
       
   169          * @return the temporary media volume level of the active profile.
       
   170          */
       
   171         virtual TProfileRingingVolume TempMediaVolumeL() const = 0;
       
   172 
       
   173         /**
       
   174          * Checks whether the given feature is supported by Profiles Engine.
       
   175          * @since 2.8
       
   176          * @param aFeatureId the feature to be checked.
       
   177          * @return ETrue if the given feature is supported, EFalse otherwise.
       
   178          */
       
   179         virtual TBool IsFeatureSupported(
       
   180             TProfileFeatureId aFeatureId ) const = 0;
       
   181 
       
   182         /**
       
   183         * Checks if the current active profile is timed or not.
       
   184         * @since 3.2
       
   185         * @return ETrue if the current active profile is timed, EFalse
       
   186         * otherwise.
       
   187         */
       
   188         virtual TBool IsActiveProfileTimedL() = 0;
       
   189 
       
   190     };
       
   191 
       
   192 #endif      //  __MPROFILEENGINE_H__
       
   193 
       
   194 // End of File