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.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Profile settings interface.
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
#ifndef MPROENGPROFILE_H
williamr@2
    21
#define MPROENGPROFILE_H
williamr@2
    22
williamr@2
    23
//  INCLUDES
williamr@2
    24
#include <cntdef.h> // TContactItemId
williamr@2
    25
williamr@2
    26
// FORWARD DECLARATIONS
williamr@2
    27
class MProEngProfileName;
williamr@2
    28
class MProEngTones;
williamr@2
    29
class MProEngToneSettings;
williamr@2
    30
class MProEngProfileExt;
williamr@2
    31
williamr@2
    32
// CLASS DECLARATION
williamr@2
    33
williamr@2
    34
/**
williamr@2
    35
*  Profile settings interface.
williamr@2
    36
*  MProEngProfile offers methods to get the alert for items, profile settings
williamr@2
    37
*  and profile name interface.
williamr@2
    38
*  How to use:
williamr@2
    39
*  @code
williamr@2
    40
*  // Get active profile with MProEngEngine::ActiveProfileL().
williamr@2
    41
*  MProEngProfile* profile = iProfileEngine->ActiveProfileL();
williamr@2
    42
*
williamr@2
    43
*  // Use profile object here...
williamr@2
    44
*
williamr@2
    45
*  // When you are ready, free resources with MProEngProfile::Release()
williamr@2
    46
*  profile->Release();
williamr@2
    47
*
williamr@2
    48
*  // If you release resources in destructor then:
williamr@2
    49
*  if( iProfile )
williamr@2
    50
*      {
williamr@2
    51
*      iProfile->Release();
williamr@2
    52
*      }
williamr@2
    53
*
williamr@2
    54
*  // If you put this class to CleanupStack then use void CleanupReleasePushL()
williamr@2
    55
*  CleanupReleasePushL( *profile );
williamr@2
    56
*  @endcode
williamr@2
    57
*
williamr@2
    58
*  @lib ProfileEngine.lib
williamr@2
    59
*  @since 3.1
williamr@2
    60
*/
williamr@2
    61
