|
1 /* |
|
2 * Copyright (c) 2005 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: Blid application utils class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BLIDUTILS_H |
|
20 #define BLIDUTILS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 // CLASS DECLARATION |
|
26 /** |
|
27 * BlidUtils application class. |
|
28 * Convert seconds to time string |
|
29 * Convert seconds to days |
|
30 * Formating distance string |
|
31 * Find BLID application bitmap file |
|
32 */ |
|
33 class BlidUtils |
|
34 { |
|
35 |
|
36 public: // new functions |
|
37 /** |
|
38 * Convert TReal to TInt |
|
39 * @param aSrc |
|
40 * @param aResult |
|
41 * @return error code |
|
42 */ |
|
43 static TInt TRealToTInt( const TReal aSrc, TInt& aResult ); |
|
44 |
|
45 /** |
|
46 * Convert seconds to time string |
|
47 * If the resulting length of text in this descriptor |
|
48 * exceeds its maximum length, then the function raises |
|
49 * a USER 11 panic. |
|
50 * @param aTimeString |
|
51 * @param aSeconds |
|
52 * @return error code |
|
53 */ |
|
54 static TInt FormatStringToTime( TDes& aTimeString, |
|
55 const TReal aSeconds ); |
|
56 |
|
57 /** |
|
58 * Convert seconds to days |
|
59 * @param aSrc Time in seconsds |
|
60 * @param aResult amount of days |
|
61 * @return error code |
|
62 */ |
|
63 static TInt SecondsToDays( const TReal aSrc, TInt& aResult ); |
|
64 |
|
65 /** |
|
66 * Formating distance string |
|
67 * If the resulting length of text in this descriptor |
|
68 * exceeds its maximum length, then the function raises |
|
69 * a USER 11 panic. |
|
70 * @param aDistanceString |
|
71 * @param aDistance |
|
72 */ |
|
73 static void DistanceFormat( TDes& aDistanceString, |
|
74 const TReal aDistance, |
|
75 TBool aIstobeDecimal = EFalse ); |
|
76 |
|
77 /** |
|
78 * Find BLID application bitmap file |
|
79 * @return full filename ( path + name ) |
|
80 */ |
|
81 static HBufC* GetBitmapFilenameLC(); |
|
82 |
|
83 /** |
|
84 * Convert seconds to time string |
|
85 * If the resulting length of text in this descriptor |
|
86 * exceeds its maximum length, then the function raises |
|
87 * a USER 11 panic. |
|
88 * @param aTimeString |
|
89 * @param aSeconds |
|
90 * @return error code |
|
91 */ |
|
92 static TInt FormatTimeToString( TDes& aTimeString, |
|
93 const TReal aSeconds ); |
|
94 |
|
95 |
|
96 }; |
|
97 |
|
98 #endif // BLIDUTILS_H |
|
99 |
|
100 // End of File |