williamr@4: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4: // All rights reserved.
williamr@4: // This component and the accompanying materials are made available
williamr@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: // which accompanies this distribution, and is available
williamr@4: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@4: //
williamr@4: // Initial Contributors:
williamr@4: // Nokia Corporation - initial contribution.
williamr@4: //
williamr@4: // Contributors:
williamr@4: //
williamr@4: // Description:
williamr@4: //
williamr@4: 
williamr@4: #ifndef FORMATTER_API_H
williamr@4: #define FORMATTER_API_H
williamr@4: 
williamr@4: /**
williamr@4: @file
williamr@4: @publishedPartner
williamr@4: @released
williamr@4: 
williamr@4: Defines the ECOM Core Dump Formatting interface. 
williamr@4: 
williamr@4: */
williamr@4: 
williamr@4: #include <e32base.h>
williamr@4: #include <badesca.h>
williamr@4: #include <ecom.h>
williamr@4: #include <ImplementationInformation.h>
williamr@4: #include <crashdata.h>
williamr@4: 
williamr@4: /**
williamr@4: This is the ECOM interface UID that all Formatter ECOM plugins supporting this interface
williamr@4: must implement. This must match with the implementation_uid field of the rss file.
williamr@4: */
williamr@4: const TUid KCCoreDumpFormatterUid = {0x10282fe2};
williamr@4: 
williamr@4: class CCrashDataSource;
williamr@4: class CCrashDataSave;
williamr@4: class COptionConfig;
williamr@4: 
williamr@4: /**
williamr@4: @publishedPartner
williamr@4: @released
williamr@4: 
williamr@4: Definition of the ECOM Core Dump Formatting interface. 
williamr@4: The interface is pure virtual. Formatters must implement this interface for the 
williamr@4: core dump server to be able to load them.
williamr@4: */
williamr@4: class CCoreDumpFormatter : public CBase
williamr@4: {
williamr@4: 
williamr@4: public:
williamr@4: 
williamr@4:     /** Interface for passing initialisation parameters
williamr@4:     to the derived class constructor. Standard ECOM implementation. 
williamr@4: 	*/
williamr@4:     struct TExampleInterfaceInitParams
williamr@4:         {
williamr@4: 		/** Integer cue */
williamr@4:         TInt integer;
williamr@4: 		/** Descriptor cue */
williamr@4:         const TDesC* descriptor;
williamr@4:         };
williamr@4: 
williamr@4: 	// mandatory ECOM functions
williamr@4: 
williamr@4: 	static CCoreDumpFormatter* NewL();
williamr@4: 	static CCoreDumpFormatter* NewL( const TDesC8 & aCue );
williamr@4: 	static CCoreDumpFormatter* NewL(const TUid& aUid);
williamr@4: 
williamr@4: 	virtual ~CCoreDumpFormatter();
williamr@4: 	static void ListAllImplementationsL( RImplInfoPtrArray & aImplInfoArray );
williamr@4: 
williamr@4: public:
williamr@4: 	// The formatter interface
williamr@4: 
williamr@4: 
williamr@4: 	/**
williamr@4: 	Core dump server makes this call to supply the formatter with the 
williamr@4: 	data save object. The formatter can then use this object to store 
williamr@4: 	its crash data. The formatter does not own the object.
williamr@4: 	@param aDataSave Data save object to save crash data to.
williamr@4: 	@see CCrashDataSave 
williamr@4: 	*/
williamr@4: 	virtual void ConfigureDataSaveL( CCrashDataSave * aDataSave ) = 0;
williamr@4: 
williamr@4: 	/**
williamr@4: 	Core dump server makes this call to supply the formatter with the 
williamr@4: 	data source object. The formatter can then use this object to obtain
williamr@4: 	crash data. The formatter does not own the object.
williamr@4: 	@param aDataSource Data source object to obtain crash data from.
williamr@4: 	@see CCrashDataSource
williamr@4: 	*/
williamr@4: 	virtual void ConfigureDataSourceL( CCrashDataSource * aDataSource ) = 0;
williamr@4: 
williamr@4: 	/**
williamr@4: 	Call used to obtain a text description of the formatter. Can be used by
williamr@4: 	UIs to present a description to the user.
williamr@4: 	@param aPluginDescription Descriptor with formatter descriptor.
williamr@4: 	*/
williamr@4: 	virtual void GetDescription( TDes & aPluginDescription ) = 0;
williamr@4: 
williamr@4: 	/** 
williamr@4: 	This method informs the formatter that a crash event has occured. 
williamr@4: 	Called by Core Dump Server, which owns the TCrashInfo object.
williamr@4: 	@param aCrashInfo Crash event information with crash data. 
williamr@4: 	Object is owned by caller.
williamr@4: 	@see TCrashInfo
williamr@4: 	*/
williamr@4:     virtual void CrashEventL(TCrashInfo* aCrashInfo) = 0;
williamr@4: 
williamr@4: 	/** 
williamr@4: 	Used to obtain the number of configuration parameters implemented by the 
williamr@4: 	formatter. Use this call in conjunction with GetConfigParameterL().
williamr@4: 	@return Number of configuration parameters implemented by formatter.
williamr@4: 	@see COptionConfig
williamr@4: 	*/
williamr@4: 	virtual TInt GetNumberConfigParametersL( ) = 0;
williamr@4: 
williamr@4: 	/** 
williamr@4: 	Return the configuration parameter indexed by aIndex. aIndex should be less
williamr@4: 	than the value returned by GetNumberConfigParametersL().
williamr@4: 	@param aIndex Parameter ordinal to retrieve.
williamr@4: 	@return Pointer to a COptionConfig object that is then owned by the caller.
williamr@4: 	@see COptionConfig.
williamr@4: 	@see GetNumberConfigParametersL().
williamr@4: 	*/
williamr@4: 	virtual COptionConfig * GetConfigParameterL( const TInt aIndex ) = 0;
williamr@4: 
williamr@4: 	/** 
williamr@4: 	Set the value of a configuration parameters indexed by aIndex. 
williamr@4: 	@param  aIndex Parameter ordinal to change.
williamr@4: 	@param  aValue Integer value.
williamr@4: 	@param  aDescValue Descriptor value.
williamr@4: 	@see COptionConfig
williamr@4: 	*/
williamr@4: 	virtual void SetConfigParameterL( const TInt aIndex, 
williamr@4: 									const TInt32 & aValue, 
williamr@4: 									const TDesC & aDescValue ) = 0;
williamr@4: 	
williamr@4: protected:
williamr@4: 	CCoreDumpFormatter();
williamr@4: 
williamr@4: private:
williamr@4: 	
williamr@4: 	TUid iDtor_ID_Key;
williamr@4: 
williamr@4: 	TUint32 iSpare1;
williamr@4: 	TUint32 iSpare2;
williamr@4: };
williamr@4: 
williamr@4: #include <formatterapi.inl>
williamr@4: 
williamr@4: #endif // FORMATTER_API_H