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