epoc32/include/tools/coredump/crashdatasave.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     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
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
// Defines the ECOM Core Dump Writer interface. 
williamr@4
    15
//
williamr@4
    16
williamr@4
    17
williamr@4
    18
williamr@4
    19
/**
williamr@4
    20
 @file
williamr@4
    21
 @publishedPartner
williamr@4
    22
 @released
williamr@4
    23
*/
williamr@4
    24
williamr@4
    25
#ifndef CRASH_DATA_SAVE_H
williamr@4
    26
#define CRASH_DATA_SAVE_H
williamr@4
    27
williamr@4
    28
williamr@4
    29
#include <e32std.h>
williamr@4
    30
#include <ecom.h>
williamr@4
    31
williamr@4
    32
#include <ImplementationInformation.h>
williamr@4
    33
williamr@4
    34
/**
williamr@4
    35
This is the ECOM interface UID that all Writer ECOM plugins supporting this interface
williamr@4
    36
must implement. This must match with the implementation_uid field of the rss file.
williamr@4
    37
*/
williamr@4
    38
const TUid KCCrashDataSaveUid = {0x102831e3};
williamr@4
    39
williamr@4
    40
williamr@4
    41
class COptionConfig;
williamr@4
    42
williamr@4
    43
williamr@4
    44
/**
williamr@4
    45
Class that defines the ECOM interface of a Core Dump Writer ECOM plugin.
williamr@4
    46
The responsibility of a writer plugin is to be a repository or channel for a 
williamr@4
    47
formatter's crash data.
williamr@4
    48
The class is intended for derivation by implementations of the interface.
williamr@4
    49
*/
williamr@4
    50
class CCrashDataSave : public CBase
williamr@4
    51
{
williamr@4
    52
public:
williamr@4
    53
williamr@4
    54
    /** Interface for passing initialisation parameters
williamr@4
    55
    to the derived class constructor. Standard ECOM implementation. 
williamr@4
    56
	*/
williamr@4
    57
    struct TExampleInterfaceInitParams
williamr@4
    58
        {
williamr@4
    59
		/** Integer cue */
williamr@4
    60
        TInt integer;
williamr@4
    61
		/** Descriptor cue */
williamr@4
    62
        const TDesC* descriptor;
williamr@4
    63
        };
williamr@4
    64
williamr@4
    65
	// mandatory ECOM functions
williamr@4
    66
	static CCrashDataSave* NewL();
williamr@4
    67
	static CCrashDataSave* NewL( const TDesC8 & aCue );
williamr@4
    68
	static CCrashDataSave* NewL(const TUid& aUid);
williamr@4
    69
	static void ListAllImplementationsL( RImplInfoPtrArray & aImplInfoArray );
williamr@4
    70
williamr@4
    71
williamr@4
    72
	/**
williamr@4
    73
	Obtain a description of the plugin.
williamr@4
    74
	*/
williamr@4
    75
	virtual void GetDescription( TDes & aPluginDescription ) = 0;
williamr@4
    76
williamr@4
    77
    /**
williamr@4
    78
	Return the number of configuration parameters implemented by the plugin.
williamr@4
    79
	*/
williamr@4
    80
	virtual TInt GetNumberConfigParametersL( ) = 0;
williamr@4
    81
williamr@4
    82
	/**
williamr@4
    83
	Return the configuration parameter with ordinal aIndex.
williamr@4
    84
	@param  aIndex Parameter ordinal
williamr@4
    85
	*/
williamr@4
    86
	virtual COptionConfig * GetConfigParameterL( const TInt aIndex ) = 0;
williamr@4
    87
williamr@4
    88
	
williamr@4
    89
	/**
williamr@4
    90
	Change the configuration parameter with ordinal aIndex to the given values. 
williamr@4
    91
	The plugin interprets and validates the values. Depending on the type of 
williamr@4
    92
	parameter, the plugin may use the integer parameter aValue or the 
williamr@4
    93
	descriptor parameter aDescValue
williamr@4
    94
	@param  aIndex Parameter ordinal
williamr@4
    95
	@param  aValue Integer value 
williamr@4
    96
	@param  aDescValue Descriptor value
williamr@4
    97
	*/
williamr@4
    98
	virtual void SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue ) = 0;
williamr@4
    99
williamr@4
   100
williamr@4
   101
	// Writer interface
williamr@4
   102
williamr@4
   103
	/**
williamr@4
   104
	Used to start the saving of data. 
williamr@4
   105
	@param aParam The interpretation of aParam is specific to the plugin.
williamr@4
   106
	*/
williamr@4
   107
	virtual void OpenL( const TDesC& aParam ) = 0;
williamr@4
   108
williamr@4
   109
	/**
williamr@4
   110
	Used to start the saving of data. 
williamr@4
   111
	@param aParam The interpretation of aParam is specific to the plugin.
williamr@4
   112
	*/
williamr@4
   113
	virtual TInt Open( const TDesC& aParam ) = 0;
williamr@4
   114
	
williamr@4
   115
	
williamr@4
   116
	/**
williamr@4
   117
	End the data save operation.
williamr@4
   118
	@pre Must have called Open or OpenL
williamr@4
   119
	*/
williamr@4
   120
	virtual void CloseL() = 0;
williamr@4
   121
williamr@4
   122
	/**
williamr@4
   123
	End the data save operation.
williamr@4
   124
	@pre Must have called Open or OpenL
williamr@4
   125
	*/
