1 /* |
1 /* |
2 * Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
16 */ |
16 */ |
17 |
17 |
18 #ifndef CESMRURLPARSERPLUGINIMPL_H |
18 #ifndef CESMRURLPARSERPLUGINIMPL_H |
19 #define CESMRURLPARSERPLUGINIMPL_H |
19 #define CESMRURLPARSERPLUGINIMPL_H |
20 |
20 |
21 |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> // RFs |
|
25 #include <barsc.h> // RResourceFile |
|
26 #include <barsread.h> // TResourceReader |
|
27 |
|
28 #include "cesmrurlparserplugin.h" |
21 #include "cesmrurlparserplugin.h" |
29 |
22 |
30 class CPosLandmark; |
23 class CPosLandmark; |
|
24 class CPosLandmarkParser; |
|
25 class CPosLandmarkEncoder; |
|
26 class CMRUrlParserExtension; |
31 |
27 |
32 |
28 |
33 /** |
29 /** |
34 * Parser class for parsing URL to landmark and vice versa |
30 * Parser class for parsing URL to landmark and vice versa |
35 * |
31 * |
36 */ |
32 */ |
37 class CESMRUrlParserPluginImpl : public CESMRUrlParserPlugin |
33 class CESMRUrlParserPluginImpl : public CESMRUrlParserPlugin |
38 { |
34 { |
39 |
35 |
40 public: |
36 public: |
65 * |
61 * |
66 * @param aLandmark contains landmark object that is parsed to location URL |
62 * @param aLandmark contains landmark object that is parsed to location URL |
67 * @return pointer to created location URL, caller takes ownership |
63 * @return pointer to created location URL, caller takes ownership |
68 */ |
64 */ |
69 HBufC* CreateUrlFromLandmarkL( const CPosLandmark& aLandmark ); |
65 HBufC* CreateUrlFromLandmarkL( const CPosLandmark& aLandmark ); |
70 |
66 |
71 /** |
67 /** |
72 * Creates landmark object from location URL |
68 * Creates landmark object from location URL |
73 * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode |
69 * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode |
74 * |
70 * |
75 * @param aUrl contains location URL from which landmark is created |
71 * @param aUrl contains location URL from which landmark is created |
76 * @return pointer to created landmark object, caller takes ownership |
72 * @return pointer to created landmark object, caller takes ownership |
77 */ |
73 */ |
78 CPosLandmark* CreateLandmarkFromUrlL( const TDesC& aUrl ); |
74 CPosLandmark* CreateLandmarkFromUrlL( const TDesC& aUrl ); |
79 |
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 |
80 private: |
85 private: |
81 |
86 |
82 CESMRUrlParserPluginImpl(); |
87 CESMRUrlParserPluginImpl(); |
83 |
88 |
84 void ConstructL(); |
89 CPosLandmarkParser& InitializeParserL(); |
85 |
90 |
86 TInt DoFindLocationUrlL( const TDesC& aText, |
91 CPosLandmarkEncoder& InitializeEncoderL(); |
|
92 |
|
93 void DoFindLocationUrlL( const TDesC& aText, |
|
94 TInt& aPos, |
87 TPtrC& aUrl ); |
95 TPtrC& aUrl ); |
88 |
96 |
89 TInt LocateResourceFile( |
97 CMRUrlParserExtension& ExtensionL(); |
90 const TDesC& aResource, |
|
91 const TDesC& aPath, |
|
92 TFileName &aResourceFile, |
|
93 RFs* aFs ); |
|
94 |
98 |
95 void InitializeL(); |
99 CPosLandmark* CreateLandmarkFromUrlInternalL( const TDesC& aUrl ); |
96 |
100 |
97 HBufC* ReadResourceStringLC( TInt aResourceId ); |
|
98 |
|
99 void CheckCoordinateParamL( const TDesC& aParam ); |
|
100 |
|
101 void GetCoordinateParamValuesL( const TDesC& aUrl, TPtrC& aLatitude, |
|
102 TPtrC& aLongitude ); |
|
103 private: // data |
101 private: // data |
104 |
102 |
105 /** |
103 /** |
106 * Tells if this instance is yet initialized |
104 * Landmark parser. Own. |
107 */ |
105 */ |
108 TBool iIsInitialized; |
106 CPosLandmarkParser* iParser; |
109 |
107 |
110 /** |
108 /** |
111 * File server session |
109 * Landmark encoder. Own. |
112 */ |
110 */ |
113 RFs iFs; |
111 CPosLandmarkEncoder* iEncoder; |
114 |
112 |
115 /** |
113 /** |
116 * Resource file |
114 * Parser extension. Own. |
117 */ |
115 */ |
118 RResourceFile iFile; |
116 CMRUrlParserExtension* iExtension; |
119 |
|
120 /** |
|
121 * Resource file reader |
|
122 */ |
|
123 TResourceReader iReader; |
|
124 }; |
117 }; |
125 |
118 |
126 |
119 |
127 #endif // CESMRURLPARSERPLUGINIMPL_H |
120 #endif // CESMRURLPARSERPLUGINIMPL_H |