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
Constructor & Destructor Documentation
CProfileToneHandler()
CProfileToneHandler
|
(
|
)
|
[private]
|
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 &)
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]
|
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.
|
PhoneSettingChanged(TSSSettingsSetting, TInt)
void
|
PhoneSettingChanged
|
(
|
TSSSettingsSetting
|
aSetting,
|
|
TInt
|
aNewValue
|
|
)
|
|
Parameters
TSSSettingsSetting
aSetting
|
|
TInt
aNewValue
|
|
ReadToneL(const MProfileExtended &, TProfileTones)
const
TDesC
&
|
ReadToneL
|
(
|
const
MProfileExtended
&
|
aProfile,
|
|
TProfileTones
|
aToneSetting
|
|
)
|
const [protected]
|
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]
|
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]
|
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]
|
TInt
iMaxSizeKB
TInt
|
iMaxSizeKB
|
[private]
|
MProfileEngineExtended * iProfileEngine
MProfilesLocalFeatures * iProfilesFeatures
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.