javamanager/javainstaller/installer/src.s60/utils/propertylistener.h
branchRCL_3
changeset 83 26b2b12093af
parent 77 7cee158cb8cd
child 84 0553e2305d00
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
     1 /*
       
     2 * Copyright (c) 2010 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 * This class implements general wait object for calling
       
    17 * a callback function after subscribed P&S key value changes.
       
    18 *
       
    19 */
       
    20 
       
    21 #ifndef PROPERTYLISTENER_H
       
    22 #define PROPERTYLISTENER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32property.h>
       
    26 #include <jni.h>
       
    27 
       
    28 namespace java
       
    29 {
       
    30 namespace installer
       
    31 {
       
    32 
       
    33 /**
       
    34  * This class implements wait object for calling a callback
       
    35  * function after subscribed P&S key value changes.
       
    36  */
       
    37 NONSHARABLE_CLASS(CPropertyListener) : public CActive
       
    38 {
       
    39 public:  // Constructor and destructor
       
    40 
       
    41     static CPropertyListener* NewL(TUid aUid, TUint aKey);
       
    42 
       
    43     // Destructor.
       
    44     virtual ~CPropertyListener();
       
    45 
       
    46 private:
       
    47 
       
    48     // Constructor.
       
    49     CPropertyListener(TUid aUid, TUint aKey);
       
    50 
       
    51     // 2nd phase constructor.
       
    52     void ConstructL();
       
    53 
       
    54     // from base class CActive
       
    55 
       
    56     void RunL();
       
    57 
       
    58     void DoCancel();
       
    59 
       
    60 public: // Methods
       
    61 
       
    62     void ProcessEventsL(JNIEnv *aEnv, jobject aProvider);
       
    63 
       
    64 private: // Data
       
    65 
       
    66     CActiveScheduler* iActiveScheduler; // Owned
       
    67 
       
    68     RProperty iProperty; // Property to listen
       
    69     TUid iUid; // Property UID
       
    70     TUint iKey; // Property key
       
    71 
       
    72     JNIEnv *iEnv; // JNI environment, not owned
       
    73     jobject iProvider; // Callback object
       
    74     jmethodID iMethod; // Callback method
       
    75 
       
    76     TBool iCancelled;
       
    77 };
       
    78 
       
    79 } // installer
       
    80 } // java
       
    81 
       
    82 #endif // PROPERTYLISTENER_H