|
1 /* |
|
2 * Copyright (c) 2004 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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 #ifndef SEN_ATTRIBUTE_H |
|
27 #define SEN_ATTRIBUTE_H |
|
28 |
|
29 #include <e32base.h> |
|
30 |
|
31 typedef RPointerArray<HBufC8> RAttrValueArray; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * ?one_line_short_description. |
|
38 * ?other_description_lines |
|
39 * |
|
40 * @lib SenUtils.lib |
|
41 * @since Series60 3.0 |
|
42 */ |
|
43 class CSenAttribute : public CBase |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * Basic constructor. |
|
49 * @since Series60 3.0 |
|
50 * @param aName the name of the attribute |
|
51 * @param aType the type of the attribute |
|
52 * @param aValue the value of the attribute |
|
53 */ |
|
54 IMPORT_C static CSenAttribute* NewL(const TDesC8& aName, |
|
55 const TDesC8& aType, |
|
56 const TDesC8& aValue); |
|
57 /** |
|
58 * Basic constructor. |
|
59 * @since Series60 3.0 |
|
60 * @param aName the name of the attribute |
|
61 * @param aType the type of the attribute |
|
62 * @param aValue the value of the attribute |
|
63 * @param aFriendlyName if the name is not descriptive, the friendly name |
|
64 * can be used to give morehuman-readble information |
|
65 */ |
|
66 IMPORT_C static CSenAttribute* NewL(const TDesC8& aName, |
|
67 const TDesC8& aType, |
|
68 const TDesC8& aValue, |
|
69 const TDesC8& aFriendlyName); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 */ |
|
74 IMPORT_C virtual ~CSenAttribute(); |
|
75 |
|
76 public: // New functions |
|
77 /** |
|
78 * Returns the attribute value as string. |
|
79 * If attribute is multi-valued, the first value added will be returned. |
|
80 * @since Series60 3.0 |
|
81 * @return ?description |
|
82 */ |
|
83 IMPORT_C TPtrC8 Value() const; |
|
84 |
|
85 /** |
|
86 * Returns the attribute name as string |
|
87 * @since Series60 3.0 |
|
88 * @return ?description |
|
89 */ |
|
90 IMPORT_C TPtrC8 Name() const; |
|
91 |
|
92 /** |
|
93 * Returns the actor string |
|
94 * @since Series60 3.0 |
|
95 * @return ?description |
|
96 */ |
|
97 IMPORT_C TPtrC8 Type() const; |
|
98 |
|
99 /** |
|
100 * Returns the friendly name |
|
101 * @since Series60 3.0 |
|
102 * @return the firendly name for the attribute |
|
103 */ |
|
104 IMPORT_C TPtrC8 FriendlyName() const; |
|
105 |
|
106 /** |
|
107 * Sets the value of the attribute, separately from instantiation. |
|
108 * Replaces existing value(s), if present. |
|
109 * @since Series60 3.0 |
|
110 * @return void |
|
111 */ |
|
112 IMPORT_C void SetValueL(const TDesC8& aValue); //codescannerwarnings |
|
113 |
|
114 /** |
|
115 * Adds the value to the attribute, separately from instantiation. |
|
116 * If value(s) are already present in attribute, value is appended |
|
117 * to create multi-valued attribute. |
|
118 * @since Series60 4.0 |
|
119 * @return void |
|
120 */ |
|
121 IMPORT_C void AddValueL(const TDesC8& aValue); //codescannerwarnings |
|
122 |
|
123 /** |
|
124 * Returns the values of the (multi-valued) attribute. |
|
125 * @since Series60 4.0 |
|
126 * @return RAttrValueArray |
|
127 */ |
|
128 IMPORT_C const RAttrValueArray GetValues() const; |
|
129 |
|
130 /** |
|
131 * Returns the number of values in the attribute. |
|
132 * @since Series60 4.0 |
|
133 * @return TInt |
|
134 */ |
|
135 IMPORT_C TInt NumValues() const; |
|
136 |
|
137 |
|
138 /** |
|
139 * Returns true if attributes are equal |
|
140 * (string equality of values, type and friendly name equality) |
|
141 * @since Series60 4.0 |
|
142 * @return TBool |
|
143 */ |
|
144 IMPORT_C TBool Equals(const CSenAttribute& aAttr) const; |
|
145 |
|
146 public: // Functions from base classes |
|
147 |
|
148 protected: // New functions |
|
149 /*** |
|
150 * Constructor |
|
151 */ |
|
152 IMPORT_C CSenAttribute(); |
|
153 |
|
154 /** |
|
155 * Basic ConstructL function |
|
156 * @since Series60 3.0 |
|
157 */ |
|
158 |
|
159 IMPORT_C void ConstructL(const TDesC8& aName, |
|
160 const TDesC8& aType, |
|
161 const TDesC8& aValue, |
|
162 const TDesC8& aFriendlyName); |
|
163 private: // Data |
|
164 |
|
165 HBufC8* ipName ; |
|
166 HBufC8* ipType ; |
|
167 HBufC8* ipFriendlyName ; |
|
168 |
|
169 RAttrValueArray iValues; |
|
170 |
|
171 // Reserved pointer for future extension |
|
172 TAny* ipReserved; |
|
173 }; |
|
174 |
|
175 |
|
176 #endif // SEN_ATTRIBUTE_H |
|
177 |