epoc32/include/sensrvchannelconditionlistener.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Condition listener call-back interface
    15 *
    16 */
    17 
    18 
    19 #ifndef SENSRVCHANNELCONDITIONLISTENER_H
    20 #define SENSRVCHANNELCONDITIONLISTENER_H
    21 
    22 #include <e32base.h>
    23 #include <sensrvchannelconditionset.h>
    24 #include <sensrvtypes.h>
    25 
    26 /**
    27 * Condition listener callback interface to indicate when a ConditionSet has been met.
    28 * 
    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().
    32 * 
    33 * @see CSensrvChannel::StartConditionListeningL()
    34 * @see CSensrvChannel::StopConditionListening()
    35 * @see CSensrvChannel::AddConditionL()
    36 * @see CSensrvChannel::RemoveConditionL()
    37 * @lib sensrvclient.lib
    38 * @since S60 5.0
    39 */
    40 class MSensrvChannelConditionListener
    41     {
    42     public:
    43     /**
    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. 
    48     * 
    49     * If the ConditionSet contains more than one condition, it is not known which of the individual
    50     * conditions in the set were met.
    51     * 
    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.
    54     * 
    55     * @since S60 5.0
    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
    60     */  
    61     virtual void ConditionMet( CSensrvChannel& aChannel, 
    62                                CSensrvChannelConditionSet& aChannelConditionSet, 
    63                                TDesC8& aValue ) = 0;
    64     
    65     /**
    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.
    70     * 
    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.
    73     * 
    74     * @since S60 5.0
    75     * @param  aChannel Channel associated with the listener
    76     * @param  aError The error severity
    77     */
    78     virtual void ConditionError ( CSensrvChannel& aChannel, 
    79                                   TSensrvErrorSeverity aError ) = 0;
    80 
    81 	  /** 
    82     * Callback to future proof this API so that additional callbacks can be added in the future 
    83     * without breaking binary compatibility.
    84     * 
    85     * @since S60 5.0
    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
    91     */
    92 	  virtual void GetChannelConditionListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface ) = 0;
    93 
    94     };
    95 
    96 
    97 
    98 #endif //SENSRVCHANNELCONDITIONLISTENER_H
    99 
   100 // End of File