williamr@4: // Copyright (c) 2007-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: // Defines the ECOM Core Dump Writer interface. williamr@4: // williamr@4: williamr@4: williamr@4: williamr@4: /** williamr@4: @file williamr@4: @publishedPartner williamr@4: @released williamr@4: */ williamr@4: williamr@4: #ifndef CRASH_DATA_SAVE_H williamr@4: #define CRASH_DATA_SAVE_H williamr@4: williamr@4: williamr@4: #include williamr@4: #include williamr@4: williamr@4: #include williamr@4: williamr@4: /** williamr@4: This is the ECOM interface UID that all Writer 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 KCCrashDataSaveUid = {0x102831e3}; williamr@4: williamr@4: williamr@4: class COptionConfig; williamr@4: williamr@4: williamr@4: /** williamr@4: Class that defines the ECOM interface of a Core Dump Writer ECOM plugin. williamr@4: The responsibility of a writer plugin is to be a repository or channel for a williamr@4: formatter's crash data. williamr@4: The class is intended for derivation by implementations of the interface. williamr@4: */ williamr@4: class CCrashDataSave : public CBase 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: static CCrashDataSave* NewL(); williamr@4: static CCrashDataSave* NewL( const TDesC8 & aCue ); williamr@4: static CCrashDataSave* NewL(const TUid& aUid); williamr@4: static void ListAllImplementationsL( RImplInfoPtrArray & aImplInfoArray ); williamr@4: williamr@4: williamr@4: /** williamr@4: Obtain a description of the plugin. williamr@4: */ williamr@4: virtual void GetDescription( TDes & aPluginDescription ) = 0; williamr@4: williamr@4: /** williamr@4: Return the number of configuration parameters implemented by the plugin. williamr@4: */ williamr@4: virtual TInt GetNumberConfigParametersL( ) = 0; williamr@4: williamr@4: /** williamr@4: Return the configuration parameter with ordinal aIndex. williamr@4: @param aIndex Parameter ordinal williamr@4: */ williamr@4: virtual COptionConfig * GetConfigParameterL( const TInt aIndex ) = 0; williamr@4: williamr@4: williamr@4: /** williamr@4: Change the configuration parameter with ordinal aIndex to the given values. williamr@4: The plugin interprets and validates the values. Depending on the type of williamr@4: parameter, the plugin may use the integer parameter aValue or the williamr@4: descriptor parameter aDescValue williamr@4: @param aIndex Parameter ordinal williamr@4: @param aValue Integer value williamr@4: @param aDescValue Descriptor value williamr@4: */ williamr@4: virtual void SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue ) = 0; williamr@4: williamr@4: williamr@4: // Writer interface williamr@4: williamr@4: /** williamr@4: Used to start the saving of data. williamr@4: @param aParam The interpretation of aParam is specific to the plugin. williamr@4: */ williamr@4: virtual void OpenL( const TDesC& aParam ) = 0; williamr@4: williamr@4: /** williamr@4: Used to start the saving of data. williamr@4: @param aParam The interpretation of aParam is specific to the plugin. williamr@4: */ williamr@4: virtual TInt Open( const TDesC& aParam ) = 0; williamr@4: williamr@4: williamr@4: /** williamr@4: End the data save operation. williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual void CloseL() = 0; williamr@4: williamr@4: /** williamr@4: End the data save operation. williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual TInt Close() = 0; williamr@4: williamr@4: /** williamr@4: Save data. williamr@4: @param aData TDesC8 with data to be saved. williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual void WriteL( const TDesC8& aData ) = 0; williamr@4: williamr@4: /** williamr@4: Save data. williamr@4: @param aData TDesC8 with data to be saved. williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual TInt Write( const TDesC8& aData ) = 0; williamr@4: williamr@4: /** williamr@4: Save data from a pointer given the data size. williamr@4: @param aData Pointer to data to be saved. williamr@4: @param aSize Length of data to be saved in bytes williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual void WriteL( TAny* aData, TUint aSize ) = 0; williamr@4: williamr@4: /** williamr@4: Save data from a pointer given the data size. williamr@4: @param aData Pointer to data to be saved. williamr@4: @param aSize Length of data to be saved in bytes williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual TInt Write( TAny* aData, TUint aSize ) = 0; williamr@4: williamr@4: /** williamr@4: Save aData at the specific position. williamr@4: @param aPos The interpretation of aPos is specific to the plugin. williamr@4: @param aData TDesC8 with data to be saved. williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual void WriteL( TInt aPos, const TDesC8& aData ) = 0; williamr@4: williamr@4: /** williamr@4: Save aData at the specific position. williamr@4: @param aPos The interpretation of aPos is specific to the plugin. williamr@4: @param aData TDesC8 with data to be saved. williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual TInt Write( TInt aPos, const TDesC8& aData ) = 0; williamr@4: williamr@4: /** williamr@4: Save aData at the specific position. williamr@4: @param aPos The interpretation of aPos is specific to the plugin. williamr@4: @param aData Pointer to data to be saved. williamr@4: @param aSize Length of data to be saved in bytes williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual void WriteL( TInt aPos, TAny* aData, TUint aSize ) = 0; williamr@4: williamr@4: /** williamr@4: Save aData at the specific position. williamr@4: @param aPos The interpretation of aPos is specific to the plugin. williamr@4: @param aData Pointer to data to be saved. williamr@4: @param aSize Length of data to be saved in bytes williamr@4: @pre Must have called Open or OpenL williamr@4: */ williamr@4: virtual TInt Write( TInt aPos, TAny* aData, TUint aSize ) = 0; williamr@4: williamr@4: //dtor williamr@4: public: williamr@4: virtual ~CCrashDataSave(); williamr@4: williamr@4: /** williamr@4: Writer plugin base configuration parameter identifiers. williamr@4: Identifiers for derived interfaces should start where this enum ends. williamr@4: */ williamr@4: enum TDataSaveParams williamr@4: { williamr@4: /** This parameter is a root identifier for core dumps. Its use depends on the williamr@4: writer plugin and potentially the formatters. For example for an email data save williamr@4: plugin this parameter could be an the email address. For a file writer it could be williamr@4: a file name or a directory path. */ williamr@4: ECoreFilePath, williamr@4: EDataSaveLastParam williamr@4: }; williamr@4: williamr@4: protected: williamr@4: williamr@4: /** Define the container for the plugin's configuration parameters */ williamr@4: typedef RPointerArray RConfigParameterList; williamr@4: williamr@4: /** williamr@4: List of COptionConfig configuration parameters implemented by the plugin. williamr@4: */ williamr@4: RConfigParameterList iConfigList; williamr@4: williamr@4: private: williamr@4: TUid iDtor_ID_Key; williamr@4: williamr@4: TUint32 iSpare1; williamr@4: TUint32 iSpare2; williamr@4: }; williamr@4: williamr@4: #include williamr@4: williamr@4: #endif