|
1 /* |
|
2 * Copyright (c) 2009 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: Attachment progress info |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CMRATTACHMENTPROGRESSINFO_H |
|
19 #define CMRATTACHMENTPROGRESSINFO_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <aknprogressdialog.h> |
|
23 #include <f32file.h> |
|
24 |
|
25 #include "cmrfilemanager.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CAsyncCallBack; |
|
29 |
|
30 // CLASS DECLRATIONS |
|
31 /** |
|
32 * |
|
33 */ |
|
34 NONSHARABLE_CLASS( CMRAttachmentProgressInfo ) |
|
35 : public CBase, public MProgressDialogCallback, public MMRFileManObserver |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * static c'tor |
|
40 */ |
|
41 static CMRAttachmentProgressInfo* NewL( CMRFileManager& aFileMan, MProgressDialogCallback& aObserver ); |
|
42 /** |
|
43 * d'tor |
|
44 */ |
|
45 ~CMRAttachmentProgressInfo(); |
|
46 |
|
47 public: // Inteface |
|
48 /** |
|
49 * Start the progress note |
|
50 * @param aFinalValue End value of the process |
|
51 */ |
|
52 void StartProgressNoteL(TInt aFinalValue); |
|
53 /** |
|
54 * Stop the progress. The dialog is dismissed. |
|
55 */ |
|
56 void StopL(); |
|
57 |
|
58 public: // From MFileManObserver |
|
59 void NotifyStartL( const TDesC& aFilename ); |
|
60 void NotifyProgress( TInt aBytesCopied ); |
|
61 void NotifyEnd(); |
|
62 void NotifyError( TInt aError ); |
|
63 |
|
64 protected: // Inteface |
|
65 /** |
|
66 * The observer will be notified |
|
67 */ |
|
68 void NotifyObserver(); |
|
69 /** |
|
70 * Static callback function |
|
71 */ |
|
72 static TInt NotifyObserverCallback( TAny* aThis ); |
|
73 |
|
74 protected: // From MProgressDialogCallback |
|
75 void DialogDismissedL (TInt aButtonId); |
|
76 |
|
77 private: |
|
78 CMRAttachmentProgressInfo( CMRFileManager& aFileMan, MProgressDialogCallback& aObserver ); |
|
79 |
|
80 private: |
|
81 /// Ref: |
|
82 CAknProgressDialog* iProgressDialog; |
|
83 /// Ref: |
|
84 CEikProgressInfo* iProgressInfo; |
|
85 /// Ref: Manages the file copy op |
|
86 CMRFileManager& iFileMan; |
|
87 /// Own: Total amount of copied bytes |
|
88 TInt iBytesTransferred; |
|
89 /// Ref: Client observer |
|
90 MProgressDialogCallback& iObserver; |
|
91 /// Own: To make observer notification async |
|
92 CAsyncCallBack* iAsynCallBack; |
|
93 /// Own: Size of the attachment file |
|
94 TInt iAttachmentSize; |
|
95 }; |
|
96 |
|
97 #endif // CMRATTACHMENTPROGRESSINFO_H |
|
98 // End of file |