inc/wvsettings.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     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 *			 WirelessVillage OTA settings parser.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CWVSettings_H
       
    21 #define CWVSettings_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <xmlelemt.h>
       
    26 #include <cnode.h>
       
    27 
       
    28 class CWVSettingsParser :public CBase 
       
    29     {
       
    30     public:  // Constructors and destructor
       
    31 		
       
    32    		/**
       
    33         * Two-phased constructor.
       
    34         */
       
    35         IMPORT_C static CWVSettingsParser* NewL ();
       
    36         /**
       
    37         * Destructor
       
    38         */
       
    39 		virtual ~CWVSettingsParser();
       
    40 
       
    41     public: // New functions
       
    42 
       
    43 		/**
       
    44         * Parses the data
       
    45         * @param aDataBuffer contains the data 
       
    46 		* @return EFalse, if mandatory value is missing, otherwise ETrue
       
    47         */
       
    48 		IMPORT_C TBool ParseL(TDesC8& aDataBuffer);	
       
    49 		/**
       
    50         * Accessor to the root element (WVSettings)
       
    51         * @return CXmlElement*, pointer to the root element 
       
    52         */
       
    53 		IMPORT_C CXmlElement* Root ();	
       
    54 		/**
       
    55         * Parses the data, sets values to the internal data structure
       
    56         * @param aDataPtr pointer to the data 
       
    57         */
       
    58 		void DoParseL(TDesC8& aDataBuffer);
       
    59 		/**
       
    60         * Read element, sets values to the internal data structure
       
    61         * @param aDataPtr pointer to the data 
       
    62 		* @return number of parsed bytes 
       
    63         */
       
    64 		TInt ReadElementWithContentL(TUint8* ptr, HBufC* aDataBuffer);
       
    65 		/**
       
    66         * Read empty element
       
    67         * @param aDataPtr pointer to the data 
       
    68 		* @return number of parsed bytes 
       
    69         */
       
    70 		TInt ReadEmptyElement(TUint8* aDataPtr, HBufC* aDataBuffer);
       
    71 		/**
       
    72         * Parses the data, sets values to the internal data structure
       
    73         * @param aDataPtr pointer to the data 
       
    74 		* @return number of parsed bytes 
       
    75         */
       
    76 		TInt ReadSupportedVersionsL(TUint8* aDataPtr);
       
    77 		/**
       
    78         * Creates xml tree
       
    79         */
       
    80 		void CreateXmlElementTreeL ();
       
    81 		/**
       
    82         * Validates the data
       
    83         * @return EFalse, if mandatory value is missing, otherwise ETrue
       
    84         */
       
    85 		TBool Validate ();
       
    86 
       
    87     private:
       
    88 		/**
       
    89         * C++ default constructor.
       
    90         */
       
    91 		CWVSettingsParser();
       
    92 		/**
       
    93         * Actual construction.
       
    94         */
       
    95 		void ConstructL ();
       
    96 
       
    97     private:    // Data
       
    98 		
       
    99 		TInt iDatabufferSize;
       
   100 		TInt iParsedBytes;
       
   101 		CXmlElement* iRootElement;
       
   102 		HBufC* iWVOTAVersion;
       
   103 		HBufC* iWVPassword;
       
   104 		HBufC* iWVPreferredProtocol;
       
   105 		HBufC* iWVProxyAddress;
       
   106 		HBufC* iWVProxyPort;
       
   107 		HBufC* iWVProxyUser;
       
   108 		HBufC* iWVProxyPassword;
       
   109 		HBufC* iWVRefName;
       
   110 		HBufC* iWVSAPFourWaySupported1;
       
   111 		HBufC* iWVSAPFourWaySupported2;
       
   112 		HBufC* iWVSAPMobileNumber;
       
   113 		HBufC* iWVSAPURI;
       
   114 		HBufC* iWVSettingsName;
       
   115 		HBufC* iWVSMSCMobileNumber;
       
   116 		HBufC* iWVUserID;	
       
   117 		CArrayPtrFlat<HBufC>* iWVSupportedVersions;
       
   118 		TBool iListEmpty;
       
   119 		// these are used for validating
       
   120 		// and xml tree creation
       
   121 		TBool iOTAVersion;
       
   122 		TBool iPassword;
       
   123 		TBool iPreferredProtocol;
       
   124 		TBool iProxyAddress;
       
   125 		TBool iProxyPort;
       
   126 		TBool iProxyUser;
       
   127 		TBool iProxyPassword;
       
   128 		TBool iRefName;
       
   129 		TBool iSAP4WaySupportedSms;
       
   130 		TBool iSAP4WaySupportedHttp;
       
   131 		TBool iSAPMobileNumber;
       
   132 		TBool iSAPURI;
       
   133 		TBool iSettingsName;
       
   134 		TBool iSMSCMobileNumber;
       
   135 		TBool iUserID;	
       
   136 		TBool iSupportedVersions;
       
   137 		TBool iCommon;
       
   138 		TBool iSms;
       
   139 		TBool iHttp;
       
   140 		TBool iProxy;
       
   141     };
       
   142 
       
   143 #endif     
       
   144             
       
   145 // End of File