tracesrv/tracecore/btrace_handler/inc/TraceCoreMediaPlugin.h
changeset 56 aa2539c91954
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
       
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Interface class for media plug-ins
       
    15 //
       
    16 
       
    17 #ifndef __TRACECOREMEDIAPLUGIN_H__
       
    18 #define __TRACECOREMEDIAPLUGIN_H__
       
    19 
       
    20 
       
    21 // Include files
       
    22 #include <kernel/kernel.h>
       
    23 
       
    24 // Forward declarations
       
    25 class DTraceCorePluginIf;
       
    26 class TTraceMessage;
       
    27 
       
    28 
       
    29 /**
       
    30  * Media plug-in base class
       
    31  */
       
    32 class DTraceCoreMediaPlugin : public DBase
       
    33     {
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Constructor
       
    38      */
       
    39     IMPORT_C DTraceCoreMediaPlugin();
       
    40 
       
    41     /**
       
    42      * Destructor
       
    43      */
       
    44     IMPORT_C ~DTraceCoreMediaPlugin();
       
    45 
       
    46     /**
       
    47      * Registers this plug-in to TraceCore
       
    48      */
       
    49     IMPORT_C TInt Register();
       
    50     
       
    51     /**
       
    52      * Called by the plug-in to send an incoming message to TraceCore
       
    53      * 
       
    54      * @param aMsg The message that was received
       
    55      */
       
    56     IMPORT_C void MessageReceived( TTraceMessage &aMsg );
       
    57     
       
    58     /**
       
    59      * Merges the header and data into a single buffer
       
    60      * 
       
    61      * @param aMsg Message to be sent.
       
    62      * @param aMsgBlock The message block where data is merged
       
    63      * @return KErrNone if successful
       
    64      */
       
    65     IMPORT_C TInt MergeHeaderAndData( const TTraceMessage& aMsg, TDes8& aTarget );
       
    66 
       
    67     /**
       
    68      * Called by TraceCore to send a message out
       
    69      * 
       
    70      * @param aMsg The message to be sent
       
    71      */
       
    72     virtual TInt SendMessage( TTraceMessage &aMsg ) = 0;
       
    73 
       
    74 private:
       
    75 
       
    76     /**
       
    77      * Unregisters this plug-in from TraceCore. Called from destructor
       
    78      */
       
    79     void Unregister();
       
    80     };
       
    81 
       
    82 #endif // __TRACECOREMEDIAPLUGIN_H__
       
    83 
       
    84 // End of File