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.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Defines the ECOM Core Dump Writer interface. 
    15 //
    16 
    17 
    18 
    19 /**
    20  @file
    21  @publishedPartner
    22  @released
    23 */
    24 
    25 #ifndef CRASH_DATA_SAVE_H
    26 #define CRASH_DATA_SAVE_H
    27 
    28 
    29 #include <e32std.h>
    30 #include <ecom.h>
    31 
    32 #include <ImplementationInformation.h>
    33 
    34 /**
    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.
    37 */
    38 const TUid KCCrashDataSaveUid = {0x102831e3};
    39 
    40 
    41 class COptionConfig;
    42 
    43 
    44 /**
    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.
    49 */
    50 class CCrashDataSave : public CBase
    51 {
    52 public:
    53 
    54     /** Interface for passing initialisation parameters
    55     to the derived class constructor. Standard ECOM implementation. 
    56 	*/
    57     struct TExampleInterfaceInitParams
    58         {
    59 		/** Integer cue */
    60         TInt integer;
    61 		/** Descriptor cue */
    62         const TDesC* descriptor;
    63         };
    64 
    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 );
    70 
    71 
    72 	/**
    73 	Obtain a description of the plugin.
    74 	*/
    75 	virtual void GetDescription( TDes & aPluginDescription ) = 0;
    76 
    77     /**
    78 	Return the number of configuration parameters implemented by the plugin.
    79 	*/
    80 	virtual TInt GetNumberConfigParametersL( ) = 0;
    81 
    82 	/**
    83 	Return the configuration parameter with ordinal aIndex.
    84 	@param  aIndex Parameter ordinal
    85 	*/
    86 	virtual COptionConfig * GetConfigParameterL( const TInt aIndex ) = 0;
    87 
    88 	
    89 	/**
    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
    97 	*/
    98 	virtual void SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue ) = 0;
    99 
   100 
   101 	// Writer interface
   102 
   103 	/**
   104 	Used to start the saving of data. 
   105 	@param aParam The interpretation of aParam is specific to the plugin.
   106 	*/
   107 	virtual void OpenL( const TDesC& aParam ) = 0;
   108 
   109 	/**
   110 	Used to start the saving of data. 
   111 	@param aParam The interpretation of aParam is specific to the plugin.
   112 	*/
   113 	virtual TInt Open( const TDesC& aParam ) = 0;
   114 	
   115 	
   116 	/**
   117 	End the data save operation.
   118 	@pre Must have called Open or OpenL
   119 	*/
   120 	virtual void CloseL() = 0;
   121 
   122 	/**
   123 	End the data save operation.
   124 	@pre Must have called Open or OpenL
   125 	*/
   126 	virtual TInt Close() = 0;
   127 
   128 	/**
   129 	Save data. 
   130 	@param aData TDesC8 with data to be saved.
   131 	@pre Must have called Open or OpenL
   132 	*/
   133 	virtual void WriteL( const TDesC8& aData ) = 0;
   134 
   135 	/**
   136 	Save data. 
   137 	@param aData TDesC8 with data to be saved.
   138 	@pre Must have called Open or OpenL
   139 	*/
   140 	virtual TInt Write( const TDesC8& aData ) = 0;
   141 
   142 	/**
   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
   147 	*/
   148 	virtual void WriteL( TAny* aData, TUint aSize ) = 0;
   149 
   150 	/**
   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
   155 	*/
   156 	virtual TInt Write( TAny* aData, TUint aSize ) = 0;
   157 
   158 	/**
   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
   163 	*/
   164 	virtual void WriteL( TInt aPos, const TDesC8& aData ) = 0;
   165 
   166 	/**
   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
   171 	*/
   172 	virtual TInt Write( TInt aPos, const TDesC8& aData ) = 0;
   173 
   174 	/**
   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
   180 	*/
   181 	virtual void WriteL( TInt aPos, TAny* aData, TUint aSize ) = 0;
   182 
   183 	/**
   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
   189 	*/
   190 	virtual TInt Write( TInt aPos, TAny* aData, TUint aSize ) = 0;
   191     
   192     //dtor
   193 public:
   194     virtual ~CCrashDataSave();
   195 
   196     /**
   197 	Writer plugin base configuration parameter identifiers. 
   198 	Identifiers for derived interfaces should start where this enum ends.
   199 	*/
   200 	enum TDataSaveParams
   201 		{
   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. */
   206 		ECoreFilePath,
   207 		EDataSaveLastParam
   208 		};
   209 
   210 protected:
   211 
   212 	/** Define the container for the plugin's configuration parameters */
   213 	typedef RPointerArray<COptionConfig>	RConfigParameterList;
   214 
   215 	/**
   216 	List of COptionConfig configuration parameters implemented by the plugin.
   217 	*/
   218 	RConfigParameterList	 iConfigList;
   219 
   220 private:
   221 	TUid iDtor_ID_Key;
   222 
   223 	TUint32 iSpare1;
   224 	TUint32 iSpare2;
   225 };
   226 
   227 #include <crashdatasave.inl>
   228 
   229 #endif