|
1 /* |
|
2 * Copyright (c) 2005-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: This class implements general wait object for calling a desired |
|
15 * callback function after asynchronous notification |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef ASYNCWAITCALLBACK_H |
|
20 #define ASYNCWAITCALLBACK_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 namespace java |
|
25 { |
|
26 namespace installer |
|
27 { |
|
28 |
|
29 /** |
|
30 * This class implements wait object for calling a desired |
|
31 * callback function after rendezvous returns specified |
|
32 * reason code from the process that this object is listening to. |
|
33 */ |
|
34 NONSHARABLE_CLASS(CAsyncWaitCallBack) : public CActive |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 |
|
38 static CAsyncWaitCallBack* NewL(TCallBack aCallBack); |
|
39 |
|
40 // Destructor. |
|
41 virtual ~CAsyncWaitCallBack(); |
|
42 |
|
43 public: // From base classes |
|
44 |
|
45 // from base class CActive |
|
46 |
|
47 void RunL(); |
|
48 |
|
49 void DoCancel(); |
|
50 |
|
51 public: |
|
52 |
|
53 void Wait(RProcess aProcessToListen, TInt aActivatingReasonCode); |
|
54 |
|
55 private: |
|
56 |
|
57 // Constructor. |
|
58 CAsyncWaitCallBack(); |
|
59 |
|
60 // 2nd phase constructor. |
|
61 void ConstructL(TCallBack aCallBack); |
|
62 |
|
63 private: // Data |
|
64 |
|
65 // Callback member |
|
66 TCallBack iCallBack; |
|
67 |
|
68 // When request completes with this status code, |
|
69 // callback is called. |
|
70 TInt iActivatingReasonCode; |
|
71 |
|
72 RProcess iProcessToListen; |
|
73 }; |
|
74 |
|
75 } // installer |
|
76 } // java |
|
77 |
|
78 #endif // ASYNCWAITCALLBACK_H |