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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Defines the ECOM Core Dump Writer interface.
25 #ifndef CRASH_DATA_SAVE_H
26 #define CRASH_DATA_SAVE_H
32 #include <ImplementationInformation.h>
35 This is the ECOM interface UID that all Writer ECOM plugins supporting this interface
36 must implement. This must match with the implementation_uid field of the rss file.
38 const TUid KCCrashDataSaveUid = {0x102831e3};
45 Class that defines the ECOM interface of a Core Dump Writer ECOM plugin.
46 The responsibility of a writer plugin is to be a repository or channel for a
47 formatter's crash data.
48 The class is intended for derivation by implementations of the interface.
50 class CCrashDataSave : public CBase
54 /** Interface for passing initialisation parameters
55 to the derived class constructor. Standard ECOM implementation.
57 struct TExampleInterfaceInitParams
62 const TDesC* descriptor;
65 // mandatory ECOM functions
66 static CCrashDataSave* NewL();
67 static CCrashDataSave* NewL( const TDesC8 & aCue );
68 static CCrashDataSave* NewL(const TUid& aUid);
69 static void ListAllImplementationsL( RImplInfoPtrArray & aImplInfoArray );
73 Obtain a description of the plugin.
75 virtual void GetDescription( TDes & aPluginDescription ) = 0;
78 Return the number of configuration parameters implemented by the plugin.
80 virtual TInt GetNumberConfigParametersL( ) = 0;
83 Return the configuration parameter with ordinal aIndex.
84 @param aIndex Parameter ordinal
86 virtual COptionConfig * GetConfigParameterL( const TInt aIndex ) = 0;
90 Change the configuration parameter with ordinal aIndex to the given values.
91 The plugin interprets and validates the values. Depending on the type of
92 parameter, the plugin may use the integer parameter aValue or the
93 descriptor parameter aDescValue
94 @param aIndex Parameter ordinal
95 @param aValue Integer value
96 @param aDescValue Descriptor value
98 virtual void SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue ) = 0;
104 Used to start the saving of data.
105 @param aParam The interpretation of aParam is specific to the plugin.
107 virtual void OpenL( const TDesC& aParam ) = 0;
110 Used to start the saving of data.
111 @param aParam The interpretation of aParam is specific to the plugin.
113 virtual TInt Open( const TDesC& aParam ) = 0;
117 End the data save operation.
118 @pre Must have called Open or OpenL
120 virtual void CloseL() = 0;
123 End the data save operation.
124 @pre Must have called Open or OpenL
126 virtual TInt Close() = 0;
130 @param aData TDesC8 with data to be saved.
131 @pre Must have called Open or OpenL
133 virtual void WriteL( const TDesC8& aData ) = 0;
137 @param aData TDesC8 with data to be saved.
138 @pre Must have called Open or OpenL
140 virtual TInt Write( const TDesC8& aData ) = 0;
143 Save data from a pointer given the data size.
144 @param aData Pointer to data to be saved.
145 @param aSize Length of data to be saved in bytes
146 @pre Must have called Open or OpenL
148 virtual void WriteL( TAny* aData, TUint aSize ) = 0;
151 Save data from a pointer given the data size.
152 @param aData Pointer to data to be saved.
153 @param aSize Length of data to be saved in bytes
154 @pre Must have called Open or OpenL
156 virtual TInt Write( TAny* aData, TUint aSize ) = 0;
159 Save aData at the specific position.
160 @param aPos The interpretation of aPos is specific to the plugin.
161 @param aData TDesC8 with data to be saved.
162 @pre Must have called Open or OpenL
164 virtual void WriteL( TInt aPos, const TDesC8& aData ) = 0;
167 Save aData at the specific position.
168 @param aPos The interpretation of aPos is specific to the plugin.
169 @param aData TDesC8 with data to be saved.
170 @pre Must have called Open or OpenL
172 virtual TInt Write( TInt aPos, const TDesC8& aData ) = 0;
175 Save aData at the specific position.
176 @param aPos The interpretation of aPos is specific to the plugin.
177 @param aData Pointer to data to be saved.
178 @param aSize Length of data to be saved in bytes
179 @pre Must have called Open or OpenL
181 virtual void WriteL( TInt aPos, TAny* aData, TUint aSize ) = 0;
184 Save aData at the specific position.
185 @param aPos The interpretation of aPos is specific to the plugin.
186 @param aData Pointer to data to be saved.
187 @param aSize Length of data to be saved in bytes
188 @pre Must have called Open or OpenL
190 virtual TInt Write( TInt aPos, TAny* aData, TUint aSize ) = 0;
194 virtual ~CCrashDataSave();
197 Writer plugin base configuration parameter identifiers.
198 Identifiers for derived interfaces should start where this enum ends.
202 /** This parameter is a root identifier for core dumps. Its use depends on the
203 writer plugin and potentially the formatters. For example for an email data save
204 plugin this parameter could be an the email address. For a file writer it could be
205 a file name or a directory path. */
212 /** Define the container for the plugin's configuration parameters */
213 typedef RPointerArray<COptionConfig> RConfigParameterList;
216 List of COptionConfig configuration parameters implemented by the plugin.
218 RConfigParameterList iConfigList;
227 #include <crashdatasave.inl>