gsprofilesrv_pub/profiles_engine_wrapper_api/inc/MProEngNotifyHandler.h
changeset 0 8c5d936e5675
equal deleted inserted replaced
-1:000000000000 0:8c5d936e5675
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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: Abstract interface for handling profile change notification
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MPROENGNOTIFYHANDLER_H
       
    21 #define MPROENGNOTIFYHANDLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32def.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MProEngNotifyHandlerExt;
       
    28 class MProEngProfileActivationObserver;
       
    29 class MProEngActiveProfileObserver;
       
    30 class MProEngProfileObserver;
       
    31 class MProEngProfileNameArrayObserver;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * Profiles change notification handler.
       
    37 * This class is used for registration to get notifications about changes in
       
    38 * Profiles data.
       
    39 *
       
    40 *  @lib ProfileEngine.lib
       
    41 *  @since S60 3.1
       
    42 */
       
    43 class MProEngNotifyHandler
       
    44     {
       
    45     public: // New functions
       
    46 
       
    47         /**
       
    48          * Request notifications of profile activations. The notifications are
       
    49          * received as long as CancelProfileActivationNotifications() or
       
    50          * CancelAll() is called. If the client wants to change the observer,
       
    51          * he should first cancel these notifications and then re-request them
       
    52          * with the new observer instance.
       
    53          * @since S60 3.1
       
    54          * @param aObserver Reference to the observer to be notified in the
       
    55          *        event of profile activation.
       
    56          * @return KErrNone if succesful, KErrAlreadyExists if this notification
       
    57          *         handler is already used for requesting profile activation
       
    58          *         notifications. In other cases another system wide error code.
       
    59          */
       
    60         virtual TInt RequestProfileActivationNotificationsL(
       
    61                 MProEngProfileActivationObserver& aObserver ) = 0;
       
    62 
       
    63         /**
       
    64          * Request notifications of active profile modifications.
       
    65          * The notifications are received as long as
       
    66          * CancelActiveProfileNotifications() or CancelAll() is called. If the
       
    67          * client wants to change the observer, he should first cancel these
       
    68          * notifications and then re-request them with the new observer
       
    69          * instance.
       
    70          * @since S60 3.1
       
    71          * @param aObserver Reference to the observer to be notified in the
       
    72          *        event of active profile modification.
       
    73          * @return KErrNone if succesful, KErrAlreadyExists if this notification
       
    74          *         handler is already used for requesting active profile
       
    75          *         notifications. In other cases another system wide error code.
       
    76          */
       
    77         virtual TInt RequestActiveProfileNotificationsL(
       
    78                 MProEngActiveProfileObserver& aObserver ) = 0;
       
    79 
       
    80         /**
       
    81          * Request notifications about changes in the given profile.
       
    82          * This is useful for cases when the client is interested about
       
    83          * changes in a specific profile no matter if the profile is active or
       
    84          * not. The notifications are received as long as
       
    85          * CancelProfileNotifications() or CancelAll() is called. If the
       
    86          * client wants to change the observer for the notifications about the
       
    87          * same profile, he should first cancel these notifications and then
       
    88          * re-request them with the new observer instance.
       
    89          * @since S60 3.1
       
    90          * @param aObserver Reference to the observer to be notified in the
       
    91          *        event of modification of the specified profile.
       
    92          * @param aProfileId the ID of the profile the changes of which has to
       
    93          *        be notified.
       
    94          * @return KErrNone if succesful, KErrAlreadyExists if this notification
       
    95          *         handler is already used for requesting notifications of
       
    96          *         changes in the given profile. KErrNotFound, if a profile with
       
    97          *         the given ID does not exist. In other cases another system
       
    98          *         wide error code.
       
    99          */
       
   100         virtual TInt RequestProfileNotificationsL(
       
   101                 MProEngProfileObserver& aObserver,
       
   102                 TInt aProfileId ) = 0;
       
   103 
       
   104         /**
       
   105          * Request notifications about changes in the profile name array. This
       
   106          * includes the cases when: a new profile has been created, a profile
       
   107          * has been deleted, the name of a profile has been changed.
       
   108          * The notifications are received as long as
       
   109          * CancelProfileNameArrayNotifications() or CancelAll() is called. If
       
   110          * the client wants to change the observer, he should first cancel these
       
   111          * notifications and then re-request them with the new observer
       
   112          * instance.
       
   113          * @since S60 3.1
       
   114          * @param aObserver Reference to the observer to be notified in the
       
   115          *        event of a profile name array modification.
       
   116          * @return KErrNone if succesful, KErrAlreadyExists if this notification
       
   117          *         handler is already used for requesting profile name array
       
   118          *         notifications. In other cases another system wide error code.
       
   119          */
       
   120         virtual TInt RequestProfileNameArrayNotificationsL(
       
   121                 MProEngProfileNameArrayObserver& aObserver ) = 0;
       
   122 
       
   123         /**
       
   124          * Cancel the registration for receiving notifications about profile
       
   125          * activation events.
       
   126          * @since S60 3.1
       
   127          */
       
   128         virtual void CancelProfileActivationNotifications() = 0;
       
   129 
       
   130         /**
       
   131          * Cancel the registration for receiving notifications about the active
       
   132          * profile modification events.
       
   133          * @since S60 3.1
       
   134          */
       
   135         virtual void CancelActiveProfileNotifications() = 0;
       
   136 
       
   137         /**
       
   138          * Cancel the registration for receiving notifications about the given
       
   139          * profile modification events.
       
   140          * @since S60 3.1
       
   141          * @param aProfileId The ID of the profile for which the client wants
       
   142          *        to cancel the receiving of modification events.
       
   143          */
       
   144         virtual void CancelProfileNotifications( TInt aProfileId ) = 0;
       
   145 
       
   146         /**
       
   147          * Cancel the registration for receiving notifications about the changes
       
   148          * in the profile name array.
       
   149          * @since S60 3.1
       
   150          */
       
   151         virtual void CancelProfileNameArrayNotifications() = 0;
       
   152 
       
   153         /**
       
   154         * Cancel all the registrations for receiving notifications.
       
   155         * @since Series 60 3.1
       
   156         */
       
   157         virtual void CancelAll() = 0;
       
   158 
       
   159     public:
       
   160 
       
   161         /**
       
   162         * Destructor.
       
   163         */
       
   164         virtual ~MProEngNotifyHandler() {}
       
   165 
       
   166     private: // Extension interface
       
   167 
       
   168         /**
       
   169         * This member is internal and not intended for use.
       
   170         */
       
   171         virtual MProEngNotifyHandlerExt* Extension() { return NULL; }
       
   172 
       
   173     };
       
   174 
       
   175 #endif      // MPROENGNOTIFYHANDLER_H
       
   176 
       
   177 // End of File
       
   178