javauis/mmapi_qt/baseline/inc/cmmadeleterefevent.h
changeset 23 98ccebc37403
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
       
     1 /*
       
     2 * Copyright (c) 2002 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 is used to post events to the java.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMMADELETEREFEVENT_H
       
    20 #define CMMADELETEREFEVENT_H
       
    21 
       
    22 //#include <mevents.h>
       
    23 #include "cmmaevent.h"
       
    24 
       
    25 class MMAFunctionServer;
       
    26 
       
    27 //  CLASS DECLARATION
       
    28 /**
       
    29 *   This class is used to delete references created with JNIEnv.
       
    30 *   Reference deletion needs JNI environvent, which can't be stored
       
    31 *   as an member variable. JNI environment is delivered to Dispatch
       
    32 *   method that deletes the reference.
       
    33 *
       
    34 *
       
    35 *
       
    36 */
       
    37 
       
    38 NONSHARABLE_CLASS(CMMADeleteRefEvent): public CMMAEvent
       
    39 {
       
    40 public:
       
    41     /**
       
    42      * Default constructor. This event is always disposable.
       
    43      * @param aDeleteRefObject Object which reference will be deleted.
       
    44      */
       
    45     CMMADeleteRefEvent(jobject aDeleteRefObject);
       
    46 
       
    47 private: // from CJavaEvent
       
    48     /**
       
    49      * This method deletes iDeleteRefObject reference with JNIEnv::DeleteGlobalRef method.
       
    50      * @param aJni JNI environment which is used to delete reference.
       
    51      */
       
    52     void Dispatch(JNIEnv& aJni);
       
    53 
       
    54 protected:
       
    55     // Object reference which will be deleted.
       
    56     jobject iDeleteRefObject;
       
    57 };
       
    58 
       
    59 #endif // CMMADELETEREFEVENT_H