|
1 /** |
|
2 * Copyright (c) 2004-2009 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 * Declaration of CJavaManagerInterface |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 @file |
|
24 */ |
|
25 #ifndef __JAVAMANAGERINTERFACE_H__ |
|
26 #define __JAVAMANAGERINTERFACE_H__ |
|
27 |
|
28 // System |
|
29 #include <e32base.h> |
|
30 #include <ecom/ecom.h> |
|
31 #include <apmrec.h> |
|
32 |
|
33 #include <connect/sbtypes.h> |
|
34 |
|
35 /* |
|
36 @KJavaManagerInterfaceUid, Ther JavaMangerInterface Uid. |
|
37 This UID is used by the implementer of the ThirdPartyJavaManager plugin. |
|
38 This plugin is used in Backup and restore engine. |
|
39 */ |
|
40 const TUid KJavaManagerInterfaceUid = { 0x2000D924 }; |
|
41 |
|
42 namespace conn |
|
43 { |
|
44 |
|
45 class CDataOwnerInfo; |
|
46 class CSBGenericTransferType; |
|
47 class CSBGenericDataType; |
|
48 /** |
|
49 Clients creating a java backup and restore plugin should derive from and implement this interface. |
|
50 @publishedPartner |
|
51 @released |
|
52 */ |
|
53 class CJavaManagerInterface : public CBase |
|
54 { |
|
55 |
|
56 public: |
|
57 |
|
58 /** |
|
59 static function to create and return the object. |
|
60 |
|
61 @return CJavaManagerInterface* Pointer to newly instantiated object. |
|
62 */ |
|
63 inline static CJavaManagerInterface* NewL( const TUid& aImplementationUid ); |
|
64 |
|
65 /** |
|
66 Destructor. |
|
67 |
|
68 */ |
|
69 inline virtual ~CJavaManagerInterface(); |
|
70 |
|
71 |
|
72 public: |
|
73 |
|
74 /** |
|
75 Method requesting information about all of the Java data owners that are represented by this object |
|
76 @param aDataOwners Array of data owner info's to populate |
|
77 */ |
|
78 virtual void GetDataOwnersL(RPointerArray<CDataOwnerInfo>& aDataOwners)=0; |
|
79 /** |
|
80 Return the expected size of data to be returned to the PC client. Used for displaying progress information |
|
81 @param aGenericTransferType The type of data that the expected size is being requested for |
|
82 @param aSize Stores the expected size value to be returned to the PC side client |
|
83 */ |
|
84 virtual void GetExpectedDataSizeL(CSBGenericTransferType* aGenericTransferType, TUint& aSize)=0; |
|
85 |
|
86 /** |
|
87 Get a list of public files that the java data owners are requesting to be backed up in addition to their |
|
88 own private data stores |
|
89 @param aDriveNumber The drive that these public files are being requested for |
|
90 @param aFiles An array of filenames that will be populated upon return of this method |
|
91 */ |
|
92 virtual void GetPublicFileListL(CSBGenericDataType* aGenericDataType, TDriveNumber aDriveNumber, RFileArray& aFiles)=0; |
|
93 |
|
94 /** |
|
95 Get a list of public files that the java data owners are requesting to be backed up in addition to their |
|
96 own private data stores |
|
97 @param aDriveNumber The drive that these public files are being requested for |
|
98 @param aFiles An array of filenames that will be populated upon return of this method |
|
99 */ |
|
100 virtual void GetRawPublicFileListL(CSBGenericDataType* aGenericDataType, TDriveNumber aDriveNumber, RRestoreFileFilterArray& aFileFilter)=0; |
|
101 |
|
102 /** |
|
103 Supplies data to the particular data owners to process |
|
104 @param aGenericTransferType The type of data that's being supplied |
|
105 @param aBuffer Buffer containing the data to be supplied |
|
106 @param aFinished Flag determining whether or not this buffer is the last in a multipart sequence |
|
107 */ |
|
108 virtual void SupplyDataL(CSBGenericTransferType* aGenericTransferType, TDesC8& aBuffer, TBool aFinished)=0; |
|
109 |
|
110 /** |
|
111 Request a type of data from a particular data owner |
|
112 @param aGenericTransferType The type of data being requested |
|
113 @param aBuffer The buffer to populate with data |
|
114 @param aFinished Flag to be set depending on whether another request is required to transfer |
|
115 all of this data owner's data |
|
116 */ |
|
117 virtual void RequestDataL(CSBGenericTransferType* aGenericTransferType, TPtr8& aBuffer, TBool& aFinished)=0; |
|
118 |
|
119 /** |
|
120 Called by the PC client once all registration and binary files have been restored. Used as a signal to |
|
121 indicate that the next set of transfers will include data |
|
122 */ |
|
123 virtual void AllSystemFilesRestored()=0; |
|
124 /** |
|
125 Method to check the data type of the file |
|
126 @param TDesC& aFileName File name of the file to recognize |
|
127 @return TDataRecognitionResult Data Recognized Result |
|
128 */ |
|
129 virtual TDataRecognitionResult RecognizeDataTypeL(const TDesC& aFileName)=0; |
|
130 /** |
|
131 Returns the handle to File Server. |
|
132 */ |
|
133 |
|
134 virtual RFs& GetRFs()=0; |
|
135 |
|
136 /** Returns a pointer to a specified interface extension - to allow future extension |
|
137 of this class without breaking binary compatibility |
|
138 |
|
139 @param aInterfaceUid Identifier of the interface to be retrieved |
|
140 @param aInterface A reference to a pointer that retrieves the specified interface. |
|
141 */ |
|
142 virtual void GetExtendedInterface(TUid aInterfaceUid, TAny*& aInterface)=0; |
|
143 |
|
144 protected: |
|
145 /** |
|
146 Scan the SystemAMS data cage (private directory) for all registration files corresponding to installed MIDlet's |
|
147 @param aRegFileArray Array of registration files that will be populated with all reg files in the SystemAMS data cage |
|
148 **/ |
|
149 virtual void ScanForRegistrationFilesL(RFileArray& aRegFileArray)=0; |
|
150 |
|
151 /** |
|
152 Tries Parsing the Java Data Owner at runtime. |
|
153 @param aFileName aSuiteHash the suite hash of the java data owner |
|
154 */ |
|
155 virtual void ParseJavaDataOwnerL(const TDesC& aSuiteHash)=0; |
|
156 |
|
157 |
|
158 protected: |
|
159 |
|
160 /** |
|
161 * Constructor. |
|
162 */ |
|
163 inline CJavaManagerInterface(); |
|
164 |
|
165 private: |
|
166 TUid iDtor_ID_Key; //ECOM Plugin identifier |
|
167 |
|
168 }; |
|
169 |
|
170 /** |
|
171 * Template classes to call ResetAndDestroy on array classes |
|
172 * automatically, when ::PopAndDestroy'ing from the cleanup stack. |
|
173 */ |
|
174 template <class T> |
|
175 class CleanupResetAndDestroy |
|
176 { |
|
177 public: |
|
178 inline static void PushL(T& aRef); |
|
179 private: |
|
180 static void ResetAndDestroy(TAny *aPtr); |
|
181 }; |
|
182 template <class T> |
|
183 inline void CleanupResetAndDestroyL(T& aRef); |
|
184 |
|
185 // Template class CleanupClose |
|
186 template <class T> |
|
187 inline void CleanupResetAndDestroy<T>::PushL(T& aRef) |
|
188 {CleanupStack::PushL(TCleanupItem(&ResetAndDestroy, &aRef));} |
|
189 template <class T> |
|
190 void CleanupResetAndDestroy<T>::ResetAndDestroy(TAny *aPtr) |
|
191 {static_cast<T*>(aPtr)->ResetAndDestroy();} |
|
192 template <class T> |
|
193 inline void CleanupResetAndDestroyPushL(T& aRef) |
|
194 {CleanupResetAndDestroy<T>::PushL(aRef);} |
|
195 |
|
196 |
|
197 #include <connect/javamanagerinterface.inl> |
|
198 |
|
199 |
|
200 }// namespace conn |
|
201 |
|
202 |
|
203 |
|
204 #endif // __JAVAMANAGERINTERFACE_H__ |