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 ()
void PhoneSettingChanged ( TSSSettingsSetting , TInt )
IMPORT_C TInt SetActiveProfileRingingToneL (const TDesC &)
IMPORT_C TInt SetProfileToneL ( TInt , TProfileTones , const TDesC &)
IMPORT_C TInt SetProfileToneNotCheckL ( TInt , TProfileTones , const TDesC &)
IMPORT_C TInt SetToneForAllProfilesL ( 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 &)
void DoSetProfileToneL ( TInt , TProfileTones , const TDesC &)
void GetMaxToneFileSizeL ()
TBool IsProtected (const TDesC &)
TBool IsProtectedL (const TDesC &)
const TDesC & ReadToneL (const MProfileExtended &, TProfileTones )
void RemoveAutomated (const TDesC &)
TInt SetAutomated ( TProfileTones , const TDesC &)
void SetToneL ( MProfileExtended &, TProfileTones , const TDesC &)
void ShowErrorNoteL ( TInt )
void ShowSizeErrorNoteL ( TInt )
Private Member Functions
CProfileToneHandler ()
void ConstructL ()
void DrmConstructL ()
TBool IsFileWMDRMProtectedL (const TDesC &)
void ReleaseDrm ()
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 & aDataType Tone 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 & aFileName File 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 & aFileName File 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 & aFileName Full 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 & aFileName Full path and filename of the file to be checked.

CheckResultAndProtectionL(TInt, const TDesC &)

TInt CheckResultAndProtectionL ( TInt aResult,
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 aResult result of the CheckFileL() call made before this.
const TDesC & aFileName the 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,
TInt aSizeLimitKB
) [protected]

Checks ringing tone file size.

Parameters

const TDesC & aFile file to check.
TInt aSizeLimitKB maximum allowed file size in KB.

ConstructL()

void ConstructL ( ) [private]

DataTypeL(const TDesC &)

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

Returns data type of a file.

Parameters

const TDesC & aFileName Full path and filename.

DoSetProfileToneL(TInt, TProfileTones, const TDesC &)

void DoSetProfileToneL ( TInt aProfileId,
TProfileTones aToneSetting,
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 aProfileId The ID of the profile (NOT an index).
TProfileTones aToneSetting Identifies the tone which is updated.
const TDesC & aFileName Full path and filename of the tone to be used as the new ringing or alert tone.

DrmConstructL()

void DrmConstructL ( ) [private]

GetMaxToneFileSizeL()

void GetMaxToneFileSizeL ( ) [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 & aFileName The 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 & aFileName The file name.

NewL()

IMPORT_C CProfileToneHandler * NewL ( ) [static]

NewLC()

IMPORT_C CProfileToneHandler * NewLC ( ) [static]

PhoneSettingChanged(TSSSettingsSetting, TInt)

void PhoneSettingChanged ( TSSSettingsSetting aSetting,
TInt aNewValue
)

From MSSSettings

Parameters

TSSSettingsSetting aSetting
TInt aNewValue

ReadToneL(const MProfileExtended &, TProfileTones)

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

Reads a tone setting from an MProfileExtended instance.

Parameters

const MProfileExtended & aProfile The MProfileExtended instance.
TProfileTones aToneSetting Identifies the tone which is read.

ReleaseDrm()

void ReleaseDrm ( ) [private]

RemoveAutomated(const TDesC &)

void RemoveAutomated ( const TDesC & aFileName ) [protected]

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

Parameters

const TDesC & aFileName File to be removed from automated content list.

SetActiveProfileRingingToneL(const TDesC &)

IMPORT_C TInt SetActiveProfileRingingToneL ( 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 & aFileName Full 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 ( TProfileTones aToneSetting,
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 aToneSetting The type of tone (e.g. ringing tone, SMS tone) to be registered as automated content.
const TDesC & aFileName File to be registered as automated content.

SetAutomatedL(TProfileTones, const TDesC &)

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

Parameters

TProfileTones aToneSetting
const TDesC & aFileName

SetProfileToneL(TInt, TProfileTones, const TDesC &)

IMPORT_C TInt SetProfileToneL ( TInt aProfileId,
TProfileTones aToneSetting,
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 aProfileId The ID of the profile (NOT an index).
TProfileTones aToneSetting Identifies the tone which is updated.
const TDesC & aFileName Full 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 TInt SetProfileToneNotCheckL ( TInt aProfileId,
TProfileTones aToneSetting,
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 aProfileId The ID of the profile (NOT an index).
TProfileTones aToneSetting Identifies the tone which is updated.
const TDesC & aFileName Full 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 TInt SetToneForAllProfilesL ( TProfileTones aToneSetting,
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 aToneSetting Identifies the tone which is updated.
const TDesC & aFileName Full 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 &)

void SetToneL ( MProfileExtended & aProfile,
TProfileTones aToneSetting,
const TDesC & aFileName
) [protected]

Sets the tone to an MProfileExtended instance.

Parameters

MProfileExtended & aProfile The MProfileExtended instance.
TProfileTones aToneSetting Identifies the tone which is updated.
const TDesC & aFileName The tone file name.

ShowErrorNoteL(TInt)

void ShowErrorNoteL ( TInt aResourceId ) const [protected]

Displays an error note.

Parameters

TInt aResourceId Resource ID to a TBUF resource.

ShowSizeErrorNoteL(TInt)

void ShowSizeErrorNoteL ( TInt aSizeLimitKB ) [protected]

Displays error note about exceeded tone file size.

Parameters

TInt aSizeLimitKB file 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]