epoc32/include/sensrvchannelconditionlistener.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/sensrvchannelconditionlistener.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/sensrvchannelconditionlistener.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,100 @@
     1.4 -sensrvchannelconditionlistener.h
     1.5 +/*
     1.6 +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  Condition listener call-back interface
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef SENSRVCHANNELCONDITIONLISTENER_H
    1.24 +#define SENSRVCHANNELCONDITIONLISTENER_H
    1.25 +
    1.26 +#include <e32base.h>
    1.27 +#include <sensrvchannelconditionset.h>
    1.28 +#include <sensrvtypes.h>
    1.29 +
    1.30 +/**
    1.31 +* Condition listener callback interface to indicate when a ConditionSet has been met.
    1.32 +* 
    1.33 +* This class is for use with the CSensrvChannel::StartConditionListeningL() method. Clients wishing
    1.34 +* to use condition listening must inherit from this class and provide a reference to an instance of
    1.35 +* it in CSensrvChannel::StartConditionListeningL().
    1.36 +* 
    1.37 +* @see CSensrvChannel::StartConditionListeningL()
    1.38 +* @see CSensrvChannel::StopConditionListening()
    1.39 +* @see CSensrvChannel::AddConditionL()
    1.40 +* @see CSensrvChannel::RemoveConditionL()
    1.41 +* @lib sensrvclient.lib
    1.42 +* @since S60 5.0
    1.43 +*/
    1.44 +class MSensrvChannelConditionListener
    1.45 +    {
    1.46 +    public:
    1.47 +    /**
    1.48 +    * Callback implemented by a client so that they can be notified when a channel ConditionSet
    1.49 +    * is met. If a client wants to use same ConditionSet after receiving this notification, the
    1.50 +    * client must add ConditionSet again to the channel object. If the ConditionSet is no longer
    1.51 +    * required the client can destroy it. 
    1.52 +    * 
    1.53 +    * If the ConditionSet contains more than one condition, it is not known which of the individual
    1.54 +    * conditions in the set were met.
    1.55 +    * 
    1.56 +    * Clients providing an implementation for this callback must ensure that the operation does not
    1.57 +    * leave. If a leave does occur then the behaviour is undefined.
    1.58 +    * 
    1.59 +    * @since S60 5.0
    1.60 +    * @param  aChannel Channel associated with the listener
    1.61 +    * @param  aChannelConditionSet Channel ConditionSet that is met
    1.62 +    * @param  aValue Channel data value that met the condition
    1.63 +    * @see CSensrvChannel::GetData() for example on how to retrive data from aValue
    1.64 +    */  
    1.65 +    virtual void ConditionMet( CSensrvChannel& aChannel, 
    1.66 +                               CSensrvChannelConditionSet& aChannelConditionSet, 
    1.67 +                               TDesC8& aValue ) = 0;
    1.68 +    
    1.69 +    /**
    1.70 +    * Callback implemented by a client so that they can be notified when condition listening
    1.71 +    * has failed. If the error is fatal the channel will be closed, the sensor server session
    1.72 +    * has been terminated and the channel object is no longer useable. If the error is minor,
    1.73 +    * some condition matches have potentially been missed, however listening is still active.
    1.74 +    * 
    1.75 +    * Clients providing an implementation for this callback must ensure that the operation does not
    1.76 +    * leave. If a leave does occur then the behaviour is undefined.
    1.77 +    * 
    1.78 +    * @since S60 5.0
    1.79 +    * @param  aChannel Channel associated with the listener
    1.80 +    * @param  aError The error severity
    1.81 +    */
    1.82 +    virtual void ConditionError ( CSensrvChannel& aChannel, 
    1.83 +                                  TSensrvErrorSeverity aError ) = 0;
    1.84 +
    1.85 +	  /** 
    1.86 +    * Callback to future proof this API so that additional callbacks can be added in the future 
    1.87 +    * without breaking binary compatibility.
    1.88 +    * 
    1.89 +    * @since S60 5.0
    1.90 +    * @param  aInterfaceUid Identifier for the interface to be retrieved
    1.91 +    * @param  aInterface A reference to a pointer for the specified interface. Implementation sets
    1.92 +    * aInterface to a valid pointer if the M-class identified by aInterfaceUid is supported, otherwise
    1.93 +    * it is set to NULL on exit.
    1.94 +    * @leave  One of the system-wide error codes
    1.95 +    */
    1.96 +	  virtual void GetChannelConditionListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface ) = 0;
    1.97 +
    1.98 +    };
    1.99 +
   1.100 +
   1.101 +
   1.102 +#endif //SENSRVCHANNELCONDITIONLISTENER_H
   1.103 +
   1.104 +// End of File