|
1 /* |
|
2 * Copyright (c) 2007 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 the License "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 |
|
20 |
|
21 #ifndef CIPTVCONTENTIDMEDIACONTENTITEM_H |
|
22 #define CIPTVCONTENTIDMEDIACONTENTITEM_H |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 class CIptvMediaContent; |
|
27 class CIptvMyVideosGlobalFileId; |
|
28 |
|
29 /** |
|
30 * This class is used for storage purposes to store key + |
|
31 * media contents defined for that key. |
|
32 * There might be sevaral CIptvMediaContent objects constructed |
|
33 * by the plugin for one individual content so this is the class |
|
34 * that represents the media content set for that content id. |
|
35 */ |
|
36 class CIptvContentIdMediaContentItem : public CBase |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Symbian two phase constructor |
|
41 */ |
|
42 static CIptvContentIdMediaContentItem* NewL(); |
|
43 |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 ~CIptvContentIdMediaContentItem(); |
|
48 |
|
49 // SETTERS |
|
50 /** |
|
51 * Setter for media content array. Ownership of aArray IS NOT |
|
52 * transferred to this class but we do instead copy of the |
|
53 * array content to be stored in this class. Therefore |
|
54 * CIptvContentIdMediaContentItem is not responsible for deleting |
|
55 * the content of aArray elements |
|
56 * @param aArray Array of media contents to be stored to this |
|
57 * item |
|
58 * @return None |
|
59 */ |
|
60 void SetMediaContentArrayL( RPointerArray<CIptvMediaContent>& aArray ); |
|
61 |
|
62 /** |
|
63 * Setter for content id that is used to recognize the media |
|
64 * content when requested by the UI. |
|
65 * @param aContentId Id of the content this classes media content |
|
66 * refers to |
|
67 * @return None |
|
68 */ |
|
69 void SetContentId( TUint32 aContentId ); |
|
70 |
|
71 // GETTERS |
|
72 |
|
73 /** |
|
74 * Getter method for media contents. This method copies the contents |
|
75 * of iMediaContentArray to aArray. Caller is responsible for freeing |
|
76 * the memory allocated in aArray. |
|
77 * @param aArray Array to be filled with this classes media content |
|
78 * items |
|
79 * @return None |
|
80 */ |
|
81 void GetMediaContentsL( RPointerArray<CIptvMediaContent>& aArray ); |
|
82 |
|
83 /** |
|
84 * Getter for media content by given index. This method returns |
|
85 * iMediaContentArray[aIndex] item to the caller. New object is created |
|
86 * and ownership is transferred to the caller. |
|
87 * @param aIndex Index of the item to be retrieved |
|
88 * @return On return contains a COPY of the media content found |
|
89 * on the given index. |
|
90 */ |
|
91 CIptvMediaContent* MediaContentByIndexL( TInt aIndex ); |
|
92 |
|
93 /** |
|
94 * Getter for media content id assigned for this class. |
|
95 * @param None |
|
96 * @return Content id of this object |
|
97 */ |
|
98 TUint32 ContentId() const; |
|
99 |
|
100 /** |
|
101 * Method to return the amount of media contents inside the |
|
102 * iMediaContentArray object. |
|
103 * @param None |
|
104 * @return Amount of items in iMediaContentArray |
|
105 */ |
|
106 TInt MediaContentCount() const; |
|
107 |
|
108 /** |
|
109 * Resets the global file id if found inside an array of this |
|
110 * class (array being iMediaContentArray). |
|
111 * @param aId Global file id values to be searched |
|
112 * @return KErrNone if successful, KErrNotFound if the aId values |
|
113 * was not found inside the iMediaContentArray, otherwise |
|
114 * some Symbian error code |
|
115 */ |
|
116 TInt ResetGlobalId( CIptvMyVideosGlobalFileId& aId ); |
|
117 |
|
118 /** |
|
119 * Sets the global file id for specified content key. |
|
120 * @param aContentKey Id specifying the contentid that we are |
|
121 * searching. This values is compared to |
|
122 * iContentId of this class |
|
123 * @param aId Class containing the file id and drive |
|
124 * definition for the key. This value is |
|
125 * located in CIptvMediaContent items stored |
|
126 * to the iMediaContentArray |
|
127 * @param aIndex Index specifying the index inside the |
|
128 * iMediaContentArray |
|
129 * @return KErrNone if successful, KErrNotFound if aContentId != iContentId, |
|
130 * otherwise some Symbian error code. |
|
131 */ |
|
132 TInt SetGlobalId( TUint32 aContentKey, |
|
133 CIptvMyVideosGlobalFileId& aId, |
|
134 TUint32 aIndex ); |
|
135 |
|
136 private: |
|
137 |
|
138 /** |
|
139 * Default constructor |
|
140 */ |
|
141 CIptvContentIdMediaContentItem(); |
|
142 |
|
143 /** |
|
144 * Utility method to copy contents from one class to another |
|
145 * @param aOriginal Class where from data is copied |
|
146 * @param aNew Class where to data is copied |
|
147 * @return None |
|
148 */ |
|
149 void CopyMediaContentL( CIptvMediaContent& aOriginal, CIptvMediaContent* aNew ); |
|
150 |
|
151 private: |
|
152 /** |
|
153 * Array containing all the media contents assigned for this content id |
|
154 */ |
|
155 RPointerArray<CIptvMediaContent> iMediaContentArray; |
|
156 |
|
157 /** |
|
158 * Content id defining the identity of this class |
|
159 */ |
|
160 TUint32 iContentId; |
|
161 }; |
|
162 |
|
163 #endif // CIPTVCONTENTIDMEDIACONTENTITEM_H |