0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// Defines ECOM-plugin related classes used accross the Core Dump client/server interface
|
|
15 |
//
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file
|
|
21 |
@publishedPartner
|
|
22 |
@released
|
|
23 |
*/
|
|
24 |
|
|
25 |
#ifndef PLUGINDATA_H
|
|
26 |
#define PLUGINDATA_H
|
|
27 |
|
|
28 |
/**
|
|
29 |
@publishedPartner
|
|
30 |
@released
|
|
31 |
|
|
32 |
Class used between Core Dump Server and its clients to request
|
|
33 |
the server to carry out actions on plugins, such as load/unload.
|
|
34 |
@see CCrashConfig::LoadPlugin()
|
|
35 |
*/
|
|
36 |
class TPluginRequest
|
|
37 |
{
|
|
38 |
public:
|
|
39 |
|
|
40 |
|
|
41 |
inline TPluginRequest(){ iIndex = 0; }
|
|
42 |
|
|
43 |
/**
|
|
44 |
Type of plugin to request
|
|
45 |
*/
|
|
46 |
enum TPluginType
|
|
47 |
{
|
|
48 |
/** A formatter plugin */
|
|
49 |
EFormatter,
|
|
50 |
/** A writer plugin */
|
|
51 |
EWriter
|
|
52 |
};
|
|
53 |
|
|
54 |
|
|
55 |
/* Whether to load or unload the plugin */
|
|
56 |
TBool iLoad;
|
|
57 |
|
|
58 |
/** Type of plugin */
|
|
59 |
TPluginType iPluginType;
|
|
60 |
|
|
61 |
/** Index of the plugin that requires action */
|
|
62 |
TUint iIndex;
|
|
63 |
|
|
64 |
/** Plugin UID, used to check correct plugin */
|
|
65 |
TUid iUid;
|
|
66 |
|
|
67 |
/** Index of the pair plugin */
|
|
68 |
TUint iPair;
|
|
69 |
|
|
70 |
/** @internalTechnology */
|
|
71 |
TUint32 iSpare2;
|
|
72 |
};
|
|
73 |
|
|
74 |
|
|
75 |
/** Maximum length allowed for a plugin's name */
|
|
76 |
#define KPluginNameLength (50)
|
|
77 |
|
|
78 |
/** Maximum length allowed for a plugin's description */
|
|
79 |
#define KPluginDescriptionLength (250)
|
|
80 |
|
|
81 |
/**
|
|
82 |
@publishedPartner
|
|
83 |
@released
|
|
84 |
|
|
85 |
Detailed information about a plugin.
|
|
86 |
@see RPluginList
|
|
87 |
@see TPluginInfoBlock
|
|
88 |
*/
|
|
89 |
class TPluginInfo
|
|
90 |
{
|
|
91 |
public:
|
|
92 |
|
|
93 |
/** Plugin's own version.
|
|
94 |
From rss file::IMPLEMENTATION_INFO::version_no */
|
|
95 |
TUint iVersion;
|
|
96 |
|
|
97 |
/** Plugin's unique UID.
|
|
98 |
From rss file::IMPLEMENTATION_INFO::implementation_uid */
|
|
99 |
TUid iUid;
|
|
100 |
|
|
101 |
/** Plugin's own name.
|
|
102 |
From rss file::IMPLEMENTATION_INFO::display_name */
|
|
103 |
TBufC<KPluginNameLength> iName;
|
|
104 |
|
|
105 |
/** Plugin's own description obtained from
|
|
106 |
CCoreDumpFormatter->GetDescription()
|
|
107 |
@see CCoreDumpFormatter */
|
|
108 |
TBufC<KPluginDescriptionLength> iDescription;
|
|
109 |
|
|
110 |
/** Plugin type : from TPluginRequest::TPluginType */
|
|
111 |
TPluginRequest::TPluginType iType;
|
|
112 |
|
|
113 |
/** Plugin loaded state. */
|
|
114 |
TBool iLoaded;
|
|
115 |
|
|
116 |
/** Reserved for future use
|
|
117 |
@internalTechnology */
|
|
118 |
TUint32 iSpare1;
|
|
119 |
|
|
120 |
/** @internalTechnology */
|
|
121 |
TUint32 iSpare2;
|
|
122 |
};
|
|
123 |
|
|
124 |
|
|
125 |
/**
|
|
126 |
@publishedPartner
|
|
127 |
@released
|
|
128 |
|
|
129 |
List of TPluginInfo objects.
|
|
130 |
@see TPluginInfo
|
|
131 |
@see RArray
|
|
132 |
*/
|
|
133 |
typedef RArray<TPluginInfo> RPluginList;
|
|
134 |
|
|
135 |
|
|
136 |
#include <streamelement.h>
|
|
137 |
|
|
138 |
/**
|
|
139 |
@publishedPartner
|
|
140 |
@released
|
|
141 |
|
|
142 |
Class that represents a ECOM plugin instance.
|
|
143 |
It is based on CStreamElementBase so it can be streamed between client and server.
|
|
144 |
@see CServerCrashDataSource::GetPluginListL
|
|
145 |
*/
|
|
146 |
class CPluginInfo : public CStreamElementBase
|
|
147 |
{
|
|
148 |
|
|
149 |
public:
|
|
150 |
|
|
151 |
IMPORT_C static CPluginInfo* NewL( const TDesC &aName,
|
|
152 |
const TInt aUid,
|
|
153 |
const TUint aVersion,
|
|
154 |
const TPluginRequest::TPluginType aType);
|
|
155 |
|
|
156 |
IMPORT_C static CPluginInfo* NewL( const TDesC8 & aStreamData );
|
|
157 |
|
|
158 |
IMPORT_C ~CPluginInfo();
|
|
159 |
|
|
160 |
public:
|
|
161 |
|
|
162 |
IMPORT_C void NameL( const TDesC & aName );
|
|
163 |
IMPORT_C const TDesC & Name() const;
|
|
164 |
|
|
165 |
IMPORT_C void Uid(const TInt aUid);
|
|
166 |
IMPORT_C TInt Uid() const;
|
|
167 |
|
|
168 |
IMPORT_C void Version(TUint aVersion);
|
|
169 |
IMPORT_C TUint Version() const;
|
|
170 |
|
|
171 |
IMPORT_C void Pair(TUint aIndex);
|
|
172 |
IMPORT_C TUint Pair() const;
|
|
173 |
|
|
174 |
IMPORT_C void Type(TPluginRequest::TPluginType aType);
|
|
175 |
IMPORT_C TPluginRequest::TPluginType Type() const;
|
|
176 |
|
|
177 |
public:
|
|
178 |
// Methods required by streaming interface
|
|
179 |
|
|
180 |
IMPORT_C TInt static MaxSize();
|
|
181 |
|
|
182 |
IMPORT_C TInt Size() const;
|
|
183 |
|
|
184 |
// Initializes ’this’ from stream
|
|
185 |
IMPORT_C void InternalizeL( RReadStream & aStream );
|
|
186 |
|
|
187 |
// Writes ’this’ to the stream
|
|
188 |
IMPORT_C void ExternalizeL( RWriteStream & aStream, CBufFlat* buf );
|
|
189 |
|
|
190 |
|
|
191 |
private:
|
|
192 |
|
|
193 |
CPluginInfo( const TInt aUid,
|
|
194 |
const TUint aVersion,
|
|
195 |
const TPluginRequest::TPluginType aType);
|
|
196 |
|
|
197 |
CPluginInfo();
|
|
198 |
|
|
199 |
void ConstructL( const TDesC & aName );
|
|
200 |
|
|
201 |
private:
|
|
202 |
|
|
203 |
/** Plugin name */
|
|
204 |
HBufC *iName;
|
|
205 |
|
|
206 |
/** Plugin UID */
|
|
207 |
TInt iUid;
|
|
208 |
|
|
209 |
/** Plugin version */
|
|
210 |
TUint iVersion;
|
|
211 |
|
|
212 |
/** Plugin type : from TPluginRequest::TPluginType */
|
|
213 |
TPluginRequest::TPluginType iType;
|
|
214 |
|
|
215 |
/** Index to paired plugin */
|
|
216 |
TUint iPair;
|
|
217 |
|
|
218 |
/** Externalized size */
|
|
219 |
TUint iSize;
|
|
220 |
|
|
221 |
/** Reserved for future use
|
|
222 |
@internalTechnology */
|
|
223 |
TUint32 iSpare1;
|
|
224 |
|
|
225 |
/** @internalTechnology */
|
|
226 |
TUint32 iSpare2;
|
|
227 |
|
|
228 |
};
|
|
229 |
|
|
230 |
|
|
231 |
/**
|
|
232 |
@publishedPartner
|
|
233 |
@released
|
|
234 |
|
|
235 |
List of CPluginInfo object pointers
|
|
236 |
@see CPluginInfo
|
|
237 |
@see RPointerArray
|
|
238 |
*/
|
|
239 |
typedef RPointerArray<CPluginInfo> RPluginPointerList;
|
|
240 |
|
|
241 |
|
|
242 |
#endif
|