messagingappbase/smartmessaging/wmlbc/inc/WmlFieldParser.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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:  
       
    15 *     This class is used to parse fields to wml control from array, 
       
    16 *     which is created by Wap Parser (wapp.dll).
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef CWMLFIELDPARSER_H
       
    23 #define CWMLFIELDPARSER_H
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include "WMLBC.hrh"
       
    28 #include <e32base.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 
       
    32 class CParsedField;
       
    33 class CWmlSubItemBase;
       
    34 class CWmlBMSubItem;
       
    35 enum TWappParserFields;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 * This class is used to parse fields to wml control from array, 
       
    41 * which is created by Wap Parser (wapp.dll).
       
    42 */
       
    43 NONSHARABLE_CLASS( CWmlFieldParser ) : public CBase
       
    44     {
       
    45 
       
    46     public:  // construction
       
    47         
       
    48         /**
       
    49         * Constuctor
       
    50         */
       
    51         CWmlFieldParser();
       
    52 
       
    53         /**
       
    54         * Destructor
       
    55         */        
       
    56         ~CWmlFieldParser();
       
    57 
       
    58     public: // new
       
    59        
       
    60         /**
       
    61         * Parses field from an array in WAP parser (wapp.dll) format into 
       
    62         * WML Bio Control's own internal format. Pushes the created array
       
    63         * into cleanup stack.
       
    64         * @param aParsedFieldArray reference to the parsed fields array, 
       
    65         * @param aWapArray reference to array where Wap AP items are pushed.
       
    66         * @param aMMSArray reference to array where MMS setting items are pushed.
       
    67         * @param aBMArray reference to array where Bookmark items are pushed.
       
    68         */  
       
    69         void ParseFieldsL( const CArrayPtrSeg<CParsedField>& aParsedFieldArray,
       
    70             CArrayPtrSeg<CWmlSubItemBase>& aBMArray);
       
    71 
       
    72     private: // internal member functions
       
    73         
       
    74         /**
       
    75         * Compare aFieldName with all enumerated parsed fields
       
    76         * @param aFieldName name from parser 
       
    77         * @return TWappParserFields correct enum
       
    78         */ 
       
    79         TWappParserFields CompareField( TPtrC aFieldName );
       
    80 
       
    81         /**
       
    82         * Checks if the field pair is characteric type. 
       
    83         * @param aFieldName name from parser 
       
    84         * @param aFieldValue value from parser 
       
    85         * @param aEnumField correct enum, which is updated.
       
    86         * @return ETrue if this is characteristic type, EFalse otherwise.
       
    87         */ 
       
    88         TBool IsCharacteristicTypeL( TPtrC aFieldName, 
       
    89             TPtrC aFieldValue, 
       
    90             TInt& aEnumField );
       
    91 
       
    92         /**
       
    93         * Add current bookmark item to the array.
       
    94         * The member iBm is added to the array and
       
    95         * validity checking is also performed for it.
       
    96         * Member iBm is nulled in this method.
       
    97         */
       
    98         void AddCurrentBMToArrayL();
       
    99 
       
   100     private: // data
       
   101 
       
   102         /// Bookmark item to be added in subItemArray.
       
   103         CWmlBMSubItem *iBm;
       
   104 
       
   105         /// Array containing WAP AP items. Not owned.
       
   106         CArrayPtrSeg<CWmlSubItemBase>* iBMArray;
       
   107 
       
   108         /// Indicates current character type when parsing fields.
       
   109         TInt iCurrentCharacteristicType;
       
   110     };
       
   111 
       
   112 #endif // CWMLFIELDPARSER_H
       
   113 
       
   114 // End of file