|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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 the License "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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __ASYNCHREQUESTMANAGER_H |
|
20 #define __ASYNCHREQUESTMANAGER_H |
|
21 |
|
22 class CClfOperationObserver; |
|
23 |
|
24 /** |
|
25 * Structure for storing transaction id and associated active object. |
|
26 */ |
|
27 class TAsyncRequestInfo |
|
28 { |
|
29 |
|
30 |
|
31 public: |
|
32 /** |
|
33 * Constructor |
|
34 * @since Series60 v3.2 |
|
35 * @param void |
|
36 * @return void |
|
37 */ |
|
38 TAsyncRequestInfo():iTransactionId( 0 ), |
|
39 iAsyncObj( NULL ) |
|
40 { |
|
41 |
|
42 } |
|
43 |
|
44 /** |
|
45 * TransactionId |
|
46 */ |
|
47 TUint iTransactionId; |
|
48 |
|
49 // Instance of observer |
|
50 CClfOperationObserver* iAsyncObj; |
|
51 }; |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 /** |
|
57 * This Class provides the core functionality of |
|
58 * MediaManagement SAPI |
|
59 * |
|
60 * @since Series60 v3.2 |
|
61 */ |
|
62 class CAsynchRequestManager : public CBase |
|
63 { |
|
64 |
|
65 public: |
|
66 |
|
67 /** |
|
68 * Returns the instance of CAsynchRequestManager. |
|
69 * @since Series60 v3.2 |
|
70 * @param void |
|
71 * @return CAsynchRequestManager* return the instance of CAsynchRequestManager class |
|
72 */ |
|
73 IMPORT_C static CAsynchRequestManager* NewL(); |
|
74 |
|
75 /** |
|
76 * Destructor. |
|
77 */ |
|
78 virtual ~CAsynchRequestManager(); |
|
79 |
|
80 |
|
81 |
|
82 /** |
|
83 * Cancel the pending asynchronous request |
|
84 * @since Series60 v3.2 |
|
85 * @param aTransactionID Unique number to identify the request |
|
86 * @return TInt System wide error code |
|
87 */ |
|
88 IMPORT_C TInt Cancel( TInt32 aTransactionID ); |
|
89 |
|
90 |
|
91 |
|
92 /** |
|
93 * This function delete the callback object from the array |
|
94 * corresponding to the given transaction id |
|
95 * @since Series60 v3.2 |
|
96 * @param aTransactionID Unique number to identify the callback |
|
97 * @return void |
|
98 */ |
|
99 void RequestComplete( TInt32 aTransactionID ); |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 /** |
|
105 * This function add the callback object for support multiple cancle operation |
|
106 * @param aServiceObserver observer interface pointer provided by user for informing event. |
|
107 * @return The observer for actually observing the underlying class events |
|
108 * @since Series60 v3.2 |
|
109 */ |
|
110 void AddObserverL( CClfOperationObserver* aServiceObserver, TUint aTransactionID ); |
|
111 |
|
112 |
|
113 private: |
|
114 |
|
115 /** |
|
116 * Contains handles of all asynchronous requests |
|
117 */ |
|
118 RArray<TAsyncRequestInfo> iAsyncObjArray; |
|
119 |
|
120 |
|
121 }; |
|
122 |
|
123 #endif __ASYNCHREQUESTMANAGER_H |