localconnectivityservice/obexreceiveservices/bip/inc/BIPXMLWriter.h
branchRCL_3
changeset 39 4096754ee773
parent 38 3dcb815346df
child 40 52a167391590
equal deleted inserted replaced
38:3dcb815346df 39:4096754ee773
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  XML writer class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _BIPXMLWRITER_H
       
    20 #define _BIPXMLWRITER_H
       
    21 
       
    22 //INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 #include <obexutilsuilayer.h>
       
    26 #include "debug.h"
       
    27 
       
    28 // CONSTANTS
       
    29 enum TElementType
       
    30     {
       
    31     EImageFormats,
       
    32     EPreferredFormat,
       
    33     EAttachmentFormats,
       
    34     EFilteringParameters,
       
    35     EDPOFOptions
       
    36     };
       
    37 
       
    38 enum TAttributeType
       
    39     {
       
    40     EEncoding,
       
    41     EPixel,
       
    42     ETransformation,
       
    43     EMaxSize
       
    44     };
       
    45 
       
    46 // CLASS DECLARATION
       
    47 
       
    48 /**
       
    49 * XML writer for BIP capability object
       
    50 *
       
    51 */
       
    52 NONSHARABLE_CLASS (CBIPXmlWriter) : public CBase
       
    53     {
       
    54     public: //Constructors and destructors
       
    55 
       
    56         /**
       
    57         * Two-phased constructor.
       
    58         */
       
    59         static CBIPXmlWriter* NewL();
       
    60         
       
    61         /**
       
    62         * Destructor.
       
    63         */
       
    64         virtual ~CBIPXmlWriter();
       
    65 
       
    66     public:     //New Functions               
       
    67 
       
    68 		/**
       
    69         * Open temporary file
       
    70         * @param    TFileName       Contains the new temp file name.
       
    71         * @return                   None.
       
    72         */
       
    73         void OpenXmlDocumentL( TFileName& aFileName);
       
    74     
       
    75 		/**
       
    76         * Close temporary file. So that it can be used by clients
       
    77         * @param                    None.
       
    78         * @return                   None.
       
    79         */
       
    80         void CloseXmlDocumentL();
       
    81     
       
    82 		/**
       
    83         * Opens xml element for writing
       
    84         * @param    TElementType    Element to be written to file
       
    85         * @return                   None.
       
    86         */
       
    87         void OpenXmlElementL( TElementType aElement );
       
    88 
       
    89 		/**
       
    90         * Close xml element 
       
    91         * @param                    None
       
    92         * @return                   None.
       
    93         */
       
    94         void CloseXmlElementL( );
       
    95 
       
    96 		/**
       
    97         * Add xml attribute to the open element
       
    98         * @param    TAttributeType  Type of the attribute
       
    99         * @param    TDesC8          Attribute
       
   100         * @return                   None.
       
   101         */
       
   102         void AddXmlAttributeL( TAttributeType aAttributeType, TDesC8& aAttr );
       
   103 
       
   104     private:
       
   105 
       
   106         /**
       
   107         * C++ default constructor.
       
   108         */
       
   109         CBIPXmlWriter();
       
   110 
       
   111         /**
       
   112         * Symbian 2nd phase constructor.
       
   113         */
       
   114         void ConstructL();
       
   115 
       
   116     private:    // Data
       
   117         
       
   118         RFile       ifile;
       
   119         RFs         iFileSession;
       
   120         TFileName   iFileName;
       
   121     };
       
   122 
       
   123 #endif      //_BIPXMLWRITER_H
       
   124 
       
   125 // End of File