|
1 /* |
|
2 * Copyright (c) 2007 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: Wraps functions for showing some global dialogs. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CIAUPDATERDIALOG_H |
|
21 #define CIAUPDATERDIALOG_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <f32file.h> |
|
26 #include <barsc.h> |
|
27 #include <AknGlobalNote.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MIAUpdaterCancelObserver; |
|
31 |
|
32 /** |
|
33 * Class for showing the global note dialog when installing self update. |
|
34 * |
|
35 * @code |
|
36 * @endcode |
|
37 * @lib |
|
38 * @since S60 |
|
39 */ |
|
40 class CIAUpdaterDialog : public CActive |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CIAUpdaterDialog* NewL( RFs& aFs, MIAUpdaterCancelObserver& aObserver ); |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CIAUpdaterDialog* NewLC( RFs& aFs, MIAUpdaterCancelObserver& aObserver ); |
|
53 |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CIAUpdaterDialog(); |
|
59 |
|
60 |
|
61 /** |
|
62 * Show global waiting note (during installing). |
|
63 * |
|
64 * @param Current pkg's name for wait dialog. |
|
65 * @param Current pkg's index number for wait dialog. |
|
66 * @param aTotalCount Max pkg count for wait dialog. |
|
67 */ |
|
68 void ShowWaitingNoteL( const TDesC& aName, |
|
69 TInt aIndex, |
|
70 TInt aTotalCount ); |
|
71 |
|
72 /** |
|
73 * Cancel global waiting note (after installing). |
|
74 */ |
|
75 void CancelWaitingNoteL(); |
|
76 |
|
77 |
|
78 private: |
|
79 |
|
80 /** |
|
81 * Constructor. |
|
82 */ |
|
83 CIAUpdaterDialog( RFs& aFs, MIAUpdaterCancelObserver& aObserver ); |
|
84 |
|
85 /** |
|
86 * 2nd phase constructor. |
|
87 */ |
|
88 void ConstructL(); |
|
89 |
|
90 |
|
91 /** |
|
92 * Read resource string. |
|
93 * @since |
|
94 * @param aResourceId Id of the resource. |
|
95 * @return Resource buffer. |
|
96 */ |
|
97 HBufC* ReadResourceLC( TInt aResourceId ); |
|
98 |
|
99 private: // from CActive |
|
100 |
|
101 /** |
|
102 * Cancels async request |
|
103 * @see CActive::DoCancel |
|
104 * |
|
105 */ |
|
106 void DoCancel(); |
|
107 |
|
108 /** |
|
109 * When the server side has finished operation, the CActive object will |
|
110 * be informed about it, and as a result RunL will be called. This function |
|
111 * well inform the observer that the operation has been completed. |
|
112 * @see CActive::RunL |
|
113 * |
|
114 */ |
|
115 void RunL(); |
|
116 |
|
117 private: // data |
|
118 |
|
119 // Resource file. |
|
120 RResourceFile iResourceFile; |
|
121 |
|
122 // File server handle. |
|
123 RFs& iFs; |
|
124 |
|
125 CAknGlobalNote* iNote; |
|
126 |
|
127 // Dialog id for canceling dialog. |
|
128 TInt iNoteId; |
|
129 |
|
130 MIAUpdaterCancelObserver* iObserver; //not owned |
|
131 |
|
132 }; |
|
133 |
|
134 #endif // CIAUPDATERDIALOG_H |
|
135 |
|
136 // End of File |