|
1 /* |
|
2 * Copyright (c) 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: Observer interface definition for download operations |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_NCD_DOWNLOAD_OPERATION_OBSERVER_H |
|
20 #define M_NCD_DOWNLOAD_OPERATION_OBSERVER_H |
|
21 |
|
22 #include <e32cmn.h> |
|
23 |
|
24 class TNcdProgress; |
|
25 class MNcdDownloadOperation; |
|
26 class MNcdQuery; |
|
27 |
|
28 /** |
|
29 * Observer interface for download operations |
|
30 * |
|
31 * Download operation users should implement this interface to be able to |
|
32 * receive callbacks. |
|
33 * |
|
34 * |
|
35 */ |
|
36 class MNcdDownloadOperationObserver |
|
37 { |
|
38 |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Called when a download has progressed. The progress value |
|
43 * is relative to the current file being downloaded. |
|
44 * |
|
45 * |
|
46 * @param aOperation The operation that sent the event. |
|
47 * @param aProgress Progress of the operation. |
|
48 */ |
|
49 virtual void DownloadProgress( MNcdDownloadOperation& aOperation, |
|
50 TNcdProgress aProgress ) = 0; |
|
51 |
|
52 /** |
|
53 * Called when a query has been received for an operation. |
|
54 * |
|
55 * @note Querys need to be completed with MNcdOperation::CompleteQueryL() |
|
56 * to continue the operation! Alternatively, the operation must be |
|
57 * cancelled. |
|
58 * |
|
59 * |
|
60 * @see MNcdOperation |
|
61 * @see MNcdQuery |
|
62 * @param aOperation The operation that sent the event. |
|
63 * @param aQuery Pointer to the query object that needs to be |
|
64 * completed. Counted, Release() must be called after use. |
|
65 * @see MNcdOperation::CompleteQueryL() |
|
66 */ |
|
67 virtual void QueryReceived( MNcdDownloadOperation& aOperation, |
|
68 MNcdQuery* aQuery ) = 0; |
|
69 |
|
70 /** |
|
71 * Called when an operation has been completed. |
|
72 * |
|
73 * |
|
74 * @param aOperation The operation that sent the event. |
|
75 * @param aError Error code for operation completion. |
|
76 * KErrNone for successful completion, otherwise a system |
|
77 * wide error code. |
|
78 */ |
|
79 virtual void OperationComplete( MNcdDownloadOperation& aOperation, |
|
80 TInt aError ) = 0; |
|
81 |
|
82 }; |
|
83 |
|
84 #endif // M_NCD_DOWNLOAD_OPERATION_OBSERVER_H |