javaextensions/satsa/apdu/src.s60/cstsapduevent.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:
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSTSAPDUEVENT_H
       
    20 #define CSTSAPDUEVENT_H
       
    21 
       
    22 //  INCLUDES
       
    23 
       
    24 #include <jni.h>
       
    25 
       
    26 namespace java
       
    27 {
       
    28 namespace satsa
       
    29 {
       
    30 
       
    31 //  CLASS DECLARATION
       
    32 
       
    33 // This class is used to post events to the java.
       
    34 
       
    35 
       
    36 NONSHARABLE_CLASS(CSTSApduEvent)
       
    37 {
       
    38 public:
       
    39     CSTSApduEvent(JNIEnv& aJni,
       
    40                   jobject aNotifyObject,
       
    41                   jmethodID aHandleEventMethod);
       
    42 
       
    43     virtual ~CSTSApduEvent();
       
    44 
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Setter for operation id
       
    49      * @param aId Id of java side operation
       
    50      *
       
    51      */
       
    52     void SetId(TInt aId);
       
    53 
       
    54     /**
       
    55      * Setter for error code
       
    56      * @param aError Error code to be delivered to java side
       
    57      */
       
    58     void SetErrorCode(TInt aError);
       
    59 
       
    60     /**
       
    61      * Setter for response data
       
    62      * @param aResponseData Response bytes to be delivered to java side
       
    63      */
       
    64     void SetData(HBufC8* aResponseData);
       
    65 
       
    66     // To call the java mathod
       
    67     void Dispatch(JNIEnv* aJni, jobject aPeer);
       
    68 
       
    69 private: // data
       
    70 
       
    71     // To call java method
       
    72     JNIEnv& iJni;
       
    73     // java side object which method will be called
       
    74     jobject iListenerObject;
       
    75     // method of that java object, which will be called
       
    76     jmethodID iHandleEventMethod;
       
    77     TInt iId;
       
    78     TInt iError;
       
    79     HBufC8* iResponseData; //not owned
       
    80 
       
    81 }
       
    82 ;
       
    83 
       
    84 } // namespace satsa
       
    85 } // namespace java
       
    86 #endif // CSTSAPDUEVENT_H