|
1 /** |
|
2 * Copyright (c) 2009 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 : CUpnpCdsReaderAO class definiton |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef UPNP_CDS_READER_AO_H |
|
19 #define UPNP_CDS_READER_AO_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class CUpnpItem; |
|
26 class CUpnpFileSharing; |
|
27 class CUpnpCdsLiteObjectArray; |
|
28 |
|
29 /** |
|
30 * CUpnpCdsReaderAO class definition |
|
31 * |
|
32 * @lib upnpsharingalgorithm.lib |
|
33 * @since S60 5.2 |
|
34 */ |
|
35 class CUpnpCdsReaderAO : public CActive |
|
36 { |
|
37 |
|
38 public: |
|
39 // Constructors and destructor. |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 * |
|
44 * @param aUpnpCdsLiteObjects, reference to the array of cds objects |
|
45 */ |
|
46 static CUpnpCdsReaderAO* NewL( |
|
47 CUpnpCdsLiteObjectArray &aUpnpCdsLiteObjects ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CUpnpCdsReaderAO(); |
|
53 |
|
54 public: |
|
55 /** |
|
56 * Reads the shared stucture from content directory to the array passed |
|
57 * as parameter to the NewL |
|
58 * |
|
59 * @since S60 5.2 |
|
60 */ |
|
61 void ReadCdsStructureL(); |
|
62 |
|
63 protected: |
|
64 |
|
65 // From base class CActive |
|
66 |
|
67 /** |
|
68 * From CActive |
|
69 * See base class definition |
|
70 */ |
|
71 void RunL(); |
|
72 |
|
73 /** |
|
74 * From CActive |
|
75 * See base class definition |
|
76 */ |
|
77 void DoCancel(); |
|
78 |
|
79 private: |
|
80 |
|
81 /** |
|
82 * Second-phase constructor. |
|
83 */ |
|
84 void ConstructL(); |
|
85 |
|
86 /** |
|
87 * C++ default constructor. |
|
88 * @param aUpnpCdsLiteObjects, reference to the array of cds objects |
|
89 */ |
|
90 CUpnpCdsReaderAO( CUpnpCdsLiteObjectArray &aUpnpCdsLiteObjects ): |
|
91 CActive( CActive::EPriorityStandard ), |
|
92 iUpnpCdsLiteObjects( aUpnpCdsLiteObjects ) {} |
|
93 |
|
94 /** |
|
95 * Waits that request completes |
|
96 * This does not block other AO's |
|
97 * |
|
98 * @since S60 5.2 |
|
99 */ |
|
100 void WaitRequestToComplete(); |
|
101 |
|
102 /** |
|
103 * Stops waiting request complete |
|
104 * |
|
105 * @since S60 5.2 |
|
106 */ |
|
107 void StopWaitingRequestComplete(); |
|
108 |
|
109 /** |
|
110 * Get container and analyse container objects |
|
111 * |
|
112 * @since S60 5.2 |
|
113 * @param aContainerId, where items and containers are searched |
|
114 */ |
|
115 void GetContainersL( const TDesC8& aContainerId ); |
|
116 |
|
117 /** |
|
118 * Gets all file objects of one container |
|
119 * |
|
120 * @since S60 5.2 |
|
121 * @param aContainerId where items are searched |
|
122 */ |
|
123 void GetItemsL( const TDesC8& aContainerId ); |
|
124 |
|
125 /** |
|
126 * Sets the object active and waits for the request to complete |
|
127 * |
|
128 * @since S60 5.2 |
|
129 */ |
|
130 void CompleteRequestL(); |
|
131 |
|
132 private: |
|
133 |
|
134 /** |
|
135 * MediaServer file sharing instance - owned |
|
136 */ |
|
137 CUpnpFileSharing* iFileSharing; |
|
138 /** |
|
139 * Waits request to complete - owned |
|
140 */ |
|
141 CActiveSchedulerWait* iWaitRequest; |
|
142 /** |
|
143 * Object array |
|
144 */ |
|
145 CUpnpCdsLiteObjectArray& iUpnpCdsLiteObjects; |
|
146 /** |
|
147 * Active scheduler pointer |
|
148 */ |
|
149 CActiveScheduler* iScheduler; |
|
150 }; |
|
151 |
|
152 #endif // UPNPCDSREADERAO_H |
|
153 |
|
154 // End of File |