williamr@2: /* williamr@2: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Profile settings interface. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef MPROENGPROFILE_H williamr@2: #define MPROENGPROFILE_H williamr@2: williamr@2: // INCLUDES williamr@2: #include // TContactItemId williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class MProEngProfileName; williamr@2: class MProEngTones; williamr@2: class MProEngToneSettings; williamr@2: class MProEngProfileExt; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Profile settings interface. williamr@2: * MProEngProfile offers methods to get the alert for items, profile settings williamr@2: * and profile name interface. williamr@2: * How to use: williamr@2: * @code williamr@2: * // Get active profile with MProEngEngine::ActiveProfileL(). williamr@2: * MProEngProfile* profile = iProfileEngine->ActiveProfileL(); williamr@2: * williamr@2: * // Use profile object here... williamr@2: * williamr@2: * // When you are ready, free resources with MProEngProfile::Release() williamr@2: * profile->Release(); williamr@2: * williamr@2: * // If you release resources in destructor then: williamr@2: * if( iProfile ) williamr@2: * { williamr@2: * iProfile->Release(); williamr@2: * } williamr@2: * williamr@2: * // If you put this class to CleanupStack then use void CleanupReleasePushL() williamr@2: * CleanupReleasePushL( *profile ); williamr@2: * @endcode williamr@2: * williamr@2: * @lib ProfileEngine.lib williamr@2: * @since 3.1 williamr@2: */ williamr@2: class MProEngProfile williamr@2: { williamr@2: protected: // Destructor williamr@2: williamr@2: virtual ~MProEngProfile() {}; williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Free resources of the profile. williamr@2: * @since 3.1 williamr@2: */ williamr@2: virtual void Release() = 0; williamr@2: williamr@2: /** williamr@2: * Return the alert for item array. williamr@2: * Only the calls coming from people who belong to one or more williamr@2: * "Alert for" groups returned here trigger an audible alert. williamr@2: * @since 3.1 williamr@2: * @return Alert for array williamr@2: */ williamr@2: virtual const TArray AlertForL() = 0; williamr@2: williamr@2: /** williamr@2: * This method set alert for items to the profile. williamr@2: * Only the calls coming from people who belong to one or more williamr@2: * "Alert for" groups set here trigger an audible alert. williamr@2: * @since 3.1 williamr@2: * @param aAlertFor Alert for array. If the length of this array is 0, williamr@2: * it is interpreted: "alert for all calls". williamr@2: * @return KErrAccessDenied, if the "Alert for" groups setting of the williamr@2: * profile is unmodifiable. williamr@2: * KErrArgument, if the argument array is too large. williamr@2: * KErrNone, if succesful. williamr@2: */ williamr@2: virtual TInt SetAlertForL( williamr@2: const TArray& aAlertFor ) = 0; williamr@2: williamr@2: /** williamr@2: * Return whether this profile is silent. A profile being silent means williamr@2: * that either the ringing type is silent or all the alert tones are set williamr@2: * to "None". williamr@2: * @since 3.1 williamr@2: * @return ETrue if this profile is silent. williamr@2: */ williamr@2: virtual TBool IsSilent() const = 0; williamr@2: williamr@2: /** williamr@2: * Return profile name interface. williamr@2: * @since 3.1 williamr@2: * @return Instance of the profile name interface. williamr@2: */ williamr@2: virtual MProEngProfileName& ProfileName() const = 0; williamr@2: williamr@2: /** williamr@2: * Return profile tones interface. williamr@2: * @since 3.1 williamr@2: * @return Instance of the profile tones interface. williamr@2: */ williamr@2: virtual MProEngTones& ProfileTones() const = 0; williamr@2: williamr@2: /** williamr@2: * Returns tone settings of this profile. williamr@2: * @since 3.1 williamr@2: * @return Returns tone settings of this profile. williamr@2: */ williamr@2: virtual MProEngToneSettings& ToneSettings() const = 0; williamr@2: williamr@2: /** williamr@2: * Store profile settings. williamr@2: * Leaves with: williamr@2: * KErrAccessDenied if one or more of the settings of this profile is/are williamr@2: * read-only,
williamr@2: * KErrAlreadyExists if the profile name has been changed and there williamr@2: * already is a profile with the same name,
williamr@2: * KErrNotFound if a file set as an alert tone cannot be found,
williamr@2: * KErrNotSupported if the MIME type of a file set as an alert tone is williamr@2: * not supported to be used as an alert tone,
williamr@2: * KErrArgument if a file set as an alert tone is DRM-protected but the williamr@2: * platform does not allow the files of this MIME type to be set as alert williamr@2: * tones when protected,
williamr@2: * KErrPermissionDenied, if a file set as an alert tone is not williamr@2: * DRM-protected and the platform does not allow the files of this MIME williamr@2: * type to be set as alert tones when unprotected,
williamr@2: * KErrCancel, if a file set as an alert tone is an unactivated DRM file williamr@2: * and user does not want to activate it,
williamr@2: * KErrTooBig if the tone file set for ringing tone (line 1 or line 2) is williamr@2: * too big in case the platform has this kind of limitation set,
williamr@2: * another system-wide error code. williamr@2: * williamr@2: * Only processes with WriteDeviceData capability can succesfully call williamr@2: * this method. williamr@2: * @since 3.1 williamr@2: */ williamr@2: virtual void CommitChangeL() = 0; williamr@2: williamr@2: private: // Extension interface williamr@2: williamr@2: /** williamr@2: * This member is internal and not intended for use. williamr@2: */ williamr@2: virtual MProEngProfileExt* Extension() { return NULL; } williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // MPROENGPROFILE_H williamr@2: williamr@2: // End of File williamr@2: