diff -r 000000000000 -r 094583676ce7 IMPSengine/enginc/impsmessageinterpreterapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IMPSengine/enginc/impsmessageinterpreterapi.h Thu Dec 17 08:41:52 2009 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* classes for IMPS encoder. +* +*/ + + +#ifndef MImpsMessageInterpreterApi_H +#define MImpsMessageInterpreterApi_H + +// FORWARD DECLARATIONS +class MImpsDataAccessor; +class CBufFlat; +class MImpsCSPSession; + +// CLASS DECLARATION + +/** +* Abstract Encoder class +*/ +class MImpsEncoder + { + + public: + + /** + * Method builds (wb)xml encoded message based on data + * included in class aImpsData + * @param aImpsData reference to MImpsDataAccessor class. + * @param aEncodeBuffer buffer to hold the encoded message, + */ + virtual void EncodeMessageL( + MImpsDataAccessor& aImpsData, + CBufFlat& aEncodeBuffer ) = 0; + + /** + * Destructor + */ + virtual void Destroy() = 0; + + /** + * MIME type supported + * @return MIME type + */ + virtual TPtrC8 MimeType() = 0; + + }; + +/** +* Abstract Decoder class +*/ +class MImpsDecoder + { + + public: // New functions + + /** + * Method decodes (wb)xml message to internal data structures and stores + * it in aImpsData + * @param aImpsData reference to MImpsDataAccessor class. + * @param pointer to aEncodeBuffer buffer to hold the encoded message + * Please note that the buffer ownership is taken. + * It is taken in such way that the aEncodeBuffer will point to + * NULL if the transfer was successful. + */ + virtual void DecodeMessageL( + MImpsDataAccessor& aImpsData, + HBufC8** aEncodeBuffer ) = 0; + + /** + * Method decodes (wb)xml message to internal data structures + * in asynchronous manner. The completion of the operation is signaled in + * MImpsCSPSession::TransportResponseParsedL() method. + * @param aEncodeBuffer buffer to hold the encoded message + * Please note that the buffer ownership is taken!!! + * @return operation ID + */ + virtual TInt DecodeMsgAsyncL( + HBufC8** aBuffer ) = 0; + + /** + * Method to cancel the asynchronous decoding + */ + virtual void CancelDecoding() = 0; + + /** + * Destructor + */ + virtual void Destroy() = 0; + + }; + +/** +* This creates the actual message decoder instance. +* This replaces dynamic DLL loading because of +* static loading is a little bit faster. +* @return a pointer to the actual C-class instance. +*/ +IMPORT_C GLDEF_C MImpsDecoder* NewDecoderL( MImpsCSPSession* aCallback ); + +/** +* This creates the actual message encoder instance. +* This replaces dynamic DLL loading because of +* static loading is a little bit faster. +* @return a pointer to the actual C-class instance +*/ +IMPORT_C GLDEF_C MImpsEncoder* NewEncoderL( ); + +#endif + +// End of File