IMPSengine/messageencoder/wbxml/inc/ImpsWbxmlData.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2003 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:  Provides methods for CSP WBXML data handling
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CImpsWbXmlData_H
       
    20 #define CImpsWbXmlData_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "ImpsDataAccessorApi.h"
       
    25 #include "nw_wbxml_reader.h"
       
    26 #include "impscommonenums.h"
       
    27 
       
    28 // CONSTANTS
       
    29 const TInt KImpsWbXmlMaxLength50   = 50;
       
    30 const TInt KImpsWbXmlMaxLength100  = 100;
       
    31 const TInt KImpsWbXmlMaxLength200  = 200;
       
    32 const TInt KImpsWbXmlMaxLength400  = 400;
       
    33 const TInt KImpsWbXmlNoMaxLength   = 0;
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CImpsKey;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 class CImpsWbXmlData : public CBase
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         */
       
    47         static CImpsWbXmlData* NewL();
       
    48 
       
    49         /**
       
    50         * Destructor.
       
    51         */
       
    52         virtual ~CImpsWbXmlData();
       
    53 
       
    54     public: // New functions
       
    55 
       
    56 
       
    57         /**
       
    58         * access method for integer attribute token value
       
    59         * @param aToken WBXML token
       
    60         * @return attribute token value
       
    61         */
       
    62         TUint GetWbXmlAttributeTokenValue( TInt aToken, TImpsCspVersion aCspVersion );
       
    63 
       
    64         /**
       
    65         * access method for string attribute token value
       
    66         * @param aToken WBXML token
       
    67         * @return attribute token value
       
    68         */
       
    69         TPtrC8 GetWbXmlAttributeStringValue( TInt aToken, TImpsCspVersion aCspVersion );
       
    70 
       
    71         /**
       
    72         * method returns wbxml token value corresponding to
       
    73         * @param aToken WBXML token
       
    74         * @param aValue WBXML token value
       
    75         * @param aMaxLength possible max string length
       
    76         * @return wbxml token
       
    77         */
       
    78         TUint32 GetWbXmlElementValue( TInt aToken, TUint32 aValue, TInt& aMaxLength );
       
    79 
       
    80         /**
       
    81         * method returns wbxml token value corresponding to
       
    82         * given imps engine value and possible max string length
       
    83         * @param aToken WBXML token
       
    84         * @param aValue WBXML token value
       
    85         * @return wbxml token
       
    86         */
       
    87         TUint32 GetWbXmlElementValue( TInt aToken, TDesC*& aValue );
       
    88 
       
    89         /**
       
    90         * method returns wbxml string value corresponding to
       
    91         * given imps engine value
       
    92         * @param aToken WBXML token
       
    93         * @param aValue WBXML token value
       
    94         * @return wbxml value
       
    95         */
       
    96         TPtrC8 GetWbXmlStringValue( TInt aToken, TInt aValue );
       
    97 
       
    98         /**
       
    99         * method returns imps engine value coresponding to given
       
   100         * wbxml element value if exists
       
   101         * @param aToken WBXML token
       
   102         * @param aValue WBXML token value
       
   103         * @return imps engine value
       
   104         */
       
   105         TInt GetImpsEngineValue( TInt aToken, TInt aValue );
       
   106 
       
   107         /**
       
   108         * method returns imps engine value coresponding to given
       
   109         * string if exists
       
   110         * @param aToken WBXML token
       
   111         * @param aValue string value
       
   112         * @return imps engine value
       
   113         */
       
   114         TUint32 GetImpsEngineValue( TInt aToken, TPtrC8 aValue );
       
   115 
       
   116         /**
       
   117         * method returns possible string corresponding to given token
       
   118         * @param aToken WBXML token
       
   119         * @param aValue WBXML token value
       
   120         * @return imps engine value
       
   121         */
       
   122         TPtrC GetImpsEngineDescValue( TInt aToken, TInt aValue );
       
   123 
       
   124         /**
       
   125         * method returns possible string corresponding to given token
       
   126         * @param aToken WBXML token
       
   127         * @param aValue WBXML token value
       
   128         * @return imps engine value
       
   129         */
       
   130         TPtrC8 GetImpsEngineDesc8Value( TInt aToken, TInt aValue );
       
   131 
       
   132 
       
   133 //        const TDesC8& GetAttributeStringByToken(TInt aToken);
       
   134 
       
   135     private:
       
   136 
       
   137         /**
       
   138         * C++ default constructor.
       
   139         */
       
   140         CImpsWbXmlData();
       
   141 
       
   142         /**
       
   143         * By default constructor is private.
       
   144         */
       
   145         void ConstructL();
       
   146 
       
   147     };
       
   148 
       
   149 #endif      // ?INCLUDE_H   
       
   150 
       
   151 // End of File