CProfileToneHandler Class Reference

class CProfileToneHandler : public CBase

A helper interface to be used by S60 applications for setting ringing and alert tones for different profiles. Registers DRM protected tones as automated content and removes old content from automated content list. Shows a content activation query and other DRM related notes if necessary.

ProfileSettingsView.lib
Since
Series 60 2.6

Inherits from

Public Member Functions
~CProfileToneHandler()
IMPORT_C CProfileToneHandler *NewL()
IMPORT_C CProfileToneHandler *NewLC()
voidPhoneSettingChanged(TSSSettingsSetting, TInt)
IMPORT_C TIntSetActiveProfileRingingToneL(const TDesC &)
IMPORT_C TIntSetProfileToneL(TInt, TProfileTones, const TDesC &)
IMPORT_C TIntSetProfileToneNotCheckL(TInt, TProfileTones, const TDesC &)
IMPORT_C TIntSetToneForAllProfilesL(TProfileTones, const TDesC &)
Protected Member Functions
TBool AllowSelect(const TDesC &)
TInt AskAutomated(const TDesC &)
TBool CanSetAutomated(const TDesC &)
TInt CheckFileL(const TDesC &)
TInt CheckProtectedFileL(const TDesC &)
TInt CheckResultAndProtectionL(TInt, const TDesC &)
TInt CheckToneFileSizeL(const TDesC &, TInt)
TBuf< KMaxDataTypeLength >DataTypeL(const TDesC &)
voidDoSetProfileToneL(TInt, TProfileTones, const TDesC &)
voidGetMaxToneFileSizeL()
TBool IsProtected(const TDesC &)
TBool IsProtectedL(const TDesC &)
const TDesC &ReadToneL(const MProfileExtended &, TProfileTones)
voidRemoveAutomated(const TDesC &)
TInt SetAutomated(TProfileTones, const TDesC &)
voidSetToneL(MProfileExtended &, TProfileTones, const TDesC &)
voidShowErrorNoteL(TInt)
voidShowSizeErrorNoteL(TInt)
Private Member Functions
CProfileToneHandler()
voidConstructL()
voidDrmConstructL()
TBool IsFileWMDRMProtectedL(const TDesC &)
voidReleaseDrm()
TInt SetAutomatedL(TProfileTones, const TDesC &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TInt iAlternateLineSetting
DRMCommon *iDrmCommon
CDRMHelper *iDrmHelper
RFs iFs
TInt iMaxSizeKB
MProfileEngineExtended *iProfileEngine
MProfilesLocalFeatures *iProfilesFeatures
RSSSettings iSSSettings

Constructor & Destructor Documentation

CProfileToneHandler()

CProfileToneHandler()[private]

~CProfileToneHandler()

~CProfileToneHandler()

Member Functions Documentation

AllowSelect(const TDesC &)

TBool AllowSelect(const TDesC &aDataType)const [protected]

Returns info whether given filetype is allowed as ringingtone

Parameters

const TDesC & aDataTypeTone MIME type

AskAutomated(const TDesC &)

TInt AskAutomated(const TDesC &aFileName)[protected]

Asks user if he/she wants to activate unactivated content. Shows a query. Does nothing if DRM is not supported.

Parameters

const TDesC & aFileNameFile to be registered as automated content.

CanSetAutomated(const TDesC &)

TBool CanSetAutomated(const TDesC &aFileName)[protected]

Tells whether a file can be registered as automated content or not. If DRM is not supported, returns always EFalse.

Parameters

const TDesC & aFileNameFile to be registered as automated content.

CheckFileL(const TDesC &)

TInt CheckFileL(const TDesC &aFileName)[protected]
Checks that the given tone file exists and that it is a legal file to be used as a ringing or alert tone.
Since
2.6

Parameters

const TDesC & aFileNameFull path and filename of the file to be checked.

CheckProtectedFileL(const TDesC &)

TInt CheckProtectedFileL(const TDesC &aFileName)[protected]
Checks if a DRM protected file can be used as a ringing or alert tone.
Since
2.6

Parameters

const TDesC & aFileNameFull path and filename of the file to be checked.

CheckResultAndProtectionL(TInt, const TDesC &)

TInt CheckResultAndProtectionL(TIntaResult,
const TDesC &aFileName
)[protected]

Checks the result of CheckFileL() and leaves if needed. Also checks if the file is protected and can be set as automated content.

Parameters

TInt aResultresult of the CheckFileL() call made before this.
const TDesC & aFileNamethe name of the file to be checked for protection and if it is settable as automated content.

CheckToneFileSizeL(const TDesC &, TInt)

TInt CheckToneFileSizeL(const TDesC &aFile,
TIntaSizeLimitKB
)[protected]

Checks ringing tone file size.

Parameters

const TDesC & aFilefile to check.
TInt aSizeLimitKBmaximum allowed file size in KB.

ConstructL()

voidConstructL()[private]

DataTypeL(const TDesC &)

TBuf< KMaxDataTypeLength >DataTypeL(const TDesC &aFileName)const [protected]

Returns data type of a file.

Parameters

const TDesC & aFileNameFull path and filename.

DoSetProfileToneL(TInt, TProfileTones, const TDesC &)

voidDoSetProfileToneL(TIntaProfileId,
TProfileTonesaToneSetting,
const TDesC &aFileName
)[protected]

Stores the settings to Profiles Engine and adds the file to automated content list and removes the old file from automated content list. Do not call until the file is checked using CheckFileL.

Parameters

TInt aProfileIdThe ID of the profile (NOT an index).
TProfileTones aToneSettingIdentifies the tone which is updated.
const TDesC & aFileNameFull path and filename of the tone to be used as the new ringing or alert tone.

DrmConstructL()

voidDrmConstructL()[private]

GetMaxToneFileSizeL()

voidGetMaxToneFileSizeL()[protected]

Reads maximimum ringing tone file size in KB from cenrep.

IsFileWMDRMProtectedL(const TDesC &)

TBool IsFileWMDRMProtectedL(const TDesC &aFileName)[private]

Parameters

const TDesC & aFileName

IsProtected(const TDesC &)

TBool IsProtected(const TDesC &aFileName)const [protected]

Returns whether a file is protected content or not. Returns always EFalse if DRM is not supported.

Parameters

const TDesC & aFileNameThe file name.

IsProtectedL(const TDesC &)

TBool IsProtectedL(const TDesC &aFileName)const [protected]

Returns whether a file is protected content or not. Returns always EFalse if DRM is not supported.

Parameters

const TDesC & aFileNameThe file name.

NewL()

IMPORT_C CProfileToneHandler *NewL()[static]

NewLC()

IMPORT_C CProfileToneHandler *NewLC()[static]

PhoneSettingChanged(TSSSettingsSetting, TInt)

voidPhoneSettingChanged(TSSSettingsSettingaSetting,
TIntaNewValue
)

From MSSSettings

Parameters

TSSSettingsSetting aSetting
TInt aNewValue

ReadToneL(const MProfileExtended &, TProfileTones)

const TDesC &ReadToneL(const MProfileExtended &aProfile,
TProfileTonesaToneSetting
)const [protected]

Reads a tone setting from an MProfileExtended instance.

Parameters

const MProfileExtended & aProfileThe MProfileExtended instance.
TProfileTones aToneSettingIdentifies the tone which is read.

ReleaseDrm()

voidReleaseDrm()[private]

RemoveAutomated(const TDesC &)

voidRemoveAutomated(const TDesC &aFileName)[protected]

Removes a file from automated content list. Errors are omitted. Does nothing if DRM is not supported.

Parameters

const TDesC & aFileNameFile to be removed from automated content list.

SetActiveProfileRingingToneL(const TDesC &)

IMPORT_C TIntSetActiveProfileRingingToneL(const TDesC &aFileName)
Sets the ringing tone of the current active profile. If the file does not exist, leaves with KErrNotFound. If the file is of an unsupported type, leaves with KErrNotSupported. If the file is an unprotected MP3/AAC in user data area and if those are not allowed as ringing or alert tones, leaves with KErrPermissionDenied. If the file is a WMA file in user data area and those are not allowed, leaves with KErrArgument. If the active profile is not allowed to be changed (e.g. Drive-profile) leaves with KErrAccessDenied. If Alternate Line Service is enabled, finds out the line in use and sets the ringing tone for that line respectively.
Since
2.6

Parameters

const TDesC & aFileNameFull path and filename of the tone to be used as the new ringing tone. An empty descriptor will be replaced with "No_Sound.wav".

SetAutomated(TProfileTones, const TDesC &)

TInt SetAutomated(TProfileTonesaToneSetting,
const TDesC &aFileName
)[protected]

Registers a file to automated content list without any queries. Errors are omitted. Does nothing if DRM is not supported.

Parameters

TProfileTones aToneSettingThe type of tone (e.g. ringing tone, SMS tone) to be registered as automated content.
const TDesC & aFileNameFile to be registered as automated content.

SetAutomatedL(TProfileTones, const TDesC &)

TInt SetAutomatedL(TProfileTonesaToneSetting,
const TDesC &aFileName
)[private]

Parameters

TProfileTones aToneSetting
const TDesC & aFileName

SetProfileToneL(TInt, TProfileTones, const TDesC &)

IMPORT_C TIntSetProfileToneL(TIntaProfileId,
TProfileTonesaToneSetting,
const TDesC &aFileName
)
Sets a ringing or alert tone for a profile. If the file does not exist, leaves with KErrNotFound. If the file is of an unsupported type, leaves with KErrNotSupported. If the file is an unprotected MP3/AAC in user data area and if those are not allowed as ringing or alert tones, leaves with KErrPermissionDenied. If the file is a WMA file in user data area and those are not allowed, leaves with KErrArgument. If the file is not allowed to be changed leaves with KErrAccessDenied. If the selected profile is not allowed to be changed (e.g. Drive-profile) leaves with KErrAccessDenied. In case of a ringing tone, if Alternate Line Service is enabled, finds out the line in use and sets the ringing tone for that line respectively.
Since
2.6

Parameters

TInt aProfileIdThe ID of the profile (NOT an index).
TProfileTones aToneSettingIdentifies the tone which is updated.
const TDesC & aFileNameFull path and filename of the tone to be used as the new ringing or alert tone. An empty descriptor will be replaced with "No_Sound.wav".

SetProfileToneNotCheckL(TInt, TProfileTones, const TDesC &)

IMPORT_C TIntSetProfileToneNotCheckL(TIntaProfileId,
TProfileTonesaToneSetting,
const TDesC &aFileName
)

Sets a ringing or alert tone for a profile and not check the file. This function only can be used when user set a ringing or alert tone for some profiles and avoid to repeat check the file. Notice: the SetProfileToneL should be executed before this function, because SetProfileToneL will check the file. leaves with KErrPermissionDenied. If the file is a WMA file in user data area and those are not allowed, leaves with KErrArgument. If the file is not allowed to be changed leaves with KErrAccessDenied. If the selected profile is not allowed to be changed (e.g. Drive-profile) leaves with KErrAccessDenied. In case of a ringing tone, if Alternate Line Service is enabled, finds out the line in use and sets the ringing tone for that line respectively.

Parameters

TInt aProfileIdThe ID of the profile (NOT an index).
TProfileTones aToneSettingIdentifies the tone which is updated.
const TDesC & aFileNameFull path and filename of the tone to be used as the new ringing or alert tone. An empty descriptor will be replaced with "No_Sound.wav".

SetToneForAllProfilesL(TProfileTones, const TDesC &)

IMPORT_C TIntSetToneForAllProfilesL(TProfileTonesaToneSetting,
const TDesC &aFileName
)
Sets a ringing or alert tone for all profiles. If the file does not exist, leaves with KErrNotFound. If the file is of an unsupported type, leaves with KErrNotSupported. If the file is an unprotected MP3/AAC in user data area and if those are not allowed as ringing or alert tones, leaves with KErrPermissionDenied. If the file is a WMA file in user data area and those are not allowed, leaves with KErrArgument. If the file is not allowed to be changed (e.g. Drive-profile) method ignores profile changes and selects next profile. In case of a ringing tone, if Alternate Line Service is enabled, finds out the line in use and sets the ringing tone for that line respectively. Does not affect on user created profiles except if the active profile is user created of which the ringing or alert tone is also changed.
Since
2.6

Parameters

TProfileTones aToneSettingIdentifies the tone which is updated.
const TDesC & aFileNameFull path and filename of the tone to be used as the new ringing or alert tone. An empty descriptor will be replaced with "No_Sound.wav".

SetToneL(MProfileExtended &, TProfileTones, const TDesC &)

voidSetToneL(MProfileExtended &aProfile,
TProfileTonesaToneSetting,
const TDesC &aFileName
)[protected]

Sets the tone to an MProfileExtended instance.

Parameters

MProfileExtended & aProfileThe MProfileExtended instance.
TProfileTones aToneSettingIdentifies the tone which is updated.
const TDesC & aFileNameThe tone file name.

ShowErrorNoteL(TInt)

voidShowErrorNoteL(TIntaResourceId)const [protected]

Displays an error note.

Parameters

TInt aResourceIdResource ID to a TBUF resource.

ShowSizeErrorNoteL(TInt)

voidShowSizeErrorNoteL(TIntaSizeLimitKB)[protected]

Displays error note about exceeded tone file size.

Parameters

TInt aSizeLimitKBfile size limit.

Member Data Documentation

TInt iAlternateLineSetting

TInt iAlternateLineSetting[private]

DRMCommon * iDrmCommon

DRMCommon *iDrmCommon[private]

CDRMHelper * iDrmHelper

CDRMHelper *iDrmHelper[private]

RFs iFs

RFs iFs[private]

TInt iMaxSizeKB

TInt iMaxSizeKB[private]

MProfileEngineExtended * iProfileEngine

MProfileEngineExtended *iProfileEngine[private]

MProfilesLocalFeatures * iProfilesFeatures

MProfilesLocalFeatures *iProfilesFeatures[private]

RSSSettings iSSSettings

RSSSettings iSSSettings[private]