williamr@4
   126
	virtual TInt Close() = 0;
williamr@4
   127
williamr@4
   128
	/**
williamr@4
   129
	Save data. 
williamr@4
   130
	@param aData TDesC8 with data to be saved.
williamr@4
   131
	@pre Must have called Open or OpenL
williamr@4
   132
	*/
williamr@4
   133
	virtual void WriteL( const TDesC8& aData ) = 0;
williamr@4
   134
williamr@4
   135
	/**
williamr@4
   136
	Save data. 
williamr@4
   137
	@param aData TDesC8 with data to be saved.
williamr@4
   138
	@pre Must have called Open or OpenL
williamr@4
   139
	*/
williamr@4
   140
	virtual TInt Write( const TDesC8& aData ) = 0;
williamr@4
   141
williamr@4
   142
	/**
williamr@4
   143
	Save data from a pointer given the data size.
williamr@4
   144
	@param aData Pointer to data to be saved.
williamr@4
   145
	@param aSize Length of data to be saved in bytes
williamr@4
   146
	@pre Must have called Open or OpenL
williamr@4
   147
	*/
williamr@4
   148
	virtual void WriteL( TAny* aData, TUint aSize ) = 0;
williamr@4
   149
williamr@4
   150
	/**
williamr@4
   151
	Save data from a pointer given the data size.
williamr@4
   152
	@param aData Pointer to data to be saved.
williamr@4
   153
	@param aSize Length of data to be saved in bytes
williamr@4
   154
	@pre Must have called Open or OpenL
williamr@4
   155
	*/
williamr@4
   156
	virtual TInt Write( TAny* aData, TUint aSize ) = 0;
williamr@4
   157
williamr@4
   158
	/**
williamr@4
   159
	Save aData at the specific position.
williamr@4
   160
	@param aPos The interpretation of aPos is specific to the plugin.
williamr@4
   161
	@param aData TDesC8 with data to be saved.
williamr@4
   162
	@pre Must have called Open or OpenL
williamr@4
   163
	*/
williamr@4
   164
	virtual void WriteL( TInt aPos, const TDesC8& aData ) = 0;
williamr@4
   165
williamr@4
   166
	/**
williamr@4
   167
	Save aData at the specific position. 
williamr@4
   168
	@param aPos The interpretation of aPos is specific to the plugin.
williamr@4
   169
	@param aData TDesC8 with data to be saved.
williamr@4
   170
	@pre Must have called Open or OpenL
williamr@4
   171
	*/
williamr@4
   172
	virtual TInt Write( TInt aPos, const TDesC8& aData ) = 0;
williamr@4
   173
williamr@4
   174
	/**
williamr@4
   175
	Save aData at the specific position. 
williamr@4
   176
	@param aPos The interpretation of aPos is specific to the plugin.
williamr@4
   177
	@param aData Pointer to data to be saved.
williamr@4
   178
	@param aSize Length of data to be saved in bytes
williamr@4
   179
	@pre Must have called Open or OpenL
williamr@4
   180
	*/
williamr@4
   181
	virtual void WriteL( TInt aPos, TAny* aData, TUint aSize ) = 0;
williamr@4
   182
williamr@4
   183
	/**
williamr@4
   184
	Save aData at the specific position. 
williamr@4
   185
	@param aPos The interpretation of aPos is specific to the plugin.
williamr@4
   186
	@param aData Pointer to data to be saved.
williamr@4
   187
	@param aSize Length of data to be saved in bytes
williamr@4
   188
	@pre Must have called Open or OpenL
williamr@4
   189
	*/
williamr@4
   190
	virtual TInt Write( TInt aPos, TAny* aData, TUint aSize ) = 0;
williamr@4
   191
    
williamr@4
   192
    //dtor
williamr@4
   193
public:
williamr@4
   194
    virtual ~CCrashDataSave();
williamr@4
   195
williamr@4
   196
    /**
williamr@4
   197
	Writer plugin base configuration parameter identifiers. 
williamr@4
   198
	Identifiers for derived interfaces should start where this enum ends.
williamr@4
   199
	*/
williamr@4
   200
	enum TDataSaveParams
williamr@4
   201
		{
williamr@4
   202
		/** This parameter is a root identifier for core dumps. Its use depends on the
williamr@4
   203
		writer plugin and potentially the formatters. For example for an email data save 
williamr@4
   204
		plugin this parameter could be an the email address. For a file writer it could be 
williamr@4
   205
		a file name or a directory path. */
williamr@4
   206
		ECoreFilePath,
williamr@4
   207
		EDataSaveLastParam
williamr@4
   208
		};
williamr@4
   209
williamr@4
   210
protected:
williamr@4
   211
williamr@4
   212
	/** Define the container for the plugin's configuration parameters */
williamr@4
   213
	typedef RPointerArray<COptionConfig>	RConfigParameterList;
williamr@4
   214
williamr@4
   215
	/**
williamr@4
   216
	List of COptionConfig configuration parameters implemented by the plugin.
williamr@4
   217
	*/
williamr@4
   218
	RConfigParameterList	 iConfigList;
williamr@4
   219
williamr@4
   220
private:
williamr@4
   221
	TUid iDtor_ID_Key;
williamr@4
   222
williamr@4
   223
	TUint32 iSpare1;
williamr@4
   224
	TUint32 iSpare2;
williamr@4
   225
};
williamr@4
   226
williamr@4
   227
#include <crashdatasave.inl>
williamr@4
   228
williamr@4
   229
#endif