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