|
1 /* |
|
2 * Copyright (c) 2003-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: Declares class TViewItems |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DRMVIEWITEMS_H |
|
20 #define DRMVIEWITEMS_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include "DRMRightsManager.hrh" |
|
25 |
|
26 |
|
27 /** |
|
28 * Class containing data for the items to be showed in the view |
|
29 */ |
|
30 class TItemData |
|
31 { |
|
32 public: // Constructor |
|
33 /** |
|
34 * C++ default constructor. |
|
35 */ |
|
36 TItemData(); |
|
37 |
|
38 /** |
|
39 * C++ default constructor. |
|
40 * @param aIndexInArray Index in array |
|
41 * @param aItemName Name of the item |
|
42 * @param aItemFullName Path name of the item |
|
43 * @param aIndexIcon Index of the icon |
|
44 * @param aTypeOfObject Attributes of the object |
|
45 * @param aContentCanBeSent Object can be sent or not |
|
46 * @param aContentURI Content URI of the object |
|
47 * @param aFutureActivationTime Time in the future when the RO will be |
|
48 * activated. |
|
49 * @param aUnlimitedRights Rights unlimited or not |
|
50 * @param aIndividualConstraint Individual constraint exists or not |
|
51 * @param aUsageAllowed Content usage allowed or not with current SIM |
|
52 */ |
|
53 TItemData( const TInt aIndexInArray, |
|
54 const TDesC& aItemName, |
|
55 const TDesC& aItemFullName, |
|
56 const TInt aIndexIcon, |
|
57 const TInt aTypeOfObject, |
|
58 const TBool aContentCanBeSent, |
|
59 const TDesC8& aContentURI, |
|
60 const TTime& aFutureActivationTime, |
|
61 const TBool aUnlimitedRights, |
|
62 const TBool aIndividualConstraint, |
|
63 const TBool aUsageAllowed ); |
|
64 |
|
65 /** |
|
66 * C++ default constructor. |
|
67 * @param aIndexInArray Index in array |
|
68 * @param aItemName Name of the item |
|
69 * @param aItemFullName Path name of the item |
|
70 * @param aIndexIcon Index of the icon |
|
71 * @param aTypeOfObject Attributes of the object |
|
72 * @param aLocalID Local ID of the object |
|
73 * @param aContentURI Content URI of the object |
|
74 * @param aFutureActivationTime Time in the future when the RO will be |
|
75 * activated. |
|
76 * @param aUnlimitedRights Rights unlimited or not |
|
77 */ |
|
78 TItemData( const TInt aIndexInArray, |
|
79 const TDesC& aItemName, |
|
80 const TDesC& aItemFullName, |
|
81 const TInt aIndexIcon, |
|
82 const TInt aTypeOfObject, |
|
83 const TUint32 aLocalID, |
|
84 const TDesC8& aContentURI, |
|
85 const TTime& aFutureActivationTime, |
|
86 const TBool aUnlimitedRights, |
|
87 const TBool aIndividualConstraint, |
|
88 const TBool aUsageAllowed ); |
|
89 |
|
90 |
|
91 |
|
92 public: // New functions |
|
93 /** |
|
94 * Returns the index of the element in the array. |
|
95 * @return Index in array |
|
96 */ |
|
97 inline TInt IndexInArray(); |
|
98 |
|
99 /** |
|
100 * Returns the name of the item. |
|
101 * @param aItemName The name of the item. |
|
102 */ |
|
103 inline void ItemName( TFileName& aItemName ); |
|
104 |
|
105 /** |
|
106 * Returns the path Name of the item. |
|
107 * @param aItemFullName The path name of the item. |
|
108 */ |
|
109 inline void ItemFullName( TFileName& aItemFullName ); |
|
110 |
|
111 /** |
|
112 * Returns the index of the icon. |
|
113 * @return Index of the icon to be used for the object. |
|
114 */ |
|
115 inline TInt IndexIcon(); |
|
116 |
|
117 /** |
|
118 * Returns the type of object |
|
119 * @return The type of the object. |
|
120 */ |
|
121 inline TInt TypeOfObject(); |
|
122 |
|
123 /** |
|
124 * Returns the future rights attribute of the object. |
|
125 * @return ETrue if the object has future rights. |
|
126 */ |
|
127 inline TBool IsFuture(); |
|
128 |
|
129 /** |
|
130 * Returns the group attribute of the object. |
|
131 * @return ETrue if the object is a Group. |
|
132 */ |
|
133 inline TBool IsGroup(); |
|
134 |
|
135 /** |
|
136 * Returns if the content can be sent or not. |
|
137 * @return ETrue if the rights object is connected to an object that can |
|
138 * be sent. |
|
139 */ |
|
140 inline TBool ContentCanBeSent(); |
|
141 |
|
142 /** |
|
143 * Returns if objects rights are unlimited or not. |
|
144 * @param aUnlimitedRights ETrue if unlimited rights. |
|
145 */ |
|
146 inline TBool UnlimitedRights(); |
|
147 |
|
148 /** |
|
149 * Returns if object contains individual constraint or not. |
|
150 * @param aIndividualConstraint ETrue if individual constraint |
|
151 */ |
|
152 inline TBool IndividualConstraint(); |
|
153 |
|
154 /** |
|
155 * Returns if object use is allowed with current SIM or not. |
|
156 * @param aUsageAllowed ETrue if allowed |
|
157 */ |
|
158 inline TBool UsageAllowed(); |
|
159 |
|
160 /** |
|
161 * Returns the time in the future when the RO will be activated. |
|
162 * @return The activation time. |
|
163 */ |
|
164 inline TTime FutureActivationTime(); |
|
165 |
|
166 /** |
|
167 * Returns the local ID of the active RO. |
|
168 * @return The local ID. |
|
169 */ |
|
170 inline TUint32 LocalID(); |
|
171 |
|
172 /** |
|
173 * Returns the content URI of the object. |
|
174 * @param aContentURI The content URI. |
|
175 */ |
|
176 inline void ContentURI( TBuf8<KMaxFileName>& aContentURI ); |
|
177 |
|
178 /** |
|
179 * Sets the value for the index in array. |
|
180 * @param aIndex The index to be set. |
|
181 */ |
|
182 inline void SetIndexInArray( TInt aIndex ); |
|
183 |
|
184 /** |
|
185 * Sets the name of the item. |
|
186 * @param aItemName The name of the item. |
|
187 */ |
|
188 inline void SetItemName( const TDesC& aItemName ); |
|
189 |
|
190 /** |
|
191 * Sets the path name of the item. |
|
192 * @param aItemFullName The pathname of the item. |
|
193 */ |
|
194 inline void SetItemFullName( const TDesC& aItemFullName ); |
|
195 |
|
196 /** |
|
197 * Sets the "content can be sent" attribute of the object. |
|
198 * @param aContentCanBeSent ETrue if the content can be sent. |
|
199 */ |
|
200 inline void SetContentCanBeSent( const TBool aContentCanBeSent ); |
|
201 |
|
202 /** |
|
203 * Sets the unlimited rights attribute of the object. |
|
204 * @param aUnlimitedRights ETrue if unlimited rights. |
|
205 */ |
|
206 inline void SetUnlimitedRights( const TBool aUnlimitedRights ); |
|
207 |
|
208 /** |
|
209 * Sets the individual constraint attribute. |
|
210 * @param aIndividualConstraint ETrue if individual constraint |
|
211 */ |
|
212 inline void SetIndividualConstraint( const TBool aIndividualConstraint ); |
|
213 |
|
214 /** |
|
215 * Sets the usage allowed with current SIM attribute. |
|
216 * @param aUsageAllowed ETrue if allowed |
|
217 */ |
|
218 inline void SetUsageAllowed( const TBool aUsageAllowed ); |
|
219 |
|
220 private: |
|
221 // The index in the array of the elements |
|
222 TInt iIndexInArray; |
|
223 |
|
224 // Name of the item |
|
225 TFileName iItemName; |
|
226 |
|
227 // Full name of the item |
|
228 TFileName iItemFullName; |
|
229 |
|
230 // Index of the icon to be used |
|
231 TInt iIndexIcon; |
|
232 |
|
233 // Attributes of the object |
|
234 TInt iTypeOfObject; |
|
235 |
|
236 // ETrue if object can be sent |
|
237 TBool iContentCanBeSent; |
|
238 |
|
239 // Local ID of the active RO |
|
240 TUint32 iLocalID; |
|
241 |
|
242 // Content URI of the object |
|
243 TBuf8<KMaxFileName> iContentURI; |
|
244 |
|
245 // Time in the future when the RO will be activated |
|
246 TTime iFutureActivationTime; |
|
247 |
|
248 // ETrue if unlimited rights |
|
249 TBool iUnlimitedRights; |
|
250 |
|
251 // ETrue if individual constraint exists |
|
252 TBool iIndividualConstraint; |
|
253 |
|
254 // ETrue if content usage is allowed with current SIM |
|
255 TBool iUsageAllowed; |
|
256 |
|
257 }; |
|
258 |
|
259 |
|
260 // Include inline functions |
|
261 #include "DRMViewItems.inl" |
|
262 |
|
263 #endif |
|
264 |
|
265 |
|
266 // End of File |