|
1 /* |
|
2 * Copyright (c) 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: Header file for the CUpnpFileTransferBaseTask class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef UPNP_FILETRANSFER_BASE_TASK_H |
|
20 #define UPNP_FILETRANSFER_BASE_TASK_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "upnpavbrowsingsessionobserver.h" |
|
25 #include "upnptask.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MUPnPAVBrowsingSession; |
|
29 class MUPnPAVSessionBase; |
|
30 class CUPnPCommonUI; |
|
31 class CUpnpTaskResourceAllocator; |
|
32 |
|
33 |
|
34 |
|
35 /** |
|
36 * This class defines the CUpnpFileTransferBaseTask |
|
37 * used in UpnpCommand component. |
|
38 * |
|
39 * @since S60 3.2 |
|
40 */ |
|
41 class CUpnpFileTransferBaseTask : public CUpnpTask, |
|
42 public MUPnPAVBrowsingSessionObserver |
|
43 { |
|
44 public: // Methods from CUpnpFileTransferBaseTask |
|
45 |
|
46 /** |
|
47 * Allocates the Upnp Fw resources. |
|
48 * |
|
49 * @since S60 3.2 |
|
50 */ |
|
51 void AllocateFileTransferResourcesL( TInt aMode ); |
|
52 |
|
53 /** |
|
54 * Executes the task. |
|
55 * |
|
56 * @since S60 3.2 |
|
57 */ |
|
58 void ExecuteFileTransferL( TBool aRemoveFiles, |
|
59 TInt& aTransferredFiles); |
|
60 |
|
61 /** |
|
62 * return CUpnpTaskResourceAllocator |
|
63 * |
|
64 * @since S60 3.2 |
|
65 */ |
|
66 CUpnpTaskResourceAllocator* ResourceAllocator(); |
|
67 |
|
68 public: // Methods from CUpnpTask, not used |
|
69 |
|
70 void AllocateResourcesL() {} |
|
71 void ExecuteL() {} |
|
72 |
|
73 public: // Public destructor |
|
74 |
|
75 /** |
|
76 * Destructor. |
|
77 */ |
|
78 virtual ~CUpnpFileTransferBaseTask(); |
|
79 |
|
80 /** |
|
81 * Perform the first phase of two phase construction. |
|
82 * |
|
83 * @since S60 3.2 |
|
84 * @return a new instance of CUpnpFileTransferBaseTask, |
|
85 * casted to type CUpnpTask |
|
86 */ |
|
87 CUpnpFileTransferBaseTask(); |
|
88 |
|
89 |
|
90 protected: |
|
91 |
|
92 /** |
|
93 * Returns connection state |
|
94 */ |
|
95 TBool IsWlanActive(); |
|
96 |
|
97 private: // Call back methods of MUPnPAVBrowsingSessionObserver |
|
98 |
|
99 /* Not used */ |
|
100 void BrowseResponse( |
|
101 const TDesC8& /*aBrowseResponse*/, |
|
102 TInt /*aError*/, |
|
103 TInt /*aMatches*/, |
|
104 TInt /*aTotalCount*/, |
|
105 const TDesC8& /*aUpdateId*/ |
|
106 ) {} |
|
107 void SearchResponse( |
|
108 const TDesC8& /*aSearchResponse*/, |
|
109 TInt /*aError*/, |
|
110 TInt /*aMatches*/, |
|
111 TInt /*aTotalCount*/, |
|
112 const TDesC8& /*aUpdateId*/ |
|
113 ) {} |
|
114 void SearchCapabilitiesResponse( |
|
115 TInt /*aError*/, |
|
116 const TDesC8& /*aSearchCapabilities*/ |
|
117 ) {} |
|
118 void CreateContainerResponse( TInt /*aError*/, |
|
119 const TDesC8& /*aObjectId*/ ) {} |
|
120 void DeleteObjectResponse( TInt /*aError*/ ) {} |
|
121 void ReserveLocalMSServicesCompleted( TInt /*aError*/ ){} |
|
122 |
|
123 |
|
124 /** |
|
125 * Notifies that the Media Renderer we have a |
|
126 * session which has disappeared. |
|
127 * |
|
128 * @since S60 3.2 |
|
129 */ |
|
130 void MediaServerDisappeared( |
|
131 TUPnPDeviceDisconnectedReason aReason ) ; |
|
132 |
|
133 |
|
134 private: // Data members |
|
135 |
|
136 /** |
|
137 * Connection state |
|
138 */ |
|
139 enum TConnectionState{ |
|
140 EStateConnected = 0, |
|
141 EStateMSLost, |
|
142 EStateWLANLost |
|
143 }; |
|
144 |
|
145 |
|
146 /** |
|
147 * Pointer to the UpnpAvController's browsing session instance. Owned. |
|
148 */ |
|
149 MUPnPAVBrowsingSession* iBrowsingSession; |
|
150 |
|
151 /** |
|
152 * Pointer to the UPnPCommonUI. Owned. |
|
153 */ |
|
154 CUPnPCommonUI* iCommonUI; |
|
155 |
|
156 /** |
|
157 * The resource allocator. Owned. |
|
158 */ |
|
159 CUpnpTaskResourceAllocator* iResourceAllocator; |
|
160 |
|
161 /** |
|
162 * Connection state |
|
163 */ |
|
164 TConnectionState iState; |
|
165 |
|
166 }; |
|
167 |
|
168 #endif // UPNP_FILETRANSFER_BASE_TASK_H |
|
169 |
|
170 // End of File |