|
1 /* |
|
2 * Copyright (c) 2007-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_HNUTILS_H |
|
21 #define C_HNUTILS_H |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 class CHnMdLocalization; |
|
26 class CHnMdBaseKey; |
|
27 class CLiwGenericParamList; |
|
28 class TLiwVariant; |
|
29 class CHnSuiteModel; |
|
30 class TXmlEngElement; |
|
31 |
|
32 |
|
33 /** |
|
34 * Utils |
|
35 * |
|
36 * Utility class. |
|
37 * |
|
38 * @lib hnmetadatamodel |
|
39 * @since S60 3.0 |
|
40 * @ingroup group_hnmetadatamodel |
|
41 */ |
|
42 NONSHARABLE_CLASS( HnUtils ) |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Read file. |
|
48 * |
|
49 * @since S60 v3.0 |
|
50 * @param aPath Path to a file. |
|
51 * @return Buffer. |
|
52 */ |
|
53 IMPORT_C static HBufC8* ReadFileLC(const TDesC& aPath); |
|
54 |
|
55 /** |
|
56 * Read file. |
|
57 * |
|
58 * @since S60 v3.0 |
|
59 * @param aPath Path to a file. |
|
60 * @return Buffer. |
|
61 */ |
|
62 IMPORT_C static HBufC8* ReadFileL(const TDesC& aPath); |
|
63 |
|
64 /** |
|
65 * Locates file. |
|
66 * |
|
67 * @since S60 v3.0 |
|
68 * @param aFile File name. |
|
69 * @return File path. |
|
70 */ |
|
71 IMPORT_C static HBufC* LocateFileLC( const TDesC& aFile ); |
|
72 |
|
73 /** |
|
74 * Locates nearest Language file. |
|
75 * |
|
76 * @since S60 v3.0 |
|
77 * @param aFile File name. |
|
78 * @return File path. |
|
79 */ |
|
80 IMPORT_C static HBufC* LocateNearestLanguageFileLC( const TDesC& aFile ); |
|
81 |
|
82 |
|
83 |
|
84 /** |
|
85 * Sets given descriptor using xml element textual value. |
|
86 * |
|
87 * @since S60 v5.0 |
|
88 * @param aElement Xml element. |
|
89 * @param aAttribute Descriptor to be set using aElement. |
|
90 */ |
|
91 IMPORT_C static void SetAttributeL( const TXmlEngElement& aElement, |
|
92 RBuf8& aAttribute ); |
|
93 |
|
94 /** |
|
95 * Sets given descriptor using xml attribute. |
|
96 * |
|
97 * @since S60 v5.0 |
|
98 * @param aElement Xml element from which the attribute will be retrieved |
|
99 * by aAttributeName. |
|
100 * @param aAttributeName The name of the attribute to be read from |
|
101 * aElement. |
|
102 * @param aAttribute A descriptor to be set using a value of the attribute |
|
103 * from aElement. |
|
104 */ |
|
105 IMPORT_C static void SetAttributeL( const TXmlEngElement& aElement, |
|
106 const TDesC8& aAttributeName, RBuf8& aAttribute ); |
|
107 |
|
108 /** |
|
109 * Fetches given columns string. |
|
110 * |
|
111 * @since S60 v5.0 |
|
112 * @param aColumn Which column to fetch. |
|
113 * @param aSourceText Source texts. |
|
114 * @param aColumnSeparator Character that separates columns. |
|
115 */ |
|
116 IMPORT_C static HBufC8 * GetColumnTextLC(TInt aColumn, const TDesC8 & aSourceText, |
|
117 TChar aColumnSeparator = TChar('|')); |
|
118 |
|
119 /** |
|
120 * Fetches number of columns. |
|
121 * |
|
122 * @since S60 v5.0 |
|
123 * @param aSourceText Source texts. |
|
124 * @param aColumnSeparator Character that separates columns. |
|
125 */ |
|
126 IMPORT_C static TInt GetColumnTextColumnCount(const TDesC8 & aSourceText, |
|
127 TChar aColumnSeparator = TChar('|')); |
|
128 |
|
129 private: |
|
130 }; |
|
131 |
|
132 #endif // C_HNUTILS_H |
|
133 |