|
1 /* |
|
2 * Copyright (c) 2007-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: This class is the observer of CMgService class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MGSERVICEOBSERVER_H |
|
20 #define MGSERVICEOBSERVER_H |
|
21 |
|
22 #include "mgservice.hrh" |
|
23 #include "mgoperationobserver.h" |
|
24 |
|
25 class CLiwGenericParamList; |
|
26 class MCLFItemListModel; |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 // CLASS DECLARATION |
|
32 /** |
|
33 * Service Observer is for observing operation events of the MG service class. |
|
34 * CMgServiceObserver gets notified when asynchronous operations |
|
35 * are completed. |
|
36 * |
|
37 * |
|
38 * @since Series60 v3.2 |
|
39 */ |
|
40 |
|
41 |
|
42 NONSHARABLE_CLASS( CMgServiceObserver ): public CBase, public MMgOperationObserver |
|
43 { |
|
44 public: |
|
45 |
|
46 |
|
47 /** |
|
48 * Returns the instance of CMgServiceObserver. |
|
49 * @since Series60 v3.2 |
|
50 * @param void |
|
51 * @return void |
|
52 */ |
|
53 |
|
54 static CMgServiceObserver* NewL(); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CMgServiceObserver(); |
|
60 |
|
61 |
|
62 /** |
|
63 * Abstract method to get CMgService class events. This method is |
|
64 * called when an event is received. |
|
65 * @since Series60 v3.2 |
|
66 * @param aListModel ClF Iterator contains the required result |
|
67 * @param aOperationEvent specifies the asynchronous event |
|
68 * @param aError System wide error code if the operation did not |
|
69 * succeed. |
|
70 */ |
|
71 virtual void MgNotifyL(TUint aTransactionID, |
|
72 MCLFItemListModel* aListModel, |
|
73 TMgOperationEvent& aOperationEvent , |
|
74 const TInt& aError ); |
|
75 |
|
76 |
|
77 |
|
78 /** |
|
79 * method to set callback of consumer and pointer to |
|
80 * input/output parameter list. |
|
81 * @since Series60 v3.2 |
|
82 * @param iCmdId It represents whether the command if of request (FileInfo/File) |
|
83 * @param iInput sent by the consumer at the time of request |
|
84 * @param iOutput Result of given command will be |
|
85 * stored in given output parameter list |
|
86 * @param aCallback Contains the call back for Asynchronous request |
|
87 */ |
|
88 void SetMemberVar( const TMgCmdId& aCmdId, |
|
89 const CLiwGenericParamList* aInput, |
|
90 MLiwNotifyCallback* aCallBack ); |
|
91 |
|
92 /** |
|
93 * Cancel the pending asynchronous request |
|
94 * @since Series60 v3.2 |
|
95 * @param void |
|
96 * @return void |
|
97 */ |
|
98 void CancelL(); |
|
99 |
|
100 private : |
|
101 |
|
102 /** |
|
103 * Constructor. |
|
104 */ |
|
105 CMgServiceObserver(); |
|
106 |
|
107 /** |
|
108 * Two-phased constructor |
|
109 * @since Series60 v3.2 |
|
110 * @param void |
|
111 * @return void |
|
112 */ |
|
113 void ConstructL(); |
|
114 |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * Store the instance of the callback of the Client |
|
120 */ |
|
121 MLiwNotifyCallback* iCallBack; |
|
122 |
|
123 /** |
|
124 * stores the pointer of aOutParamList |
|
125 */ |
|
126 CLiwGenericParamList* iOutput; |
|
127 |
|
128 /** |
|
129 * stores the pointer of aInParamList |
|
130 */ |
|
131 const CLiwGenericParamList* iInput; |
|
132 |
|
133 /** |
|
134 * command ID of ongoing request (Files/FilesInfo) |
|
135 */ |
|
136 TMgCmdId iCmdId; |
|
137 |
|
138 |
|
139 }; |
|
140 |
|
141 #endif MGSERVICEOBSERVER_H |