|
1 /** @file |
|
2 * Copyright (c) 2005-2006 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: Attribute table data handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CUPNPATTRIBUTEBEAN_H |
|
21 #define C_CUPNPATTRIBUTEBEAN_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "upnptablebean.h" |
|
25 #include <e32base.h> |
|
26 #include <d32dbms.h> |
|
27 |
|
28 class CUpnpAttribute; |
|
29 class CUpnpElement; |
|
30 |
|
31 /** |
|
32 * Stores the data of attribute table row. |
|
33 * |
|
34 * @lib AVContentDirectory.lib |
|
35 * @since Series60 3.1 |
|
36 */ |
|
37 class CUpnpAttributeBean: public CUpnpTableBean |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 static CUpnpAttributeBean* NewLC(); |
|
45 |
|
46 /** |
|
47 * Two-phase constructor |
|
48 * aparam aRowSet a rowset of the attribute table |
|
49 */ |
|
50 static CUpnpAttributeBean* NewLC(const RDbRowSet& aRowSet); |
|
51 |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CUpnpAttributeBean(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 void AttachAttrL(CUpnpElement* aElm); |
|
61 /** |
|
62 * Sets the RDbRowset and sets all values from this rowset. |
|
63 * @since Series S60 3.0 |
|
64 * @param aRowSet a rowset of the attribute table |
|
65 */ |
|
66 void SetL(const RDbRowSet& aRowSet); |
|
67 |
|
68 /** |
|
69 * Sets iAtrId value. |
|
70 * @since Series S60 3.0 |
|
71 * @param aElId value of atr_id in the Attribute table |
|
72 */ |
|
73 void SetAtrId(TInt aElId); |
|
74 |
|
75 /** |
|
76 * Sets iAtrName value. |
|
77 * @since Series S60 3.0 |
|
78 * @param aAtrName value of Atr_name in the Attribute table |
|
79 */ |
|
80 void SetAtrNameL(const TDesC8& aAtrName); |
|
81 |
|
82 /** |
|
83 * Sets iAtrIsRequired value. |
|
84 * @since Series S60 3.0 |
|
85 * @param aAtrIsRequired value of Atr_is_required in the Attribute table |
|
86 */ |
|
87 void SetAtrIsRequired(TBool aAtrIsRequired); |
|
88 |
|
89 /** |
|
90 * Sets iAtrValue value. |
|
91 * @since Series S60 3.0 |
|
92 * @param aAtrValue value of Atr_value in the Attribute table |
|
93 */ |
|
94 void SetAtrValueL(const RDbRowSet& aRowSet, const TInt aColNo); |
|
95 void SetAtrValueL(const TDesC8& aVal); |
|
96 |
|
97 /** |
|
98 * Sets iAtrObjId value. |
|
99 * @since Series S60 3.0 |
|
100 * @param aAtrObjId value of Atr_obj_id in the Attribute table |
|
101 */ |
|
102 void SetAtrElmId(TInt aAtrObjId); |
|
103 |
|
104 /** |
|
105 * Gets iAtrId value. |
|
106 * @since Series S60 3.0 |
|
107 * @return Gets the value of iAtrId |
|
108 */ |
|
109 TInt AtrId() const; |
|
110 |
|
111 /** |
|
112 * Gets iAtrName value. |
|
113 * @since Series S60 3.0 |
|
114 * @return Value of iAtrName |
|
115 */ |
|
116 TDesC8& AtrName() const; |
|
117 |
|
118 /** |
|
119 * Gets iAtrIsRequired value. |
|
120 * @since Series S60 3.0 |
|
121 * @return Gets the value of iAtrIsRequired |
|
122 */ |
|
123 TBool AtrIsRequired() const; |
|
124 |
|
125 /** |
|
126 * Gets iAtrValue value. |
|
127 * @since Series S60 3.0 |
|
128 * @return Value of iAtrValue |
|
129 */ |
|
130 TDesC8& AtrValue() const; |
|
131 |
|
132 /** |
|
133 * Gets iAtrObjId value. |
|
134 * @since Series S60 3.0 |
|
135 * @return Gets the value of iAtrObjId |
|
136 */ |
|
137 TInt AtrElmId() const; |
|
138 |
|
139 /** |
|
140 * Adds attribute to the given TXmlEngElement. |
|
141 * @since Series S60 3.0 |
|
142 * @param TXmlEngElement |
|
143 * @return just attached attribute |
|
144 */ |
|
145 TXmlEngAttr AttachAttrL(TXmlEngElement aElement); |
|
146 |
|
147 private: |
|
148 |
|
149 /** |
|
150 * C++ default constructor. |
|
151 */ |
|
152 CUpnpAttributeBean(); |
|
153 |
|
154 /** |
|
155 * Second phase of the constructor. |
|
156 * |
|
157 * By default Symbian 2nd phase constructor is private. |
|
158 */ |
|
159 void ConstructL(); |
|
160 |
|
161 private: // Data |
|
162 // Attribute Id |
|
163 TInt iAtrId; |
|
164 // Attribute name buffer |
|
165 HBufC8* iAtrName; |
|
166 // |
|
167 TBool iAtrHasAttribute; |
|
168 //Attribute Element Id |
|
169 TInt iAtrElmId; |
|
170 // |
|
171 TBool iAtrIsRequired; |
|
172 // Attribute value buffer |
|
173 HBufC8* iAtrValue; |
|
174 }; |
|
175 |
|
176 // inline functions |
|
177 #include"upnpattributebean.inl" |
|
178 |
|
179 #endif // C_CUPNPATTRIBUTEBEAN_H |
|
180 |
|
181 // End of File |