javacommons/jvms/nativeportlayer/inc.s60/mjvmnativeportlayer.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     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:  MJvmNativePortLayer
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MJVMNATIVEPORTLAYER_H
       
    19 #define MJVMNATIVEPORTLAYER_H
       
    20 
       
    21 
       
    22 namespace javaruntime
       
    23 {
       
    24 
       
    25 class MJavaFile;
       
    26 
       
    27 const TUint32 KDesLength = 40;
       
    28 
       
    29 class MJvmNativePortLayer
       
    30 {
       
    31 
       
    32 public:
       
    33 
       
    34     /** Destructor */
       
    35     virtual ~MJvmNativePortLayer() {}
       
    36 
       
    37     /**
       
    38      * Gets the object that implements MJavaFile interface. The object
       
    39      * allows the vm to make file operations.
       
    40      * @return  A pointer to an object that implements MJavaFile interface.
       
    41      *          It is responsibility of the vm to delete the object.
       
    42      */
       
    43     virtual MJavaFile* GetJavaFileL() = 0;
       
    44 
       
    45     /**
       
    46      * Output the supplied data to the output stream.
       
    47      * @param   aData
       
    48      *          Descriptor reference containing the data.
       
    49      */
       
    50     virtual void WriteToStdoutL(const TDesC8& aData) = 0;
       
    51 
       
    52     /**
       
    53      * Output the supplied data to the output stream.
       
    54      * @param   aData
       
    55      *          Descriptor reference containing the data.
       
    56      */
       
    57     virtual void WriteToStderrL(const TDesC8& aData) = 0;
       
    58 
       
    59 };
       
    60 
       
    61 /**
       
    62  * Gets the object that implements MJvmNativePortLayer interface.
       
    63  * @return  A pointer to an object that implements MJvmNativePortLayer
       
    64  *          interface. It is responsibility of the vm to delete the object.
       
    65  */
       
    66 IMPORT_C MJvmNativePortLayer* GetPortLayerL();
       
    67 /**
       
    68  * Gets the object that implements MJvmNativePortLayer interface.
       
    69  * @return  A pointer to an object that implements MJvmNativePortLayer
       
    70  *          interface. It is responsibility of the vm to delete the object.
       
    71  */
       
    72 
       
    73 /**
       
    74  * Return the native thread priority corresponding with the Java priority.
       
    75  *
       
    76  * @param aJavaPriority Java priority. Priority should be
       
    77  *          from 0 to 11. If not then the method adjusts it
       
    78  *          either to 0 (if <0 ) or to 11 (if > 11).
       
    79  * @return  TThreadPriority value
       
    80  */
       
    81 IMPORT_C TThreadPriority GetSingleThreadPriority(const TInt& aJavaPriority);
       
    82 } // end of namespace javaruntime
       
    83 
       
    84 #endif // MJVMNATIVEPORTLAYER_H