meetingrequest/mrurlparserplugin/inc/cesmrurlparserpluginimpl.h
branchRCL_3
changeset 64 3533d4323edc
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2008-2008 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:  Parser class for parsing landmarks to url and vice versa
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CESMRURLPARSERPLUGINIMPL_H
       
    19 #define CESMRURLPARSERPLUGINIMPL_H
       
    20 
       
    21 #include "cesmrurlparserplugin.h"
       
    22 
       
    23 class CPosLandmark;
       
    24 class CPosLandmarkParser;
       
    25 class CPosLandmarkEncoder;
       
    26 class CMRUrlParserExtension;
       
    27 
       
    28 
       
    29 /**
       
    30  *  Parser class for parsing URL to landmark and vice versa
       
    31  *
       
    32  */
       
    33 class CESMRUrlParserPluginImpl : public CESMRUrlParserPlugin
       
    34     {
       
    35 
       
    36 public:
       
    37 
       
    38     static CESMRUrlParserPluginImpl* NewL();
       
    39     static CESMRUrlParserPluginImpl* NewLC();
       
    40 
       
    41 
       
    42    /**
       
    43     * Destructor.
       
    44     */
       
    45     virtual ~CESMRUrlParserPluginImpl();
       
    46 
       
    47     /**
       
    48      * Finds location URL from given text input
       
    49      *
       
    50      * @param aText text where URL is searched from
       
    51      * @param aUrl points to founded URL after execution
       
    52      * @return URL start position in aText,
       
    53      *         if not found returns KErrNotFound/KErrArgument or other
       
    54      *         unexpected Symbian wide errorcode
       
    55      */
       
    56     TInt FindLocationUrl( const TDesC& aText, TPtrC& aUrl );
       
    57 
       
    58     /**
       
    59      * Creates location URL from landmark object
       
    60      * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode
       
    61      *
       
    62      * @param aLandmark contains landmark object that is parsed to location URL
       
    63      * @return pointer to created location URL, caller takes ownership
       
    64      */
       
    65     HBufC* CreateUrlFromLandmarkL( const CPosLandmark& aLandmark );
       
    66 
       
    67     /**
       
    68      * Creates landmark object from location URL
       
    69      * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode
       
    70      *
       
    71      * @param aUrl contains location URL from which landmark is created
       
    72      * @return pointer to created landmark object, caller takes ownership
       
    73      */
       
    74     CPosLandmark* CreateLandmarkFromUrlL( const TDesC& aUrl );
       
    75 
       
    76     /**
       
    77      * Converts valid location URL to vCal GEO value.
       
    78      * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode
       
    79      *
       
    80      * @param aUrl location URL to convert
       
    81      * @return new GEO value
       
    82      */
       
    83     CCalGeoValue* CreateGeoValueLC( const TDesC& aUrl );
       
    84 
       
    85 private:
       
    86 
       
    87     CESMRUrlParserPluginImpl();
       
    88 
       
    89     CPosLandmarkParser& InitializeParserL();
       
    90     
       
    91     CPosLandmarkEncoder& InitializeEncoderL();
       
    92     
       
    93     void DoFindLocationUrlL( const TDesC& aText,
       
    94                              TInt& aPos,
       
    95                              TPtrC& aUrl );
       
    96     
       
    97     CMRUrlParserExtension& ExtensionL();
       
    98     
       
    99     CPosLandmark* CreateLandmarkFromUrlInternalL( const TDesC& aUrl );
       
   100 
       
   101 private: // data
       
   102 
       
   103     /**
       
   104      *  Landmark parser. Own.
       
   105      */
       
   106     CPosLandmarkParser* iParser;
       
   107     
       
   108     /**
       
   109      * Landmark encoder. Own.
       
   110      */
       
   111     CPosLandmarkEncoder* iEncoder;
       
   112     
       
   113     /**
       
   114      * Parser extension. Own.
       
   115      */
       
   116     CMRUrlParserExtension* iExtension;
       
   117     };
       
   118 
       
   119 
       
   120 #endif //   CESMRURLPARSERPLUGINIMPL_H