|
1 /** @file |
|
2 * Copyright (c) 2005-2006 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CUPNPTRANSFERHANDLER_H |
|
21 #define C_CUPNPTRANSFERHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include "upnpnotifytimer.h" |
|
26 #include "upnperrors.h" |
|
27 #include "upnpfiletransfertimerobserver.h" |
|
28 #include "upnptransferinterface.h" |
|
29 #include "upnptransferobserver.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CUpnpContentDirectory; |
|
33 class CUpnpTransferDownloader; |
|
34 class CUpnpTransferUploader; |
|
35 |
|
36 |
|
37 /** |
|
38 * This is a facade class used for communication between CD and uploader/downloader |
|
39 * |
|
40 * @lib ContentDirectory |
|
41 * @since Series 60 2.6 |
|
42 */ |
|
43 class CUpnpTransferHandler: public CBase, |
|
44 public MUpnpTransferInterface, |
|
45 public MUpnpTransferObserver |
|
46 { |
|
47 public: // Constructors and destructors |
|
48 |
|
49 /** |
|
50 * Two-phased constructor |
|
51 * @since Series60 2.6 |
|
52 * @param aService Parent service |
|
53 */ |
|
54 static CUpnpTransferHandler* NewL( ); |
|
55 |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CUpnpTransferHandler(); |
|
61 |
|
62 void SetObserver( MUpnpTransferObserver* aObserver ); |
|
63 |
|
64 public: // form MUpnpTransferInterface |
|
65 |
|
66 virtual void UploadFileL( TInt aKey, |
|
67 const TDesC8& aUri, |
|
68 const TDesC& aTargetPath, |
|
69 const TDesC8& aContentType |
|
70 ); |
|
71 |
|
72 virtual void DownloadFileL( TInt aKey, |
|
73 const TDesC8& aUri, |
|
74 const TDesC& aTargetPath |
|
75 ); |
|
76 |
|
77 virtual void TrackUploadProgress( TInt aKey, TBool aSwitchOn ); |
|
78 |
|
79 virtual void TrackDownloadProgress( TInt aKey, TBool aSwitchOn ); |
|
80 |
|
81 virtual void CancelUpload( TInt aKey ); |
|
82 |
|
83 virtual void CancelDownload( TInt aKey ); |
|
84 |
|
85 public: // form MUpnpTransferObserver |
|
86 |
|
87 virtual void TransferCompletedL( TInt aKey, TInt aResultCode ); |
|
88 |
|
89 virtual void TransferProgress( TInt akey, |
|
90 TInt aBytes, |
|
91 TInt aTotalBytes); |
|
92 |
|
93 protected: |
|
94 /** |
|
95 * C++ default constructor. |
|
96 */ |
|
97 CUpnpTransferHandler(); |
|
98 |
|
99 /** |
|
100 * Second phase of the constructor. |
|
101 * Initialises a DOM tree. |
|
102 * By default Symbian 2nd phase constructor is private. |
|
103 * @param service Parent service |
|
104 */ |
|
105 void ConstructL(); |
|
106 |
|
107 private: |
|
108 MUpnpTransferObserver* iObserver; |
|
109 |
|
110 CUpnpTransferDownloader* iDownloader; |
|
111 |
|
112 CUpnpTransferUploader* iUploader; |
|
113 }; |
|
114 |
|
115 #endif // C_CUPNPTRANSFERHANDLER_H |
|
116 |
|
117 // End of File |