1 /* |
|
2 * Copyright (c) 2005-2008 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: CSConPCD service header |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _SCONPCD_H_ |
|
20 #define _SCONPCD_H_ |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32cons.h> |
|
26 |
|
27 #include "sconconmltask.h" |
|
28 |
|
29 class CSConInstallerQueue; |
|
30 class CSConBackupRestoreQueue; |
|
31 |
|
32 enum TSConLastConMLOperation |
|
33 { |
|
34 ENoTask = 0, |
|
35 EPutTask, |
|
36 EGetReply |
|
37 }; |
|
38 |
|
39 //============================================================ |
|
40 // Class CSConPCD declaration |
|
41 //============================================================ |
|
42 class CSConPCD : public CBase |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Two-phase constructor |
|
47 * @return CSConPCD instance |
|
48 */ |
|
49 static CSConPCD* NewL(); |
|
50 /** |
|
51 * Destructor |
|
52 * @return none |
|
53 */ |
|
54 ~CSConPCD(); |
|
55 /** |
|
56 * Receives a new task |
|
57 * @param aTask A new task |
|
58 * @return KErrNone if no errors, else system wide error codes |
|
59 */ |
|
60 virtual TInt PutTaskL( CSConTask*& aTask ); |
|
61 /** |
|
62 * Returns a reply to previous PutTaskL operation |
|
63 * @return CSConStatusReply if reply exists, else return NULL |
|
64 */ |
|
65 virtual CSConStatusReply* GetReply(); |
|
66 /** |
|
67 * Resets the module to the initial state |
|
68 * @return none |
|
69 */ |
|
70 virtual void ResetPCD(); |
|
71 |
|
72 private: |
|
73 /** |
|
74 * Collects a status of a specified task / all tasks |
|
75 * @param aTask The number of the specified task |
|
76 * @param aAll If ETrue => receive status of all tasks |
|
77 * @return KErrNone if no errors, else system wide error codes |
|
78 */ |
|
79 TInt GetStatusL( TInt aTask, TBool aAll ); |
|
80 |
|
81 /** |
|
82 * Cancels a specified task / all tasks |
|
83 * @param aTask The number of the specified task |
|
84 * @param aAll If ETrue => receive status of all tasks |
|
85 * @return KErrNone if no errors, else system wide error codes |
|
86 */ |
|
87 TInt CancelL( TInt aTask, TBool aAll ); |
|
88 |
|
89 /** |
|
90 * Fills a reply with predefined supported task -information |
|
91 * @param aTask The task |
|
92 * @return KErrNone if no errors, else system wide error codes |
|
93 */ |
|
94 TInt SupportedInstTaskL( CSConTask* aTask ); |
|
95 |
|
96 /** |
|
97 * Fills a reply with predefined supported task -information |
|
98 * @param aTask The task |
|
99 * @return KErrNone if no errors, else system wide error codes |
|
100 */ |
|
101 TInt SupportedBRTaskL( CSConTask* aTask ); |
|
102 |
|
103 /** |
|
104 * Fills a reply with predefined Reboot task -information |
|
105 * @param aTask The task |
|
106 * @return KErrNone if no errors, else system wide error codes |
|
107 */ |
|
108 TInt RebootTaskL( const CSConTask* aTask ); |
|
109 |
|
110 /** |
|
111 * Fills a reply with predefined GetMetadata task -information |
|
112 * @param aTask The task |
|
113 * @return none |
|
114 */ |
|
115 void GetMetadataTaskL( CSConTask& aTask ); |
|
116 |
|
117 /** |
|
118 * Creates a reply for UpdateDeviceInfo task |
|
119 * @param aMaxObjectSize A max object size to be used |
|
120 * @return none |
|
121 */ |
|
122 TInt UpdateDeviceInfoL( TInt aMaxObjectSize ); |
|
123 /** |
|
124 * Gets the current max object size |
|
125 * @param aClientObjectSize The object size of the client |
|
126 * @return the max object size |
|
127 */ |
|
128 TInt GetMaxObjectSize( TInt aClientObjectSize ) const; |
|
129 |
|
130 /** |
|
131 * Stores a reply |
|
132 * @param aReply The reply to be stored |
|
133 * @return none |
|
134 */ |
|
135 void StoreReply( CSConStatusReply*& aReply ); |
|
136 |
|
137 /** |
|
138 * Constructor |
|
139 * @return none |
|
140 */ |
|
141 CSConPCD(); |
|
142 /** |
|
143 * Initializes member data |
|
144 * @return none |
|
145 */ |
|
146 virtual void ConstructL(); |
|
147 |
|
148 private: |
|
149 CSConInstallerQueue* iInstallerQueue; |
|
150 CSConBackupRestoreQueue* iBackupRestoreQueue; |
|
151 CSConStatusReply* iLatestReply; |
|
152 TInt iTaskNumber; |
|
153 TInt iMaxObjectSize; |
|
154 TSConLastConMLOperation iLastOperation; |
|
155 RFs iFs; |
|
156 }; |
|
157 |
|
158 IMPORT_C CSConPCD* CreateCSConPCDL(); |
|
159 typedef CSConPCD* (*TSConCreateCSConPCDFunc) (); |
|
160 |
|
161 #endif // SCONPCD |
|
162 |
|
163 // End of file |
|