2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Profile settings interface.
20 #ifndef MPROENGPROFILE_H
21 #define MPROENGPROFILE_H
24 #include <cntdef.h> // TContactItemId
26 // FORWARD DECLARATIONS
27 class MProEngProfileName;
29 class MProEngToneSettings;
30 class MProEngProfileExt;
35 * Profile settings interface.
36 * MProEngProfile offers methods to get the alert for items, profile settings
37 * and profile name interface.
40 * // Get active profile with MProEngEngine::ActiveProfileL().
41 * MProEngProfile* profile = iProfileEngine->ActiveProfileL();
43 * // Use profile object here...
45 * // When you are ready, free resources with MProEngProfile::Release()
48 * // If you release resources in destructor then:
51 * iProfile->Release();
54 * // If you put this class to CleanupStack then use void CleanupReleasePushL()
55 * CleanupReleasePushL( *profile );
58 * @lib ProfileEngine.lib
63 protected: // Destructor
65 virtual ~MProEngProfile() {};
67 public: // New functions
70 * Free resources of the profile.
73 virtual void Release() = 0;
76 * Return the alert for item array.
77 * Only the calls coming from people who belong to one or more
78 * "Alert for" groups returned here trigger an audible alert.
80 * @return Alert for array
82 virtual const TArray<TContactItemId> AlertForL() = 0;
85 * This method set alert for items to the profile.
86 * Only the calls coming from people who belong to one or more
87 * "Alert for" groups set here trigger an audible alert.
89 * @param aAlertFor Alert for array. If the length of this array is 0,
90 * it is interpreted: "alert for all calls".
91 * @return KErrAccessDenied, if the "Alert for" groups setting of the
92 * profile is unmodifiable.
93 * KErrArgument, if the argument array is too large.
94 * KErrNone, if succesful.
96 virtual TInt SetAlertForL(
97 const TArray<TContactItemId>& aAlertFor ) = 0;
100 * Return whether this profile is silent. A profile being silent means
101 * that either the ringing type is silent or all the alert tones are set
104 * @return ETrue if this profile is silent.
106 virtual TBool IsSilent() const = 0;
109 * Return profile name interface.
111 * @return Instance of the profile name interface.
113 virtual MProEngProfileName& ProfileName() const = 0;
116 * Return profile tones interface.
118 * @return Instance of the profile tones interface.
120 virtual MProEngTones& ProfileTones() const = 0;
123 * Returns tone settings of this profile.
125 * @return Returns tone settings of this profile.
127 virtual MProEngToneSettings& ToneSettings() const = 0;
130 * Store profile settings.
132 * KErrAccessDenied if one or more of the settings of this profile is/are
134 * KErrAlreadyExists if the profile name has been changed and there
135 * already is a profile with the same name,<br>
136 * KErrNotFound if a file set as an alert tone cannot be found,<br>
137 * KErrNotSupported if the MIME type of a file set as an alert tone is
138 * not supported to be used as an alert tone,<br>
139 * KErrArgument if a file set as an alert tone is DRM-protected but the
140 * platform does not allow the files of this MIME type to be set as alert
141 * tones when protected,<br>
142 * KErrPermissionDenied, if a file set as an alert tone is not
143 * DRM-protected and the platform does not allow the files of this MIME
144 * type to be set as alert tones when unprotected,<br>
145 * KErrCancel, if a file set as an alert tone is an unactivated DRM file
146 * and user does not want to activate it,<br>
147 * KErrTooBig if the tone file set for ringing tone (line 1 or line 2) is
148 * too big in case the platform has this kind of limitation set,<br>
149 * another system-wide error code.
151 * Only processes with WriteDeviceData capability can succesfully call
155 virtual void CommitChangeL() = 0;
157 private: // Extension interface
160 * This member is internal and not intended for use.
162 virtual MProEngProfileExt* Extension() { return NULL; }
166 #endif // MPROENGPROFILE_H