mmmw_plat/telephony_multimedia_service_api/inc/tmsclientsourceobsrvr.h
changeset 0 71ca22bcf22a
child 13 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:This class provides callback mechanism for TMSClientSource
       
    15  * listeners.
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef TMS_CLIENT_SOURCE_OBSRVR_H
       
    20 #define TMS_CLIENT_SOURCE_OBSRVR_H
       
    21 
       
    22 // Include files
       
    23 #include <glib.h>
       
    24 
       
    25 namespace TMS {
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class TMSBuffer;
       
    29 
       
    30 /**
       
    31  * TMSClientSourceObserver class
       
    32  *
       
    33  * This class provides callback mechanism for TMSClientSource listeners.
       
    34  *
       
    35  * Client class that wants to send data to TMS must inherit from
       
    36  * TMSClientSourceObserver class and register itself with the TMSBuffer and
       
    37  * TMSClientSource objects.
       
    38  *
       
    39  * Functions declared in this class are called upon TMSBuffer events.
       
    40  *
       
    41  * The client must not do any blocking, or perform any CPU-intensive operations
       
    42  * in the callback methods. It is recommended that the client saves event data,
       
    43  * returns from this function immediately and if necessary, responds to
       
    44  * the event in asynchronous way.
       
    45  *
       
    46  * @lib tmsapi.lib
       
    47  *
       
    48  */
       
    49 class TMSClientSourceObserver
       
    50     {
       
    51 public:
       
    52     /**
       
    53      * This method is called by the TMS when it wants data from the client
       
    54      * and provides buffer to be filled by the client in the PULL MODE.
       
    55      *
       
    56      * @param  buffer
       
    57      *      Buffer to be filled by the client.
       
    58      *
       
    59      */
       
    60     virtual void FillBuffer(TMSBuffer& buffer) = 0;
       
    61 
       
    62     /**
       
    63      * This method is called by the TMS server in the PUSH MODE to indicate
       
    64      * previously submitted data buffer has been processed and more data can
       
    65      * now be accepted for processing. The processed buffer is returned back
       
    66      * to the client.
       
    67      *
       
    68      * @param  buffer
       
    69      *      Buffer which has been processed and returned to the client.
       
    70      *
       
    71      * @param  reason
       
    72      *      The status of the operation.
       
    73      *
       
    74      */
       
    75     virtual void BufferProcessed(TMSBuffer* buffer, gint reason) = 0;
       
    76     };
       
    77 
       
    78 } //namespace TMS
       
    79 
       
    80 #endif // TMS_CLIENT_SOURCE_OBSRVR_H
       
    81 
       
    82 // End of file