class MProEngProfile
williamr@2
    62
    {
williamr@2
    63
    protected:  // Destructor
williamr@2
    64
williamr@2
    65
        virtual ~MProEngProfile() {};
williamr@2
    66
williamr@2
    67
    public: // New functions
williamr@2
    68
williamr@2
    69
        /**
williamr@2
    70
        * Free resources of the profile.
williamr@2
    71
        * @since 3.1
williamr@2
    72
        */
williamr@2
    73
        virtual void Release() = 0;
williamr@2
    74
williamr@2
    75
        /**
williamr@2
    76
        * Return the alert for item array.
williamr@2
    77
        * Only the calls coming from people who belong to one or more
williamr@2
    78
        * "Alert for" groups returned here trigger an audible alert.
williamr@2
    79
        * @since 3.1
williamr@2
    80
        * @return Alert for array
williamr@2
    81
        */
williamr@2
    82
        virtual const TArray<TContactItemId> AlertForL() = 0;
williamr@2
    83
williamr@2
    84
        /**
williamr@2
    85
        * This method set alert for items to the profile.
williamr@2
    86
        * Only the calls coming from people who belong to one or more
williamr@2
    87
        * "Alert for" groups set here trigger an audible alert.
williamr@2
    88
        * @since 3.1
williamr@2
    89
        * @param aAlertFor Alert for array. If the length of this array is 0,
williamr@2
    90
        *        it is interpreted: "alert for all calls".
williamr@2
    91
        * @return KErrAccessDenied, if the "Alert for" groups setting of the
williamr@2
    92
        *         profile is unmodifiable.
williamr@2
    93
        *         KErrArgument, if the argument array is too large.
williamr@2
    94
        *         KErrNone, if succesful.
williamr@2
    95
        */
williamr@2
    96
        virtual TInt SetAlertForL(
williamr@2
    97
            const TArray<TContactItemId>& aAlertFor ) = 0;
williamr@2
    98
williamr@2
    99
        /**
williamr@2
   100
        * Return whether this profile is silent. A profile being silent means
williamr@2
   101
        * that either the ringing type is silent or all the alert tones are set
williamr@2
   102
        * to "None".
williamr@2
   103
        * @since 3.1
williamr@2
   104
        * @return ETrue if this profile is silent.
williamr@2
   105
        */
williamr@2
   106
        virtual TBool IsSilent() const = 0;
williamr@2
   107
williamr@2
   108
        /**
williamr@2
   109
        * Return profile name interface.
williamr@2
   110
        * @since 3.1
williamr@2
   111
        * @return Instance of the profile name interface.
williamr@2
   112
        */
williamr@2
   113
        virtual MProEngProfileName& ProfileName() const = 0;
williamr@2
   114
williamr@2
   115
        /**
williamr@2
   116
        * Return profile tones interface.
williamr@2
   117
        * @since 3.1
williamr@2
   118
        * @return Instance of the profile tones interface.
williamr@2
   119
        */
williamr@2
   120
        virtual MProEngTones& ProfileTones() const = 0;
williamr@2
   121
williamr@2
   122
        /**
williamr@2
   123
        * Returns tone settings of this profile.
williamr@2
   124
        * @since 3.1
williamr@2
   125
        * @return Returns tone settings of this profile.
williamr@2
   126
        */
williamr@2
   127
        virtual MProEngToneSettings& ToneSettings() const = 0;
williamr@2
   128
williamr@2
   129
        /**
williamr@2
   130
        * Store profile settings.
williamr@2
   131
        * Leaves with:
williamr@2
   132
        * KErrAccessDenied if one or more of the settings of this profile is/are
williamr@2
   133
        * read-only,<br>
williamr@2
   134
        * KErrAlreadyExists if the profile name has been changed and there
williamr@2
   135
        * already is a profile with the same name,<br>
williamr@2
   136
        * KErrNotFound if a file set as an alert tone cannot be found,<br>
williamr@2
   137
        * KErrNotSupported if the MIME type of a file set as an alert tone is
williamr@2
   138
        * not supported to be used as an alert tone,<br>
williamr@2
   139
        * KErrArgument if a file set as an alert tone is DRM-protected but the
williamr@2
   140
        * platform does not allow the files of this MIME type to be set as alert
williamr@2
   141
        * tones when protected,<br>
williamr@2
   142
        * KErrPermissionDenied, if a file set as an alert tone is not
williamr@2
   143
        * DRM-protected and the platform does not allow the files of this MIME
williamr@2
   144
        * type to be set as alert tones when unprotected,<br>
williamr@2
   145
        * KErrCancel, if a file set as an alert tone is an unactivated DRM file
williamr@2
   146
        * and user does not want to activate it,<br>
williamr@2
   147
        * KErrTooBig if the tone file set for ringing tone (line 1 or line 2) is
williamr@2
   148
        * too big in case the platform has this kind of limitation set,<br>
williamr@2
   149
        * another system-wide error code.
williamr@2
   150
        * 
williamr@2
   151
        * Only processes with WriteDeviceData capability can succesfully call
williamr@2
   152
        * this method.
williamr@2
   153
        * @since 3.1
williamr@2
   154
        */
williamr@2
   155
        virtual void CommitChangeL() = 0;
williamr@2
   156
williamr@2
   157
    private: // Extension interface
williamr@2
   158
williamr@2
   159
        /**
williamr@2
   160
        * This member is internal and not intended for use.
williamr@2
   161
        */
williamr@2
   162
        virtual MProEngProfileExt* Extension() { return NULL; }
williamr@2
   163
williamr@2
   164
    };
williamr@2
   165
williamr@2
   166
#endif      //  MPROENGPROFILE_H
williamr@2
   167
williamr@2
   168
// End of File
williamr@2
   169