mmmw_plat/telephony_multimedia_service_api/inc/tmsstreamobsrvr.h
changeset 0 71ca22bcf22a
child 9 f5c5c82a163e
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2  * Copyright (c) 2009 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: Telephony Multimedia Service
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef TMS_STREAM_OBSRVR_H
       
    19 #define TMS_STREAM_OBSRVR_H
       
    20 
       
    21 // Include files
       
    22 #include <tms.h>
       
    23 
       
    24 namespace TMS {
       
    25 
       
    26 // Forward declarations
       
    27 class TMSStream;
       
    28 
       
    29 /**
       
    30  * TMSStreamObserver class
       
    31  *
       
    32  * This class provides callback mechanism for TMSStream listeners.
       
    33  *
       
    34  * Client class that is interested in observing stream notifications has to
       
    35  * inherit from TMSStreamObserver class and register itself with the TMSStream.
       
    36  * Functions declared in this class are called when events occur in TMSStream.
       
    37  *
       
    38  * The client must not do any blocking, or perform any CPU-intensive operations
       
    39  * in the callback methods. It is recommended that the client saves event data,
       
    40  * returns from this function immediately, and if necessary, responds to
       
    41  * the event in asynchronous way.
       
    42  *
       
    43  * Usage:
       
    44  * <code>
       
    45  * // Register as an observer to the uplink stream
       
    46  * iUplinkStream->AddObserver(*this, NULL);
       
    47  * ...
       
    48  * // Unregister (optional)
       
    49  * iUplinkStream->RemoveObserver(*this);
       
    50  * ...
       
    51  * </code>
       
    52  *
       
    53  * @lib tmsapi.lib
       
    54  *
       
    55  */
       
    56 class TMSStreamObserver
       
    57     {
       
    58 public:
       
    59     /**
       
    60      * Signal stream event.
       
    61      *
       
    62      * This function is called when a stream event occurs.
       
    63      *      (1) TMS_EVENT_TYPE_STATE_CHANGED.
       
    64      *
       
    65      *
       
    66      * @param  stream
       
    67      *      Pointer to the object that is being signaled.
       
    68      *
       
    69      * @param  event
       
    70      *      Event descriptor.
       
    71      *
       
    72      */
       
    73     virtual void TMSStreamEvent(TMSStream* stream, TMSSignalEvent event) = 0;
       
    74     };
       
    75 
       
    76 } //namespace TMS
       
    77 
       
    78 #endif // TMS_STREAM_OBSRVR_H
       
    79 
       
    80 // End of file