os/mm/mm_plat/global_audio_settings_api/inc/GlobalAudioSettings.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mm_plat/global_audio_settings_api/inc/GlobalAudioSettings.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,382 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  This file contains definitions of GlobalAudioSettings.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +#ifndef GLOBALAUDIOSETTINGS_H
    1.24 +#define GLOBALAUDIOSETTINGS_H
    1.25 +
    1.26 +#include <e32base.h>
    1.27 +
    1.28 +class CGlobalAudioSettingsImpl;
    1.29 +class MAudioSettingsObserver;
    1.30 +class MAudioClientsListObserver;
    1.31 +
    1.32 +/**
    1.33 +*  API for accessing global settings that affects Audio behavior.
    1.34 +*
    1.35 +*  This is API is intended to be used by Adaptation to read system attributes
    1.36 +*  that affect audio behavior. This API also provides notification when any
    1.37 +*  of these attribute values change.
    1.38 +*
    1.39 +*  @lib GlobalAudioSettings.lib
    1.40 +*  @since S60 3.2
    1.41 +*/
    1.42 +class CGlobalAudioSettings : public CBase
    1.43 +    {
    1.44 +    public:
    1.45 +        enum TAudioClientListType
    1.46 +            {
    1.47 +            EActiveAudioClients,
    1.48 +            EPausedAudioClients
    1.49 +            };
    1.50 +        
    1.51 +        enum TGASRingingType
    1.52 +            {
    1.53 +        /** The tone is played in a loop.
    1.54 +            */
    1.55 +            EGASRingingTypeRinging      = 0,
    1.56 +            /**
    1.57 +            * The tone is played in a loop. On the 1st round, the volume is gradually
    1.58 +            * increment from the lowest level to the set level.
    1.59 +            */
    1.60 +            EGASRingingTypeAscending    = 1,
    1.61 +            /** The tone is played only once.
    1.62 +            */
    1.63 +            EGASRingingTypeRingingOnce  = 2,
    1.64 +            /**
    1.65 +            * The phone only beeps once instead of playing the tone if one has been set.
    1.66 +            */
    1.67 +            EGASRingingTypeBeepOnce     = 3,
    1.68 +            /** The phone is silent.
    1.69 +            * This Ringing type is set when the phone is in silence mode.
    1.70 +            */
    1.71 +            EGASRingingTypeSilent       = 4
    1.72 +            };
    1.73 +        
    1.74 +        enum TGASKeypadVolume
    1.75 +                   {
    1.76 +                   EGASKeypadVolumeOff    = 0,
    1.77 +                   EGASKeypadVolumeLevel1 = 1,
    1.78 +                   EGASKeypadVolumeLevel2 = 2,
    1.79 +                   EGASKeypadVolumeLevel3 = 3
    1.80 +                   };
    1.81 +    public:
    1.82 +        /**
    1.83 +        * function for creating the GlobalAudioSettings
    1.84 +        *
    1.85 +        */
    1.86 +        IMPORT_C static CGlobalAudioSettings* NewL(MAudioSettingsObserver& aAudioSettingsObserver);
    1.87 +
    1.88 +        /**
    1.89 +        * Destructor.
    1.90 +        *
    1.91 +        */
    1.92 +        IMPORT_C ~CGlobalAudioSettings();
    1.93 +
    1.94 +        /**
    1.95 +        * Returns warning tones status set in the current profile.
    1.96 +        *
    1.97 +        * If warning tones are disabled in the current profile, Adaptation
    1.98 +        * should reject play requests having preferences mapped to warning tones.
    1.99 +        *
   1.100 +        * @since S60 3.2
   1.101 +        * @return TBool aEnable. ETrue if warning tones are enabled else EFalse.
   1.102 +        */
   1.103 +        IMPORT_C TBool IsWarningTonesEnabled();
   1.104 +
   1.105 +        /**
   1.106 +        * Returns message tones status set in the current profile.
   1.107 +        *
   1.108 +        * If message tones are disabled in the current profile, Adaptation
   1.109 +        * should reject play requests having preferences mapped to message tones.
   1.110 +        *
   1.111 +        * @since S60 3.2
   1.112 +        * @return TBool aEnable. ETrue if message tones are enabled else EFalse.
   1.113 +        */
   1.114 +        IMPORT_C TBool IsMessageTonesEnabled();
   1.115 +
   1.116 +        /**
   1.117 +        * Returns current silent profile status.
   1.118 +        *
   1.119 +        * @since S60 3.2
   1.120 +        * @return TBool aEnable. ETrue if current profile is silent profile
   1.121 +        * else EFalse.
   1.122 +        */
   1.123 +        IMPORT_C TBool IsSilentProfileEnabled();
   1.124 +
   1.125 +        /**
   1.126 +        * Returns vibra status set in the current profile..
   1.127 +        *
   1.128 +        * If vibra is enabled in the current profile and vibra is not part of the
   1.129 +        * content, Adaptation should play vibra periodically for play requests
   1.130 +        * having preferences mapped to vibra settings.
   1.131 +        *
   1.132 +        * @since S60 3.2
   1.133 +        * @return TBool aEnable. ETrue if current profile vibra active else EFalse.
   1.134 +        */
   1.135 +        IMPORT_C TBool IsVibraEnabled();
   1.136 +
   1.137 +        /**
   1.138 +        * Returns PublicSilence feature.
   1.139 +        *
   1.140 +        * If PublicSilence feature is enabled and if current profile is Silent
   1.141 +        * Profile, For all play requests having preferences mapped to Public
   1.142 +        * Silence setting, audio should only be played out via private accessory.
   1.143 +        * If no private accessory is connected, then playback should be rejected.
   1.144 +        *
   1.145 +        * @since S60 3.2
   1.146 +        * @return TBool aEnable. ETrue if PublicSilentMode is set else EFalse.
   1.147 +        */
   1.148 +        IMPORT_C TBool IsPublicSilenceEnabled();
   1.149 +        
   1.150 +        /**
   1.151 +        * Returns Message Alert Tone 
   1.152 +        *
   1.153 +        * 
   1.154 +        * The filename selected as the message alert tone in the
   1.155 +        * current profile.
   1.156 +        * 
   1.157 +        *
   1.158 +        * 
   1.159 +        * @return TDesC& aMessageAlertToneName. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename 
   1.160 +        * is returned
   1.161 +        */
   1.162 +        IMPORT_C TDesC& MessageAlertTone();
   1.163 +        
   1.164 +        /**
   1.165 +        * Returns Email Alert Tone status
   1.166 +        *
   1.167 +        * 
   1.168 +        * The filename selected as the email alert tone in the
   1.169 +        * current profile 
   1.170 +        * 
   1.171 +        *
   1.172 +        * 
   1.173 +        *  @return TBool aEnable. ETrue if current profile message tone is on else EFalse.
   1.174 +        */
   1.175 +        IMPORT_C TBool IsMessageAlertToneEnabled();
   1.176 +        /**
   1.177 +        * Returns Email Alert Tone 
   1.178 +        *
   1.179 +        * 
   1.180 +        * The filename selected as the email alert tone in the
   1.181 +        * current profile 
   1.182 +        * 
   1.183 +        *
   1.184 +        * 
   1.185 +        * @return TDesC& aEmailAlertToneName. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename 
   1.186 +        * is returned
   1.187 +        */
   1.188 +        IMPORT_C TDesC& EmailAlertTone();
   1.189 +        
   1.190 +        /**
   1.191 +       * Returns Email Alert Tone status
   1.192 +       *
   1.193 +       * 
   1.194 +       * The filename selected as the email alert tone in the
   1.195 +       * current profile 
   1.196 +       * 
   1.197 +       *
   1.198 +       * 
   1.199 +       *  @return TBool aEnable. ETrue if current profile email alert tone is on else EFalse.
   1.200 +       */
   1.201 +        IMPORT_C TBool IsEmailAlertToneEnabled();
   1.202 +        /**
   1.203 +        * Returns the RingingType
   1.204 +        *
   1.205 +        * 
   1.206 +        * Ringing type set in the current profile
   1.207 +        * 
   1.208 +        * 
   1.209 +        *
   1.210 +        * 
   1.211 +        * @return TGASRingingType aRingingType. 
   1.212 +        */
   1.213 +        
   1.214 +        IMPORT_C  TGASRingingType RingingType();
   1.215 +        
   1.216 +        /**
   1.217 +        * Returns Videocall Alert Tone 
   1.218 +        *
   1.219 +        * 
   1.220 +        * The filename selected as the video call alert tone in the
   1.221 +        * current profile 
   1.222 +        * 
   1.223 +        *
   1.224 +        * 
   1.225 +        * @return TDesC& aVideoCallAlertToneName. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename 
   1.226 +        * is returned
   1.227 +        */
   1.228 +        
   1.229 +        IMPORT_C TDesC& VideoCallAlertTone();
   1.230 +        /**
   1.231 +        * Returns Videocall Alert Tone status
   1.232 +        *
   1.233 +        * 
   1.234 +        * The filename selected as the video call alert tone in the
   1.235 +        * current profile 
   1.236 +        * 
   1.237 +        *
   1.238 +        * 
   1.239 +        * @return TBool aEnable. ETrue if current profile videocall alert tone is on else EFalse.
   1.240 +        */
   1.241 +        IMPORT_C TBool IsVideoCallAlertToneEnabled();
   1.242 +        /**
   1.243 +        * Returns Ringing Alert Tone 
   1.244 +        *
   1.245 +        * 
   1.246 +        * The filename selected as the ringing alert tone in the
   1.247 +        * current profile 
   1.248 +        * 
   1.249 +        *
   1.250 +        * @return TDesC& aRingingAlertTone1Name. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename 
   1.251 +        * is returned
   1.252 +        * 
   1.253 +        */
   1.254 +        
   1.255 +        IMPORT_C TDesC& RingingAlertTone1();
   1.256 +        /**
   1.257 +        * Returns Ringing Alert Tone1 status
   1.258 +        *
   1.259 +        * 
   1.260 +        * The filename selected as the ringing alert tone in the
   1.261 +        * current profile 
   1.262 +        * 
   1.263 +        *
   1.264 +        * 
   1.265 +        * @return TBool aEnable. ETrue if current profile ringing alert tone is on else EFalse.
   1.266 +        */
   1.267 +        IMPORT_C TBool IsRingingAlertTone1Enabled();
   1.268 +                
   1.269 +        /**
   1.270 +        * Returns Ringing Alert Tone 2
   1.271 +        *
   1.272 +        * 
   1.273 +        * The filename selected as the ringing alert tone in the
   1.274 +        * current profile for the alternate line
   1.275 +        * 
   1.276 +        *
   1.277 +        * 
   1.278 +        * @return TDesC& aRingingAlertTone2Name. z:\\resource\\No_Sound.wav is returned if sound is off,else selected filename 
   1.279 +        * is returned
   1.280 +        */
   1.281 +        
   1.282 +        IMPORT_C TDesC& RingingAlertTone2();
   1.283 +        /**
   1.284 +        * Returns Ringing Alert Tone 2
   1.285 +        *
   1.286 +        * 
   1.287 +        * The filename selected as the ringing alert tone in the
   1.288 +        * current profile for the alternate line
   1.289 +        * 
   1.290 +        *
   1.291 +        * 
   1.292 +        * @return TBool aEnable. ETrue if current profile ringing alert tone of alternate line is on else EFalse.
   1.293 +        */
   1.294 +        IMPORT_C TBool IsRingingAlertTone2Enabled();
   1.295 +                
   1.296 +        /**
   1.297 +        * Returns Ringing Keypad Volume
   1.298 +        *
   1.299 +        * 
   1.300 +        * The key tone volume selected  in the
   1.301 +        * current profile 
   1.302 +        * 
   1.303 +        *
   1.304 +        * 
   1.305 +        * @return TGASKeypadVolume aKeypadToneVolume.returns EGASKeypadVolumeOff sound is off,else selected volume level 
   1.306 +        * is returned
   1.307 +        */
   1.308 +        
   1.309 +        IMPORT_C TGASKeypadVolume KeyPadToneVolume();
   1.310 +        
   1.311 +        /**
   1.312 +        * Returns silent mode status.
   1.313 +        *
   1.314 +        * 
   1.315 +        * @return TBool aEnable. ETrue if the silent mode is enabled else EFalse.
   1.316 +        * Ringingtype is set to EGASRingingTypeSilent when silence mode is enabled
   1.317 +        */
   1.318 +        
   1.319 +        IMPORT_C TBool IsSilenceModeEnabled();
   1.320 +        /**
   1.321 +        * Registers audio clients list observer.
   1.322 +        *
   1.323 +        * When registered successfully, the observer will start receiveing
   1.324 +        * callback defined in MAudioClientsListObserver when audio clients list
   1.325 +        * changes.
   1.326 +        *
   1.327 +        * @since S60 3.2
   1.328 +        * @param MAudioClientsListObserver& aObserver. A reference to class
   1.329 +        *           implementing MAudioClientsListObserver interface.
   1.330 +        * @return TInt. KErrNone if successful. KErrAlreadyExists if the observer
   1.331 +        *           is already registered. Otherwise a systemwide error code.
   1.332 +        */
   1.333 +        IMPORT_C TInt RegisterAudioClientsListObserver(
   1.334 +                                    MAudioClientsListObserver& aObserver );
   1.335 +                
   1.336 +        /**
   1.337 +        * Unregisters audio clients list observer.
   1.338 +        *
   1.339 +        * When unregistered, the observer will no longer receive callback when
   1.340 +        * audio clients list changes.
   1.341 +        *
   1.342 +        * @since S60 3.2
   1.343 +        * @param MAudioClientsListObserver& aObserver. A reference to class
   1.344 +        *           implementing MAudioClientsListObserver interface.
   1.345 +        * @return TInt. KErrNone if successful. KErrNotFound if the observer
   1.346 +        *           is not registered.
   1.347 +        */
   1.348 +        IMPORT_C TInt UnregisterAudioClientsListObserver(
   1.349 +                                    MAudioClientsListObserver& aObserver);
   1.350 +
   1.351 +        /**
   1.352 +        * Gets audio clients list.
   1.353 +        *
   1.354 +        * On return of this function, the parameter aList will contain active
   1.355 +        * audio client application process ids.
   1.356 +        *
   1.357 +        * The parameter aList will be reset in the case
   1.358 +        *
   1.359 +        * @since S60 3.2
   1.360 +        * @param TAudioClientListType aFilter. Type of client list.
   1.361 +        * @param RArray<TProcessId>& aList. A reference to RArray.
   1.362 +        * @return TInt. KErrNone if successful. KErrBadName if
   1.363 +        *           aType is not one of the TAudioClientListType enumeration.
   1.364 +        *           Otherwise a systemwide error code.
   1.365 +        *           In case of error, the array aList will be reset.
   1.366 +        */
   1.367 +        IMPORT_C TInt GetAudioClientsList(
   1.368 +                                TAudioClientListType aType,
   1.369 +                                RArray<TProcessId>& aList );
   1.370 +
   1.371 +    private:
   1.372 +        CGlobalAudioSettings();
   1.373 +        /**
   1.374 +        * Second Phase Costructor for GlobalAudioSettings Instance
   1.375 +        * @since 3.2
   1.376 +        * @param void
   1.377 +        */
   1.378 +        void ConstructL( MAudioSettingsObserver& aAudioSettingsObserver );
   1.379 +    
   1.380 +    private:
   1.381 +        CGlobalAudioSettingsImpl* iBody;
   1.382 +    };
   1.383 +
   1.384 +#endif
   1.385 +// End of file