williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2008 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@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.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: Condition listener call-back interface
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef SENSRVCHANNELCONDITIONLISTENER_H
|
williamr@2
|
20 |
#define SENSRVCHANNELCONDITIONLISTENER_H
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <e32base.h>
|
williamr@2
|
23 |
#include <sensrvchannelconditionset.h>
|
williamr@2
|
24 |
#include <sensrvtypes.h>
|
williamr@2
|
25 |
|
williamr@2
|
26 |
/**
|
williamr@2
|
27 |
* Condition listener callback interface to indicate when a ConditionSet has been met.
|
williamr@2
|
28 |
*
|
williamr@2
|
29 |
* This class is for use with the CSensrvChannel::StartConditionListeningL() method. Clients wishing
|
williamr@2
|
30 |
* to use condition listening must inherit from this class and provide a reference to an instance of
|
williamr@2
|
31 |
* it in CSensrvChannel::StartConditionListeningL().
|
williamr@2
|
32 |
*
|
williamr@2
|
33 |
* @see CSensrvChannel::StartConditionListeningL()
|
williamr@2
|
34 |
* @see CSensrvChannel::StopConditionListening()
|
williamr@2
|
35 |
* @see CSensrvChannel::AddConditionL()
|
williamr@2
|
36 |
* @see CSensrvChannel::RemoveConditionL()
|
williamr@2
|
37 |
* @lib sensrvclient.lib
|
williamr@2
|
38 |
* @since S60 5.0
|
williamr@2
|
39 |
*/
|
williamr@2
|
40 |
class MSensrvChannelConditionListener
|
williamr@2
|
41 |
{
|
williamr@2
|
42 |
public:
|
williamr@2
|
43 |
/**
|
williamr@2
|
44 |
* Callback implemented by a client so that they can be notified when a channel ConditionSet
|
williamr@2
|
45 |
* is met. If a client wants to use same ConditionSet after receiving this notification, the
|
williamr@2
|
46 |
* client must add ConditionSet again to the channel object. If the ConditionSet is no longer
|
williamr@2
|
47 |
* required the client can destroy it.
|
williamr@2
|
48 |
*
|
williamr@2
|
49 |
* If the ConditionSet contains more than one condition, it is not known which of the individual
|
williamr@2
|
50 |
* conditions in the set were met.
|
williamr@2
|
51 |
*
|
williamr@2
|
52 |
* Clients providing an implementation for this callback must ensure that the operation does not
|
williamr@2
|
53 |
* leave. If a leave does occur then the behaviour is undefined.
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
* @since S60 5.0
|
williamr@2
|
56 |
* @param aChannel Channel associated with the listener
|
williamr@2
|
57 |
* @param aChannelConditionSet Channel ConditionSet that is met
|
williamr@2
|
58 |
* @param aValue Channel data value that met the condition
|
williamr@2
|
59 |
* @see CSensrvChannel::GetData() for example on how to retrive data from aValue
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
virtual void ConditionMet( CSensrvChannel& aChannel,
|
williamr@2
|
62 |
CSensrvChannelConditionSet& aChannelConditionSet,
|
williamr@2
|
63 |
TDesC8& aValue ) = 0;
|
williamr@2
|
64 |
|
williamr@2
|
65 |
/**
|
williamr@2
|
66 |
* Callback implemented by a client so that they can be notified when condition listening
|
williamr@2
|
67 |
* has failed. If the error is fatal the channel will be closed, the sensor server session
|
williamr@2
|
68 |
* has been terminated and the channel object is no longer useable. If the error is minor,
|
williamr@2
|
69 |
* some condition matches have potentially been missed, however listening is still active.
|
williamr@2
|
70 |
*
|
williamr@2
|
71 |
* Clients providing an implementation for this callback must ensure that the operation does not
|
williamr@2
|
72 |
* leave. If a leave does occur then the behaviour is undefined.
|
williamr@2
|
73 |
*
|
williamr@2
|
74 |
* @since S60 5.0
|
williamr@2
|
75 |
* @param aChannel Channel associated with the listener
|
williamr@2
|
76 |
* @param aError The error severity
|
williamr@2
|
77 |
*/
|
williamr@2
|
78 |
virtual void ConditionError ( CSensrvChannel& aChannel,
|
williamr@2
|
79 |
TSensrvErrorSeverity aError ) = 0;
|
williamr@2
|
80 |
|
williamr@2
|
81 |
/**
|
williamr@2
|
82 |
* Callback to future proof this API so that additional callbacks can be added in the future
|
williamr@2
|
83 |
* without breaking binary compatibility.
|
williamr@2
|
84 |
*
|
williamr@2
|
85 |
* @since S60 5.0
|
williamr@2
|
86 |
* @param aInterfaceUid Identifier for the interface to be retrieved
|
williamr@2
|
87 |
* @param aInterface A reference to a pointer for the specified interface. Implementation sets
|
williamr@2
|
88 |
* aInterface to a valid pointer if the M-class identified by aInterfaceUid is supported, otherwise
|
williamr@2
|
89 |
* it is set to NULL on exit.
|
williamr@2
|
90 |
* @leave One of the system-wide error codes
|
williamr@2
|
91 |
*/
|
williamr@2
|
92 |
virtual void GetChannelConditionListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface ) = 0;
|
williamr@2
|
93 |
|
williamr@2
|
94 |
};
|
williamr@2
|
95 |
|
williamr@2
|
96 |
|
williamr@2
|
97 |
|
williamr@2
|
98 |
#endif //SENSRVCHANNELCONDITIONLISTENER_H
|
williamr@2
|
99 |
|
williamr@2
|
100 |
// End of File
|