epoc32/include/mw/mproengprofile.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Profile settings interface.
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef MPROENGPROFILE_H
    21 #define MPROENGPROFILE_H
    22 
    23 //  INCLUDES
    24 #include <cntdef.h> // TContactItemId
    25 
    26 // FORWARD DECLARATIONS
    27 class MProEngProfileName;
    28 class MProEngTones;
    29 class MProEngToneSettings;
    30 class MProEngProfileExt;
    31 
    32 // CLASS DECLARATION
    33 
    34 /**
    35 *  Profile settings interface.
    36 *  MProEngProfile offers methods to get the alert for items, profile settings
    37 *  and profile name interface.
    38 *  How to use:
    39 *  @code
    40 *  // Get active profile with MProEngEngine::ActiveProfileL().
    41 *  MProEngProfile* profile = iProfileEngine->ActiveProfileL();
    42 *
    43 *  // Use profile object here...
    44 *
    45 *  // When you are ready, free resources with MProEngProfile::Release()
    46 *  profile->Release();
    47 *
    48 *  // If you release resources in destructor then:
    49 *  if( iProfile )
    50 *      {
    51 *      iProfile->Release();
    52 *      }
    53 *
    54 *  // If you put this class to CleanupStack then use void CleanupReleasePushL()
    55 *  CleanupReleasePushL( *profile );
    56 *  @endcode
    57 *
    58 *  @lib ProfileEngine.lib
    59 *  @since 3.1
    60 */
    61 class MProEngProfile
    62     {
    63     protected:  // Destructor
    64 
    65         virtual ~MProEngProfile() {};
    66 
    67     public: // New functions
    68 
    69         /**
    70         * Free resources of the profile.
    71         * @since 3.1
    72         */
    73         virtual void Release() = 0;
    74 
    75         /**
    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.
    79         * @since 3.1
    80         * @return Alert for array
    81         */
    82         virtual const TArray<TContactItemId> AlertForL() = 0;
    83 
    84         /**
    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.
    88         * @since 3.1
    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.
    95         */
    96         virtual TInt SetAlertForL(
    97             const TArray<TContactItemId>& aAlertFor ) = 0;
    98 
    99         /**
   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
   102         * to "None".
   103         * @since 3.1
   104         * @return ETrue if this profile is silent.
   105         */
   106         virtual TBool IsSilent() const = 0;
   107 
   108         /**
   109         * Return profile name interface.
   110         * @since 3.1
   111         * @return Instance of the profile name interface.
   112         */
   113         virtual MProEngProfileName& ProfileName() const = 0;
   114 
   115         /**
   116         * Return profile tones interface.
   117         * @since 3.1
   118         * @return Instance of the profile tones interface.
   119         */
   120         virtual MProEngTones& ProfileTones() const = 0;
   121 
   122         /**
   123         * Returns tone settings of this profile.
   124         * @since 3.1
   125         * @return Returns tone settings of this profile.
   126         */
   127         virtual MProEngToneSettings& ToneSettings() const = 0;
   128 
   129         /**
   130         * Store profile settings.
   131         * Leaves with:
   132         * KErrAccessDenied if one or more of the settings of this profile is/are
   133         * read-only,<br>
   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.
   150         * 
   151         * Only processes with WriteDeviceData capability can succesfully call
   152         * this method.
   153         * @since 3.1
   154         */
   155         virtual void CommitChangeL() = 0;
   156 
   157     private: // Extension interface
   158 
   159         /**
   160         * This member is internal and not intended for use.
   161         */
   162         virtual MProEngProfileExt* Extension() { return NULL; }
   163 
   164     };
   165 
   166 #endif      //  MPROENGPROFILE_H
   167 
   168 // End of File
   169