BaSystemSound Class Reference

class BaSystemSound

API class to retrieve and modify the system sounds settings.

Note that SystemSoundFile() is now deprecated and will be removed in a future release. The filename it returns is no longer valid but is kept for backwards compatibility. The system sounds settings are no longer stored in a data file.

BaSystemSound::SystemSoundFile

KSystemSoundRepositoryUID

Public Member Functions
IMPORT_C TIntGetSound(RFs &, const TBaSystemSoundType &, TBaSystemSoundInfo &)
IMPORT_C voidSetSoundL(RFs &, const TBaSystemSoundInfo &)
IMPORT_C TFileNameSystemSoundFile()
Private Member Functions
TBaSystemSoundName DefaultSound(TBaSystemSoundUid)

Member Functions Documentation

DefaultSound(TBaSystemSoundUid)

TBaSystemSoundName DefaultSound(TBaSystemSoundUidaSSUid)[private, static]

Parameters

TBaSystemSoundUid aSSUid

GetSound(RFs &, const TBaSystemSoundType &, TBaSystemSoundInfo &)

IMPORT_C TIntGetSound(RFs &aFsSession,
const TBaSystemSoundType &aType,
TBaSystemSoundInfo &aInfo
)[static]

Gets sound information from storage.

KErrNone if successful, or one of the system wide errors if unsuccessful.

Parameters

RFs & aFsSessionunused parameter kept for compatibility reason.
const TBaSystemSoundType & aTypeunique identifier of the sound. aType encapsulates a major and optionally a minor UID. The major UID specifes the sound category while the minor UID specifies an instance of the category.
TBaSystemSoundInfo & aInfoOn return, the sound.

SetSoundL(RFs &, const TBaSystemSoundInfo &)

IMPORT_C voidSetSoundL(RFs &aFsSession,
const TBaSystemSoundInfo &aInfo
)[static]

Adds the specified sound to the system sound table if it does not already exist in the table. If the sound already exists then overwrite the entry in the sound table.

capability

WriteDeviceData Note only clients with WriteDeviceData capability can sucessfully call this API.

leave

KErrPermissionDenied caller does not have WriteDeviceData capability.

leave

KErrArgument if the sound has not been initialized. Other system-wide error codes may also be returned.

Parameters

RFs & aFsSessionunused parameter kept for backward compatibility.
const TBaSystemSoundInfo & aInfoThe sound to add to the system sound table.

SystemSoundFile()

IMPORT_C TFileNameSystemSoundFile()[static]

Returns the system sound filename.

This function is now deprecated. System sounds are now stored in Central Repository. The function still returns the file name, but the file is no longer read from nor written to. There is no guarantee that the file exists.

Client code which uses the filename for backup and restore purposes should be removed. Central Repository handles backup and restore of system sound settings.

Client code that uses the filename for change notification must use KSystemSoundRepositoryUID to connect to Central Repository and must register for group notification on system sound repository changes. For example, if you used code such as:
iFs.Connect() ;
TFileName soundFileName = BaSystemSound ::SystemSoundFile();
iFs.NotifyChange(ENotifyAll, iRequestStatus, soundFileName);
you would now use:
const Tuint32 KDoNotCareValue = 0 ;
const Tuint32 KAllMask = 0 ;
iRepository = CRepository ::NewL(KBaSsndRepositoryUid);
iRepository.NotifyRequest(KDoNotCareValue, KAllMask, iRequestStatus);

CRepository::NotifyRequest()