|
1 /* |
|
2 * Copyright (c) 2008-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 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: |
|
15 * Declares entry classes for Software Components Registry interface. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalComponent |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef SCRENTRIES_INTERNAL_H |
|
27 #define SCRENTRIES_INTERNAL_H |
|
28 |
|
29 #include <e32base.h> |
|
30 #include <s32strm.h> |
|
31 #include <f32file.h> |
|
32 #include <usif/usifcommon.h> |
|
33 #include <usif/scr/screntries.h> |
|
34 |
|
35 //class Usif::CLocalizableCommonData; |
|
36 //class Usif::CScrLogEntry; |
|
37 |
|
38 namespace Usif |
|
39 { |
|
40 class CLocalizableCommonData; |
|
41 NONSHARABLE_CLASS(CLocalizedSoftwareTypeName) : public CLocalizableCommonData |
|
42 /** |
|
43 This class contains localized software type names. |
|
44 Software type names are localizable names and transferred to the SCR |
|
45 with the objects of this class. |
|
46 |
|
47 @internalTechnology |
|
48 */ |
|
49 { |
|
50 public: |
|
51 /** |
|
52 Creates a localized software type name object. |
|
53 @param aName The name of the software type. |
|
54 @param aLocale The language code of the object's locale. |
|
55 @return A pointer to the newly allocated localized software type name object, if creation is successful. |
|
56 */ |
|
57 IMPORT_C static CLocalizedSoftwareTypeName* NewL(const TDesC& aName, TLanguage aLocale); |
|
58 |
|
59 /** |
|
60 Creates a localized software type name object. |
|
61 @param aName The name of the software type. |
|
62 @param aLocale The language code of the object's locale. |
|
63 @return A pointer to the newly allocated localized software type name object, if creation is successful. |
|
64 The pointer is also put onto the cleanup stack. |
|
65 */ |
|
66 IMPORT_C static CLocalizedSoftwareTypeName* NewLC(const TDesC& aName, TLanguage aLocale); |
|
67 |
|
68 /** |
|
69 Creates a localized software type name object from a stream. |
|
70 @param aStream The stream to read the localized software type name object from. |
|
71 @return A pointer to the newly allocated localized software type name object, if creation is successful. |
|
72 @internalComponent |
|
73 */ |
|
74 IMPORT_C static CLocalizedSoftwareTypeName* NewL(RReadStream& aStream); |
|
75 |
|
76 ~CLocalizedSoftwareTypeName(); |
|
77 |
|
78 /** |
|
79 Externalises a localized software type name object to a write stream. |
|
80 @param aStream The stream to which the object is externalised. |
|
81 @internalComponent |
|
82 */ |
|
83 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
|
84 |
|
85 /** @return The localized software type name. */ |
|
86 IMPORT_C const TDesC& NameL() const; |
|
87 |
|
88 private: |
|
89 CLocalizedSoftwareTypeName(); |
|
90 CLocalizedSoftwareTypeName(TLanguage aLocale); |
|
91 void ConstructL(const TDesC& aName); |
|
92 void InternalizeL(RReadStream& aStream); |
|
93 |
|
94 private: |
|
95 HBufC* iName; ///< The localized software type name. |
|
96 }; |
|
97 |
|
98 NONSHARABLE_CLASS (CScrLogEntry) : public CBase |
|
99 /** |
|
100 Class that represents a software component log record generated by the SCR. |
|
101 */ |
|
102 { |
|
103 friend class CScrRequestImpl; |
|
104 public: |
|
105 /** |
|
106 Creates a log entry object. |
|
107 @param aComponentName The name of the component. |
|
108 @param aUniqueSwTypeName The non-localized, unique software type name, such as @see Usif::KSoftwareTypeNative and @see Usif::KSoftwareTypeJava. |
|
109 @param aGlobalId The global Id of the component. |
|
110 @param aVersion The version of the component. |
|
111 @param aCompOpType The type of the component operation. @see Usif::TScrComponentOperationType |
|
112 @return A pointer to the newly allocated log entry object, if creation is successful. |
|
113 @internalComponent |
|
114 */ |
|
115 IMPORT_C static CScrLogEntry* NewL(const TDesC& aComponentName, const TDesC& aUniqueSwTypeName, const TDesC& aGlobalId, const TDesC& aVersion, const TScrComponentOperationType aCompOpType); |
|
116 |
|
117 /** |
|
118 Creates a log entry object. |
|
119 @param aComponentName The name of the component. |
|
120 @param aUniqueSwTypeName The non-localized, unique software type name, such as @see Usif::KSoftwareTypeNative and @see Usif::KSoftwareTypeJava. |
|
121 @param aGlobalId The global Id of the component. |
|
122 @param aVersion The version of the component. |
|
123 @param aCompOpType The type of the component operation. @see Usif::TScrComponentOperationType |
|
124 @return A pointer to the newly allocated log entry object, if creation is successful. |
|
125 The pointer is also put onto the cleanup stack. |
|
126 @internalComponent |
|
127 */ |
|
128 IMPORT_C static CScrLogEntry* NewLC(const TDesC& aComponentName, const TDesC& aUniqueSwTypeName, const TDesC& aGlobalId, const TDesC& aVersion, const TScrComponentOperationType aCompOpType); |
|
129 |
|
130 /** |
|
131 Creates a log entry object from a stream. |
|
132 @param aStream The stream to read the log entry object from. |
|
133 @return A pointer to the newly allocated log entry object, if creation is successful. |
|
134 The pointer is also put onto the cleanup stack. |
|
135 @internalComponent |
|
136 */ |
|
137 IMPORT_C static CScrLogEntry* NewLC(RReadStream& aStream); |
|
138 |
|
139 ~CScrLogEntry(); |
|
140 |
|
141 /** |
|
142 Write the object to a stream |
|
143 |
|
144 @param aStream The stream to write to |
|
145 @internalComponent |
|
146 */ |
|
147 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
|
148 |
|
149 /** |
|
150 Read the object from a stream |
|
151 |
|
152 @param aStream The stream to read from. |
|
153 @internalComponent |
|
154 */ |
|
155 IMPORT_C void InternalizeL(RReadStream& aStream) ; |
|
156 |
|
157 /** |
|
158 @return The name of the component for which the log was generated. |
|
159 */ |
|
160 IMPORT_C const TDesC& ComponentName() const; |
|
161 |
|
162 /** |
|
163 @return The non-localized, unique software type name, such as @see Usif::KSoftwareTypeNative and @see Usif::KSoftwareTypeJava. |
|
164 */ |
|
165 IMPORT_C const TDesC& SoftwareTypeName() const; |
|
166 |
|
167 /** |
|
168 The UID. |
|
169 @return The global ID of the component. |
|
170 */ |
|
171 IMPORT_C const TDesC& GlobalId() const; |
|
172 |
|
173 /** |
|
174 @return The version of the component. |
|
175 */ |
|
176 IMPORT_C const TDesC& ComponentVersion() const; |
|
177 |
|
178 /** |
|
179 @return The time when the operation occured. |
|
180 */ |
|
181 IMPORT_C const TTime OperationTime() const; |
|
182 |
|
183 /** |
|
184 @return The type of the component operation for the log record. |
|
185 */ |
|
186 IMPORT_C TScrComponentOperationType OperationType() const; |
|
187 |
|
188 /** |
|
189 @return The component id of the log record. |
|
190 @internalComponent |
|
191 */ |
|
192 IMPORT_C TComponentId ComponentId() const; |
|
193 |
|
194 private: |
|
195 CScrLogEntry(); |
|
196 void ConstructL(const TDesC& aComponentName, const TDesC& aUniqueSwTypeName, const TDesC& aGlobalId, const TDesC& aVersion, const TScrComponentOperationType aCompOpType); |
|
197 |
|
198 private: |
|
199 HBufC* iComponentName ; |
|
200 HBufC* iSwTypeName; |
|
201 HBufC* iVersion; |
|
202 TScrComponentOperationType iOpType ; |
|
203 TTime iRecordTime ; |
|
204 HBufC* iGlobalId; |
|
205 TComponentId iComponentId; |
|
206 }; |
|
207 |
|
208 } // End of namespace Usif |
|
209 |
|
210 #endif // SCRENTRIES_H |