|
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 "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 file for the CUpnpShowTask class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef UPNP_SHOW_TASK_H |
|
20 #define UPNP_SHOW_TASK_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "upnpresourceselector.h" // a member located here |
|
25 #include "upnptask.h" // base class |
|
26 #include "upnpimagerenderingengineobserver.h" // base class |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MUPnPAVRenderingSession; |
|
30 class CUPnPCommonUI; |
|
31 class CUpnpTaskResourceAllocator; |
|
32 class CUpnpImageRenderingEngine; |
|
33 |
|
34 |
|
35 /** |
|
36 * This class defines the UpnpShowTask used in UpnpCommand component. |
|
37 * |
|
38 * @since S60 3.2 |
|
39 */ |
|
40 class CUpnpShowTask : public CUpnpTask, |
|
41 public MUpnpImageRenderingEngineObserver |
|
42 { |
|
43 public: // Methods from CUpnpTask |
|
44 |
|
45 /** |
|
46 * Creates a new UpnpShowTask object. Allocates Upnp Fw resources. |
|
47 * Resources will be released when the task is destroyed. |
|
48 * |
|
49 * @since S60 3.2 |
|
50 * @return a new instance of CUpnpShowTask, casted to type CUpnpTask |
|
51 */ |
|
52 static CUpnpTask* NewL(); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CUpnpShowTask(); |
|
58 |
|
59 /** |
|
60 * Allocates the Upnp Fw resources. |
|
61 * |
|
62 * @since S60 3.2 |
|
63 */ |
|
64 void AllocateResourcesL(); |
|
65 |
|
66 /** |
|
67 * Executes the task. |
|
68 * |
|
69 * @since S60 3.2 |
|
70 */ |
|
71 void ExecuteL(); |
|
72 |
|
73 |
|
74 private: // Private construct/destruct methods |
|
75 |
|
76 /** |
|
77 * constructor |
|
78 */ |
|
79 CUpnpShowTask(); |
|
80 |
|
81 /** |
|
82 * Perform the second phase of two phase construction. Reserves the |
|
83 * Upnp Fw resources (they are released when the task is destroyed). |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 /** |
|
88 * Cleans up used resources |
|
89 */ |
|
90 void Cleanup(); |
|
91 |
|
92 protected: // methods from MUpnpImageRenderingEngineObserver |
|
93 |
|
94 MUPnPItemResolver* GetMedia(); |
|
95 |
|
96 TInt RenderAck( |
|
97 TInt aError, |
|
98 const CUpnpItem* aItem ); |
|
99 |
|
100 void EngineShutdown( |
|
101 TInt aError ); |
|
102 |
|
103 |
|
104 private: // Private methods |
|
105 |
|
106 /** |
|
107 * Launches the video player dialog for playing a video file on remote |
|
108 * @param aItem the item to play |
|
109 * @return an error code |
|
110 */ |
|
111 TInt PlayVideo( const CUpnpItem& aItem ); |
|
112 |
|
113 |
|
114 private: // Data members |
|
115 |
|
116 // Pointer to the UpnpAvController's rendering session. |
|
117 MUPnPAVRenderingSession* iRenderingSession; |
|
118 |
|
119 // Pointer to the UpnpAvController's rendering session. |
|
120 MUPnPAVRenderingSession* iVideoRenderingSession; |
|
121 |
|
122 // flag for video playing |
|
123 TBool iPlayingVideo; |
|
124 |
|
125 // Pointer to the UPnPCommonUI; |
|
126 CUPnPCommonUI* iCommonUI; |
|
127 |
|
128 // Default resource selector. Owned. |
|
129 TUPnPSelectDefaultResource iSelector; |
|
130 |
|
131 // The resource allocator |
|
132 CUpnpTaskResourceAllocator* iResourceAllocator; |
|
133 |
|
134 // the image rendering engine |
|
135 CUpnpImageRenderingEngine* iRenderingEngine; |
|
136 |
|
137 // flag to show note when image showing failed |
|
138 TBool iShowPlaybackFailedNote; |
|
139 |
|
140 }; |
|
141 |
|
142 |
|
143 #endif // UPNP_SHOW_TASK_H |
|
144 |
|
145 // End of File |