voipplugins/dhcppositionprovider/inc/dhcplocationinformationparser.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DHCPLOCATIONINFORMATIONPARSER_H
       
    20 #define DHCPLOCATIONINFORMATIONPARSER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 /**
       
    25  *  Parses location information from DHCP message to LCI
       
    26  *
       
    27  *  @lib sspcontroller
       
    28  *  @since S60 3,0
       
    29  */
       
    30 class TDhcpLocationInformationParser
       
    31     {
       
    32     public:
       
    33 
       
    34         /** Location information parsing type */
       
    35         enum TParsingType
       
    36             {
       
    37             EDHCPCoordinates,
       
    38             EDHCPCivicAddress
       
    39             };
       
    40 
       
    41     public:
       
    42 
       
    43         /**
       
    44          * Constructor
       
    45         */
       
    46         TDhcpLocationInformationParser();
       
    47 
       
    48         /**
       
    49          * Parses location information
       
    50          *
       
    51          * @since S60 3.2
       
    52          * @param aInput Input data
       
    53          * @param aParsingType Parsing type
       
    54          * @param aOutput Result
       
    55          * @return None
       
    56          */
       
    57         void ParseLocationInformation( const TDesC8& aInput,
       
    58                 const TParsingType aParsingType, TDes8& aOutput );
       
    59 
       
    60     private:
       
    61 
       
    62         /**
       
    63          * Parses coordinate parameters from the input data
       
    64          *
       
    65          * @since S60 3.2
       
    66          * @param aInput Input data
       
    67          * @param aOutput Result
       
    68          * @return None
       
    69          */
       
    70         void ParseLCI( const TDesC8& aInput, TDes8& aOutput );
       
    71 
       
    72         /**
       
    73          * Parses datum from the input data
       
    74          *
       
    75          * @since S60 3.2
       
    76          * @param aInput Input data
       
    77          * @param aOutput Result
       
    78          * @return Error code
       
    79          */
       
    80         TInt ParseDatum(const TDesC8& aInput, TDes8& aOutput );
       
    81 
       
    82         /**
       
    83          * Parses the input to the DMS coordinate form
       
    84          *
       
    85          * @since S60 3.2
       
    86          * @param aIsLatitude latitude if ETrue, otherwise longitude
       
    87          * @param aResolution Resolution, i.e. the amount of significant bits
       
    88          * @param aInteger Integer part of coordinate, or degree
       
    89          * @param aFraction Fraction part of coordinate
       
    90          * @param aOutput Result
       
    91          * @return None
       
    92          */
       
    93         void ParseDMS(TBool aIsLatitude, TUint8 aResolution,
       
    94             TUint16 aInteger, TUint32 aFraction, TDes8& aOutput  );
       
    95 
       
    96         /**
       
    97          * Parses the civic address elements into the XML description
       
    98          *
       
    99          * @since S60 3.2
       
   100          * @param aInput Input data
       
   101          * @param aOutput Result
       
   102          * @return None
       
   103          */
       
   104         void ParseCivicAddressElements( const TDesC8& aInput, TDes8& aOutput );
       
   105 
       
   106         /**
       
   107          * Extract a single civic address element from the input
       
   108          *
       
   109          * @since S60 3.2
       
   110          * @param aInput Input data
       
   111          * @param aOutput Result
       
   112          * @return None
       
   113          */
       
   114         void ExtractCivicAddressElement( TLex8& aInput, TDes8& aOutput );
       
   115 
       
   116         /**
       
   117          * Parses the timestamp
       
   118          *
       
   119          * @since S60 3.2
       
   120          * @param aTimeStamp Resulting timestamp
       
   121          * @return None
       
   122          */
       
   123         void ParseTimeStamp( TDes8& aTimeStamp );
       
   124 
       
   125         /**
       
   126          * Parses the retenrion-expiry
       
   127          *
       
   128          * @since S60 3.2
       
   129          * @param aTimeStamp Resulting timestamp
       
   130          * @return None
       
   131          */
       
   132         void ParseRetentionExpiry( TDes8& aTimeStamp );
       
   133 
       
   134     private: // data
       
   135 
       
   136         /**
       
   137          * Timestamp
       
   138          */
       
   139         TTime iTimeStamp;
       
   140 
       
   141     };
       
   142 
       
   143 #endif // DHCPLOCATIONINFORMATIONPARSER_H