|
1 /* |
|
2 * Copyright (c) 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 #ifndef SUITEOBJECTATTR_H |
|
20 #define SUITEOBJECTATTR_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * Menu Engine Object attribute. |
|
26 */ |
|
27 NONSHARABLE_CLASS( CSuiteObjectAttr ): public CBase |
|
28 { |
|
29 |
|
30 public: // construction |
|
31 |
|
32 /** |
|
33 * Destructor. |
|
34 */ |
|
35 virtual ~CSuiteObjectAttr(); |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * @param aName Name. |
|
40 * @return The created object. |
|
41 */ |
|
42 static CSuiteObjectAttr* NewL( const TDesC& aName ); |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * @param aName Name. |
|
47 * @return The created object. |
|
48 */ |
|
49 static CSuiteObjectAttr* NewLC( const TDesC& aName ); |
|
50 |
|
51 protected: // construction |
|
52 |
|
53 /** |
|
54 * Constructor |
|
55 */ |
|
56 CSuiteObjectAttr(); |
|
57 |
|
58 /** |
|
59 * 2nd phase constructor. |
|
60 * @param aName Name. |
|
61 */ |
|
62 void ConstructL( const TDesC& aName ); |
|
63 |
|
64 public: // new methods |
|
65 |
|
66 /** |
|
67 * Get name. |
|
68 * @return Name. |
|
69 */ |
|
70 TPtrC Name() const { return iName; } |
|
71 |
|
72 /** |
|
73 * Get value. |
|
74 * @return Value. |
|
75 */ |
|
76 TPtrC Value() const { return iValue; } |
|
77 |
|
78 /** |
|
79 * Set (or replace) value. |
|
80 * @param aValue Value. |
|
81 */ |
|
82 void SetValueL( const TDesC& aValue ); |
|
83 |
|
84 /** |
|
85 * Get localized status. |
|
86 * @return ETrue if localized. |
|
87 */ |
|
88 TBool Localized() const { return iLocalized; } |
|
89 |
|
90 /** |
|
91 * Set localized status. |
|
92 * @param aLocalized ETrue if localized. |
|
93 */ |
|
94 void SetLocalized( TBool aLocalized ) { iLocalized = aLocalized; } |
|
95 |
|
96 private: // data |
|
97 |
|
98 RBuf iName; ///< Name. Own. |
|
99 RBuf iValue; ///< Value. Own. |
|
100 TBool iLocalized; ///< Localized status. |
|
101 |
|
102 }; |
|
103 |
|
104 /** |
|
105 * Array of CSuiteObjectAttr-s. |
|
106 */ |
|
107 NONSHARABLE_CLASS( RSuiteAttrArray ) |
|
108 : public RPointerArray<CSuiteObjectAttr> |
|
109 { |
|
110 |
|
111 public: // new methods |
|
112 |
|
113 /** |
|
114 * Find attribute by name. |
|
115 * @param aName Name. |
|
116 * @return Index of attribute, or KErrNotFound. |
|
117 */ |
|
118 TInt Find( const TDesC& aName ) const; |
|
119 |
|
120 }; |
|
121 |
|
122 #endif // SUITEOBJECTATTR_H |