|         |      1 // Copyright (c) 2006-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 "Eclipse Public License v1.0" | 
|         |      5 // which accompanies this distribution, and is available | 
|         |      6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". | 
|         |      7 // | 
|         |      8 // Initial Contributors: | 
|         |      9 // Nokia Corporation - initial contribution. | 
|         |     10 // | 
|         |     11 // Contributors: | 
|         |     12 // | 
|         |     13 // Description: | 
|         |     14 // Implementation of XOP serializer Output Stream | 
|         |     15 // | 
|         |     16  | 
|         |     17  | 
|         |     18  | 
|         |     19 /** | 
|         |     20  @file | 
|         |     21  @internalComponent | 
|         |     22  @released | 
|         |     23 */ | 
|         |     24 #ifndef XMLENGXOPPROXYOUTPUTSTREAM_H | 
|         |     25 #define XMLENGXOPPROXYOUTPUTSTREAM_H | 
|         |     26  | 
|         |     27 #include <f32file.h> | 
|         |     28 #include "xmlengxopoutputstream.h" | 
|         |     29  | 
|         |     30 /** | 
|         |     31  * TXmlEngSXOPOutputStream is used by XML Engine Serializer to  | 
|         |     32  * serialize XML data to client stream. | 
|         |     33  * | 
|         |     34  */ | 
|         |     35 class TXmlEngSXOPProxyOutputStream : public MXmlEngSXOPOutputStream | 
|         |     36 	{ | 
|         |     37 public: | 
|         |     38 	/** | 
|         |     39      * Default constructor | 
|         |     40      * | 
|         |     41      * @param aStream Instance of client stream | 
|         |     42      */ | 
|         |     43     TXmlEngSXOPProxyOutputStream(MXmlEngOutputStream& aStream); | 
|         |     44      | 
|         |     45     /** | 
|         |     46      * Callback for writing a buffer with data to output stream | 
|         |     47      * | 
|         |     48      * @return number of bytes written or -1 in case of error | 
|         |     49      */	 | 
|         |     50     TInt Write(const TDesC8& aBuffer); | 
|         |     51      | 
|         |     52     /** | 
|         |     53      * Callback for closing output stream | 
|         |     54      * | 
|         |     55      * @return KErrNone or other error code | 
|         |     56      */		 | 
|         |     57     TInt Close(); | 
|         |     58  | 
|         |     59     /** | 
|         |     60      * Callback for closing client output stream | 
|         |     61      * | 
|         |     62      * @return KErrNone or other error code | 
|         |     63      */		 | 
|         |     64     TInt CloseAll();     | 
|         |     65      | 
|         |     66     /** | 
|         |     67      * Checks error flag | 
|         |     68      * | 
|         |     69      * @return error code | 
|         |     70      */				 | 
|         |     71     TInt CheckError(); | 
|         |     72 			 | 
|         |     73 private: | 
|         |     74     /**  | 
|         |     75      * Client output stream | 
|         |     76      */ | 
|         |     77     MXmlEngOutputStream* iStream; | 
|         |     78      | 
|         |     79     /** Error flag **/ | 
|         |     80     TInt iError; | 
|         |     81 };  | 
|         |     82  | 
|         |     83  | 
|         |     84  | 
|         |     85 #endif /* XMLENGXOPPROXYOUTPUTSTREAM_H */   |