2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Interface for channel listener
20 #ifndef SENSRVCHANNELLISTENER_H
21 #define SENSRVCHANNELLISTENER_H
25 #include <sensrvchannelfinder.h>
26 #include <sensrvtypes.h>
27 #include <sensrvchannelinfo.h>
30 * Channel listener callback interface to indicate when channels have been added or removed.
32 * This class is for use with the CSensrvChannelFinder::SetChannelListenerL() method. Clients wishing
33 * to find channels must inherit from this class and provide a reference to an instance of it in
34 * CSensrvChannelFinder::SetChannelListenerL().
36 * @see CSensrvChannelFinder::SetChannelListenerL()
37 * @lib sensrvclient.lib
40 class MSensrvChannelListener
45 * Callback implemented by a client so that they can be notified when channels are added
46 * or removed from the system when new software is installed or uninstalled.
48 * Clients providing an implementation for this callback must ensure that the operation does
49 * not leave. If a leave does occur then the behaviour is undefined.
52 * @param aDetectedChannel Information for the channel that has been added or removed
53 * @param aChangeType If ESensrvChannelAdded, channel is a newly available channel.
54 * If ESensrvChannelRemoved, channel has been removed and is no longer available.
56 virtual void ChannelChangeDetected( const TSensrvChannelInfo& aDetectedChannel,
57 TSensrvChannelChangeType aChangeType ) = 0;
60 * Callback implemented by a client so that they can be notified when channel listening
61 * has failed. If the error is fatal the sensor server session has been terminated and
62 * the channel finder is no longer useable. If the error is minor some notifications have
63 * potentially been lost, however listening is still active.
65 * Clients providing an implementation for this callback must ensure that the operation does
66 * not leave. If a leave does occur then the behaviour is undefined.
69 * @param aChannelFinder Reference to the related channelfinder object
70 * @param aError The error severity
72 virtual void ChannelDetectionError( CSensrvChannelFinder& aChannelFinder,
73 TSensrvErrorSeverity aError ) = 0;
76 * Callback to future proof this API so that additional callbacks can be added in the future
77 * without breaking binary compatibility.
80 * @param aInterfaceUid Identifier for the interface to be retrieved
81 * @param aInterface A reference to a pointer for the specified interface. Implementation sets
82 * aInterface to a valid pointer if the M-class identified by aInterfaceUid is supported, otherwise
83 * it is set to NULL on exit.
84 * @leave One of the system-wide error codes
86 virtual void GetChannelListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface ) = 0;
92 #endif //SENSRVCHANNELLISTENER_H