javauis/mmapi_qt/audiostreaming/inc/cmmadatasourcestream.h
branchRCL_3
changeset 24 0fd27995241b
equal deleted inserted replaced
20:f9bb0fca356a 24:0fd27995241b
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  Class for reading data from Java SourceStream to native side
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMMADATASOURCESTREAM_H
       
    20 #define CMMADATASOURCESTREAM_H
       
    21 
       
    22 #include "cmmasourcestream.h"
       
    23 
       
    24 class CMMADataSourceStreamEvent;
       
    25 class MMMASourceStreamListener;
       
    26 class MMMAEventPoster;
       
    27 class CMMAStreamRequest;
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 //  CLASS DECLARATION
       
    32 /**
       
    33 *   Class for reading data from Java SourceStream to native side
       
    34 *
       
    35 */
       
    36 NONSHARABLE_CLASS(CMMADataSourceStream): public CMMASourceStream
       
    37 {
       
    38 public:     // Constructors and destructors
       
    39     /**
       
    40      * Object creation. Static method.
       
    41      *
       
    42      * @param aJNIEnv           handle to used jni environment
       
    43      * @param aEventPoster      handle to event poster
       
    44      * @param aJavaSourceStream handle to java SourceStream object
       
    45      * @param aListener         Handle to source stream listener
       
    46      *
       
    47      * @return CMMADataSourceStream object
       
    48      */
       
    49     static CMMADataSourceStream* NewLC(JNIEnv* aJNIEnv,
       
    50     MMMAEventPoster* aEventPoster,
       
    51     jobject aJavaSourceStream,
       
    52     MMMASourceStreamListener* aListener,
       
    53     MMAFunctionServer* aEventSource);
       
    54 
       
    55     /**
       
    56      * Deletes owned objects
       
    57      */
       
    58     ~CMMADataSourceStream(); // Destructor
       
    59 
       
    60 public: // New methods
       
    61     /**
       
    62      * Reads data from Java
       
    63      */
       
    64     void Read(CMMAStreamRequest* aRequest);
       
    65 
       
    66     /**
       
    67      * @return readed request
       
    68      */
       
    69     CMMAStreamRequest* Request();
       
    70 
       
    71 public: // From CMMASourceStream
       
    72 
       
    73     /**
       
    74      * Overwrites CMMASourceStream's ResetData
       
    75      * so iData will not be NULL, does nothing
       
    76      */
       
    77     void ResetData();
       
    78 
       
    79 protected:  // Constructors and destructors
       
    80 
       
    81     /**
       
    82      * Set variables
       
    83      * @param aEventPoster handle to event poster
       
    84      * @param aListener    handle to source stream listener
       
    85      */
       
    86     CMMADataSourceStream(MMMAEventPoster* aEventPoster,
       
    87                          MMMASourceStreamListener* aListener);
       
    88 
       
    89     /**
       
    90      * 2nd phase constructor
       
    91      *
       
    92      * @param aJNIEnv           used jni environment
       
    93      * @param aJavaSourceStream handle to java source stream object
       
    94      */
       
    95     void ConstructL(JNIEnv* aJNIEnv, MMAFunctionServer* aEventSource,jobject aJavaSourceStream);
       
    96 
       
    97 
       
    98 protected:  // From CMMASourceStream
       
    99 
       
   100     void WriteL(const TUint8* aData,
       
   101                 TInt aLength, TInt aState);
       
   102 
       
   103 protected:
       
   104     // not owned request
       
   105     CMMAStreamRequest* iRequest;
       
   106 };
       
   107 
       
   108 #endif // CMMADATASOURCESTREAM_H