|
1 /* |
|
2 * Copyright (c) 2009 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 #ifndef __MENUENGFLAGS_H__ |
|
19 #define __MENUENGFLAGS_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 /** |
|
24 * Conversion between string and integer representations of "flags" attribute. |
|
25 */ |
|
26 NONSHARABLE_CLASS( MenuEngFlags ) |
|
27 { |
|
28 |
|
29 public: // new methods |
|
30 |
|
31 /** |
|
32 * Convert string value to integer. |
|
33 * @param aStringValue String value. |
|
34 * @return Integer value. |
|
35 */ |
|
36 static TUint32 AsInt( const TDesC& aStringValue ); |
|
37 |
|
38 /** |
|
39 * Convert integer value to string. |
|
40 * @param Integer value. |
|
41 * @param aStringValue Buffer receiving string value. |
|
42 */ |
|
43 static void AsString( TUint32 aIntValue, TDes& aStringValue ); |
|
44 |
|
45 private: // new methods |
|
46 |
|
47 /** |
|
48 * Lookup flag name and get flag value. |
|
49 * @param aString String token. |
|
50 * @return Flag bit. |
|
51 */ |
|
52 static TUint32 FlagValue( const TDesC& aString ); |
|
53 |
|
54 /** |
|
55 * Lookup flag bit and get token value. |
|
56 * @param aFlag Flag bit. |
|
57 * @return String token. |
|
58 */ |
|
59 static TPtrC StringValue( TUint32 aFlag ); |
|
60 |
|
61 }; |
|
62 |
|
63 /** |
|
64 * Conversion between string and integer representations of "id" attribute. |
|
65 */ |
|
66 NONSHARABLE_CLASS( MenuEngId ) |
|
67 { |
|
68 |
|
69 public: // new methods |
|
70 |
|
71 /** |
|
72 * Convert string value to integer. |
|
73 * @param aStringValue String value. |
|
74 * @return Integer value. |
|
75 */ |
|
76 static TInt AsInt( const TDesC& aStringValue ); |
|
77 |
|
78 /** |
|
79 * Convert integer value to string. |
|
80 * @param Integer value. |
|
81 * @param aStringValue Buffer receiving string value. |
|
82 */ |
|
83 static void AsString( TInt aIntValue, TDes& aStringValue ); |
|
84 |
|
85 }; |
|
86 |
|
87 #endif // __MENUENGFLAGS_H__ |