1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/coredump/crashdatasave.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,229 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// 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
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Defines the ECOM Core Dump Writer interface.
1.18 +//
1.19 +
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @publishedPartner
1.25 + @released
1.26 +*/
1.27 +
1.28 +#ifndef CRASH_DATA_SAVE_H
1.29 +#define CRASH_DATA_SAVE_H
1.30 +
1.31 +
1.32 +#include <e32std.h>
1.33 +#include <ecom.h>
1.34 +
1.35 +#include <ImplementationInformation.h>
1.36 +
1.37 +/**
1.38 +This is the ECOM interface UID that all Writer ECOM plugins supporting this interface
1.39 +must implement. This must match with the implementation_uid field of the rss file.
1.40 +*/
1.41 +const TUid KCCrashDataSaveUid = {0x102831e3};
1.42 +
1.43 +
1.44 +class COptionConfig;
1.45 +
1.46 +
1.47 +/**
1.48 +Class that defines the ECOM interface of a Core Dump Writer ECOM plugin.
1.49 +The responsibility of a writer plugin is to be a repository or channel for a
1.50 +formatter's crash data.
1.51 +The class is intended for derivation by implementations of the interface.
1.52 +*/
1.53 +class CCrashDataSave : public CBase
1.54 +{
1.55 +public:
1.56 +
1.57 + /** Interface for passing initialisation parameters
1.58 + to the derived class constructor. Standard ECOM implementation.
1.59 + */
1.60 + struct TExampleInterfaceInitParams
1.61 + {
1.62 + /** Integer cue */
1.63 + TInt integer;
1.64 + /** Descriptor cue */
1.65 + const TDesC* descriptor;
1.66 + };
1.67 +
1.68 + // mandatory ECOM functions
1.69 + static CCrashDataSave* NewL();
1.70 + static CCrashDataSave* NewL( const TDesC8 & aCue );
1.71 + static CCrashDataSave* NewL(const TUid& aUid);
1.72 + static void ListAllImplementationsL( RImplInfoPtrArray & aImplInfoArray );
1.73 +
1.74 +
1.75 + /**
1.76 + Obtain a description of the plugin.
1.77 + */
1.78 + virtual void GetDescription( TDes & aPluginDescription ) = 0;
1.79 +
1.80 + /**
1.81 + Return the number of configuration parameters implemented by the plugin.
1.82 + */
1.83 + virtual TInt GetNumberConfigParametersL( ) = 0;
1.84 +
1.85 + /**
1.86 + Return the configuration parameter with ordinal aIndex.
1.87 + @param aIndex Parameter ordinal
1.88 + */
1.89 + virtual COptionConfig * GetConfigParameterL( const TInt aIndex ) = 0;
1.90 +
1.91 +
1.92 + /**
1.93 + Change the configuration parameter with ordinal aIndex to the given values.
1.94 + The plugin interprets and validates the values. Depending on the type of
1.95 + parameter, the plugin may use the integer parameter aValue or the
1.96 + descriptor parameter aDescValue
1.97 + @param aIndex Parameter ordinal
1.98 + @param aValue Integer value
1.99 + @param aDescValue Descriptor value
1.100 + */
1.101 + virtual void SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue ) = 0;
1.102 +
1.103 +
1.104 + // Writer interface
1.105 +
1.106 + /**
1.107 + Used to start the saving of data.
1.108 + @param aParam The interpretation of aParam is specific to the plugin.
1.109 + */
1.110 + virtual void OpenL( const TDesC& aParam ) = 0;
1.111 +
1.112 + /**
1.113 + Used to start the saving of data.
1.114 + @param aParam The interpretation of aParam is specific to the plugin.
1.115 + */
1.116 + virtual TInt Open( const TDesC& aParam ) = 0;
1.117 +
1.118 +
1.119 + /**
1.120 + End the data save operation.
1.121 + @pre Must have called Open or OpenL
1.122 + */
1.123 + virtual void CloseL() = 0;
1.124 +
1.125 + /**
1.126 + End the data save operation.
1.127 + @pre Must have called Open or OpenL
1.128 + */
1.129 + virtual TInt Close() = 0;
1.130 +
1.131 + /**
1.132 + Save data.
1.133 + @param aData TDesC8 with data to be saved.
1.134 + @pre Must have called Open or OpenL
1.135 + */
1.136 + virtual void WriteL( const TDesC8& aData ) = 0;
1.137 +
1.138 + /**
1.139 + Save data.
1.140 + @param aData TDesC8 with data to be saved.
1.141 + @pre Must have called Open or OpenL
1.142 + */
1.143 + virtual TInt Write( const TDesC8& aData ) = 0;
1.144 +
1.145 + /**
1.146 + Save data from a pointer given the data size.
1.147 + @param aData Pointer to data to be saved.
1.148 + @param aSize Length of data to be saved in bytes
1.149 + @pre Must have called Open or OpenL
1.150 + */
1.151 + virtual void WriteL( TAny* aData, TUint aSize ) = 0;
1.152 +
1.153 + /**
1.154 + Save data from a pointer given the data size.
1.155 + @param aData Pointer to data to be saved.
1.156 + @param aSize Length of data to be saved in bytes
1.157 + @pre Must have called Open or OpenL
1.158 + */
1.159 + virtual TInt Write( TAny* aData, TUint aSize ) = 0;
1.160 +
1.161 + /**
1.162 + Save aData at the specific position.
1.163 + @param aPos The interpretation of aPos is specific to the plugin.
1.164 + @param aData TDesC8 with data to be saved.
1.165 + @pre Must have called Open or OpenL
1.166 + */
1.167 + virtual void WriteL( TInt aPos, const TDesC8& aData ) = 0;
1.168 +
1.169 + /**
1.170 + Save aData at the specific position.
1.171 + @param aPos The interpretation of aPos is specific to the plugin.
1.172 + @param aData TDesC8 with data to be saved.
1.173 + @pre Must have called Open or OpenL
1.174 + */
1.175 + virtual TInt Write( TInt aPos, const TDesC8& aData ) = 0;
1.176 +
1.177 + /**
1.178 + Save aData at the specific position.
1.179 + @param aPos The interpretation of aPos is specific to the plugin.
1.180 + @param aData Pointer to data to be saved.
1.181 + @param aSize Length of data to be saved in bytes
1.182 + @pre Must have called Open or OpenL
1.183 + */
1.184 + virtual void WriteL( TInt aPos, TAny* aData, TUint aSize ) = 0;
1.185 +
1.186 + /**
1.187 + Save aData at the specific position.
1.188 + @param aPos The interpretation of aPos is specific to the plugin.
1.189 + @param aData Pointer to data to be saved.
1.190 + @param aSize Length of data to be saved in bytes
1.191 + @pre Must have called Open or OpenL
1.192 + */
1.193 + virtual TInt Write( TInt aPos, TAny* aData, TUint aSize ) = 0;
1.194 +
1.195 + //dtor
1.196 +public:
1.197 + virtual ~CCrashDataSave();
1.198 +
1.199 + /**
1.200 + Writer plugin base configuration parameter identifiers.
1.201 + Identifiers for derived interfaces should start where this enum ends.
1.202 + */
1.203 + enum TDataSaveParams
1.204 + {
1.205 + /** This parameter is a root identifier for core dumps. Its use depends on the
1.206 + writer plugin and potentially the formatters. For example for an email data save
1.207 + plugin this parameter could be an the email address. For a file writer it could be
1.208 + a file name or a directory path. */
1.209 + ECoreFilePath,
1.210 + EDataSaveLastParam
1.211 + };
1.212 +
1.213 +protected:
1.214 +
1.215 + /** Define the container for the plugin's configuration parameters */
1.216 + typedef RPointerArray<COptionConfig> RConfigParameterList;
1.217 +
1.218 + /**
1.219 + List of COptionConfig configuration parameters implemented by the plugin.
1.220 + */
1.221 + RConfigParameterList iConfigList;
1.222 +
1.223 +private:
1.224 + TUid iDtor_ID_Key;
1.225 +
1.226 + TUint32 iSpare1;
1.227 + TUint32 iSpare2;
1.228 +};
1.229 +
1.230 +#include <crashdatasave.inl>
1.231 +
1.232 +#endif