williamr@2: /* williamr@2: * Copyright (c) 2002-2004 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: Abstract interface for handling profile change notification williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef MPROENGNOTIFYHANDLER_H williamr@2: #define MPROENGNOTIFYHANDLER_H williamr@2: williamr@2: // INCLUDES williamr@2: #include <e32def.h> williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class MProEngNotifyHandlerExt; williamr@2: class MProEngProfileActivationObserver; williamr@2: class MProEngActiveProfileObserver; williamr@2: class MProEngProfileObserver; williamr@2: class MProEngProfileNameArrayObserver; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Profiles change notification handler. williamr@2: * This class is used for registration to get notifications about changes in williamr@2: * Profiles data. williamr@2: * williamr@2: * @lib ProfileEngine.lib williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: class MProEngNotifyHandler williamr@2: { williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Request notifications of profile activations. The notifications are williamr@2: * received as long as CancelProfileActivationNotifications() or williamr@2: * CancelAll() is called. If the client wants to change the observer, williamr@2: * he should first cancel these notifications and then re-request them williamr@2: * with the new observer instance. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Reference to the observer to be notified in the williamr@2: * event of profile activation. williamr@2: * @return KErrNone if succesful, KErrAlreadyExists if this notification williamr@2: * handler is already used for requesting profile activation williamr@2: * notifications. In other cases another system wide error code. williamr@2: */ williamr@2: virtual TInt RequestProfileActivationNotificationsL( williamr@2: MProEngProfileActivationObserver& aObserver ) = 0; williamr@2: williamr@2: /** williamr@2: * Request notifications of active profile modifications. williamr@2: * The notifications are received as long as williamr@2: * CancelActiveProfileNotifications() or CancelAll() is called. If the williamr@2: * client wants to change the observer, he should first cancel these williamr@2: * notifications and then re-request them with the new observer williamr@2: * instance. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Reference to the observer to be notified in the williamr@2: * event of active profile modification. williamr@2: * @return KErrNone if succesful, KErrAlreadyExists if this notification williamr@2: * handler is already used for requesting active profile williamr@2: * notifications. In other cases another system wide error code. williamr@2: */ williamr@2: virtual TInt RequestActiveProfileNotificationsL( williamr@2: MProEngActiveProfileObserver& aObserver ) = 0; williamr@2: williamr@2: /** williamr@2: * Request notifications about changes in the given profile. williamr@2: * This is useful for cases when the client is interested about williamr@2: * changes in a specific profile no matter if the profile is active or williamr@2: * not. The notifications are received as long as williamr@2: * CancelProfileNotifications() or CancelAll() is called. If the williamr@2: * client wants to change the observer for the notifications about the williamr@2: * same profile, he should first cancel these notifications and then williamr@2: * re-request them with the new observer instance. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Reference to the observer to be notified in the williamr@2: * event of modification of the specified profile. williamr@2: * @param aProfileId the ID of the profile the changes of which has to williamr@2: * be notified. williamr@2: * @return KErrNone if succesful, KErrAlreadyExists if this notification williamr@2: * handler is already used for requesting notifications of williamr@2: * changes in the given profile. KErrNotFound, if a profile with williamr@2: * the given ID does not exist. In other cases another system williamr@2: * wide error code. williamr@2: */ williamr@2: virtual TInt RequestProfileNotificationsL( williamr@2: MProEngProfileObserver& aObserver, williamr@2: TInt aProfileId ) = 0; williamr@2: williamr@2: /** williamr@2: * Request notifications about changes in the profile name array. This williamr@2: * includes the cases when: a new profile has been created, a profile williamr@2: * has been deleted, the name of a profile has been changed. williamr@2: * The notifications are received as long as williamr@2: * CancelProfileNameArrayNotifications() or CancelAll() is called. If williamr@2: * the client wants to change the observer, he should first cancel these williamr@2: * notifications and then re-request them with the new observer williamr@2: * instance. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Reference to the observer to be notified in the williamr@2: * event of a profile name array modification. williamr@2: * @return KErrNone if succesful, KErrAlreadyExists if this notification williamr@2: * handler is already used for requesting profile name array williamr@2: * notifications. In other cases another system wide error code. williamr@2: */ williamr@2: virtual TInt RequestProfileNameArrayNotificationsL( williamr@2: MProEngProfileNameArrayObserver& aObserver ) = 0; williamr@2: williamr@2: /** williamr@2: * Cancel the registration for receiving notifications about profile williamr@2: * activation events. williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: virtual void CancelProfileActivationNotifications() = 0; williamr@2: williamr@2: /** williamr@2: * Cancel the registration for receiving notifications about the active williamr@2: * profile modification events. williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: virtual void CancelActiveProfileNotifications() = 0; williamr@2: williamr@2: /** williamr@2: * Cancel the registration for receiving notifications about the given williamr@2: * profile modification events. williamr@2: * @since S60 3.1 williamr@2: * @param aProfileId The ID of the profile for which the client wants williamr@2: * to cancel the receiving of modification events. williamr@2: */ williamr@2: virtual void CancelProfileNotifications( TInt aProfileId ) = 0; williamr@2: williamr@2: /** williamr@2: * Cancel the registration for receiving notifications about the changes williamr@2: * in the profile name array. williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: virtual void CancelProfileNameArrayNotifications() = 0; williamr@2: williamr@2: /** williamr@2: * Cancel all the registrations for receiving notifications. williamr@2: * @since Series 60 3.1 williamr@2: */ williamr@2: virtual void CancelAll() = 0; williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: virtual ~MProEngNotifyHandler() {} 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 MProEngNotifyHandlerExt* Extension() { return NULL; } williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // MPROENGNOTIFYHANDLER_H williamr@2: williamr@2: // End of File williamr@2: