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: Condition listener call-back interface
19 #ifndef SENSRVCHANNELCONDITIONLISTENER_H
20 #define SENSRVCHANNELCONDITIONLISTENER_H
23 #include <sensrvchannelconditionset.h>
24 #include <sensrvtypes.h>
27 * Condition listener callback interface to indicate when a ConditionSet has been met.
29 * This class is for use with the CSensrvChannel::StartConditionListeningL() method. Clients wishing
30 * to use condition listening must inherit from this class and provide a reference to an instance of
31 * it in CSensrvChannel::StartConditionListeningL().
33 * @see CSensrvChannel::StartConditionListeningL()
34 * @see CSensrvChannel::StopConditionListening()
35 * @see CSensrvChannel::AddConditionL()
36 * @see CSensrvChannel::RemoveConditionL()
37 * @lib sensrvclient.lib
40 class MSensrvChannelConditionListener
44 * Callback implemented by a client so that they can be notified when a channel ConditionSet
45 * is met. If a client wants to use same ConditionSet after receiving this notification, the
46 * client must add ConditionSet again to the channel object. If the ConditionSet is no longer
47 * required the client can destroy it.
49 * If the ConditionSet contains more than one condition, it is not known which of the individual
50 * conditions in the set were met.
52 * Clients providing an implementation for this callback must ensure that the operation does not
53 * leave. If a leave does occur then the behaviour is undefined.
56 * @param aChannel Channel associated with the listener
57 * @param aChannelConditionSet Channel ConditionSet that is met
58 * @param aValue Channel data value that met the condition
59 * @see CSensrvChannel::GetData() for example on how to retrive data from aValue
61 virtual void ConditionMet( CSensrvChannel& aChannel,
62 CSensrvChannelConditionSet& aChannelConditionSet,
66 * Callback implemented by a client so that they can be notified when condition listening
67 * has failed. If the error is fatal the channel will be closed, the sensor server session
68 * has been terminated and the channel object is no longer useable. If the error is minor,
69 * some condition matches have potentially been missed, however listening is still active.
71 * Clients providing an implementation for this callback must ensure that the operation does not
72 * leave. If a leave does occur then the behaviour is undefined.
75 * @param aChannel Channel associated with the listener
76 * @param aError The error severity
78 virtual void ConditionError ( CSensrvChannel& aChannel,
79 TSensrvErrorSeverity aError ) = 0;
82 * Callback to future proof this API so that additional callbacks can be added in the future
83 * without breaking binary compatibility.
86 * @param aInterfaceUid Identifier for the interface to be retrieved
87 * @param aInterface A reference to a pointer for the specified interface. Implementation sets
88 * aInterface to a valid pointer if the M-class identified by aInterfaceUid is supported, otherwise
89 * it is set to NULL on exit.
90 * @leave One of the system-wide error codes
92 virtual void GetChannelConditionListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface ) = 0;
98 #endif //SENSRVCHANNELCONDITIONLISTENER_H