|
1 /* |
|
2 * Copyright (c) 2004-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 * See class description below |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __LANDMARKS_UTILS_H__ |
|
21 #define __LANDMARKS_UTILS_H__ |
|
22 |
|
23 /** |
|
24 * Coordinate data conversion utility methods |
|
25 */ |
|
26 class LandmarksUtils |
|
27 { |
|
28 public: |
|
29 |
|
30 /** Converts a float to a descriptor. |
|
31 * Handles the case when the float is NaN |
|
32 * @param aFloat the source float |
|
33 * @param aDes the target descriptor |
|
34 * @param aRealFormat Format used for real value conversion to text |
|
35 */ |
|
36 static void FloatToDes(TReal aFloat, TDes& aDes, TRealFormat aRealFormat); |
|
37 |
|
38 /** Converts a float lat/long to a descriptor. |
|
39 * Handles the case when the float is NaN |
|
40 * @param aFloat the source float |
|
41 * @param aDes the target descriptor |
|
42 */ |
|
43 static void LatLongToDes(TReal aFloat, TDes& aDes); |
|
44 |
|
45 /** Converts a latitude or longitude in float format |
|
46 * to a descriptor containing degrees, minutes and seconds. |
|
47 * |
|
48 * @param aLatLong the source float |
|
49 * @param aDes the target descriptor (degrees, minutes and seconds) |
|
50 */ |
|
51 static void LatLongFloatToDegMinSecDesL(TReal aLatLong, TDes& aDes); |
|
52 |
|
53 /** Panics the application due to some programming error |
|
54 * @param aReason The panic number or error code |
|
55 */ |
|
56 static void Panic(TInt aReason); |
|
57 |
|
58 /** Pops up error note for user with given text */ |
|
59 static void ErrorNoteL( const TDesC& aErrorText ); |
|
60 |
|
61 /** Pops up information note for user with given text */ |
|
62 static void InfoNoteL( const TDesC& aInfoText ); |
|
63 |
|
64 private: |
|
65 |
|
66 //! Internal struct for LatLongFloatToDegMinSecDesL |
|
67 struct SDegMinSec |
|
68 { |
|
69 //! degrees |
|
70 TInt32 iDegrees; |
|
71 //! minutes |
|
72 TInt32 iMinutes; |
|
73 //! seconds |
|
74 TReal iSeconds; |
|
75 }; |
|
76 }; |
|
77 |
|
78 #endif // __LANDMARKS_UTILS_H__ |
|
79 |
|
80 |