|
1 /* |
|
2 * Copyright (c) 2010 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: Active object wrapper to handle popup note. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __NETWORKNOTIFIER_WRAPPER_H__ |
|
19 #define __NETWORKNOTIFIER_WRAPPER_H__ |
|
20 |
|
21 // SYSTEM INCLUDES |
|
22 #include <e32base.h> |
|
23 #include <f32file.h> |
|
24 |
|
25 // INCLUDES |
|
26 #include <nwnotifier_0x20026826.rsg> |
|
27 |
|
28 // FORWARD CLASS DECLARATIONS |
|
29 class CAknGlobalConfirmationQuery; |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 _LIT( KResFile, "\\resource\\apps\\NWNotifier_0x20026826.rsc" ); |
|
34 |
|
35 |
|
36 // OBSERVER DECLARATION |
|
37 class MNoteWrapperObserver |
|
38 { |
|
39 public: |
|
40 |
|
41 virtual void PopupNoteClosed( ) = 0; |
|
42 }; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 /** |
|
46 * This Class provides implementation for handling the error notes |
|
47 */ |
|
48 |
|
49 class CNetworkNotifierNoteWrapper : public CActive |
|
50 { |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 */ |
|
56 static CNetworkNotifierNoteWrapper* NewL( MNoteWrapperObserver& aObserver, |
|
57 TInt aResID ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 ~CNetworkNotifierNoteWrapper(); |
|
63 |
|
64 /** |
|
65 * Monitor inserts the latest error notification err# from ETEL to this stack. |
|
66 * @param aResID Resource id of the note to be added to the notestack. |
|
67 */ |
|
68 void AppendNote( const TInt aResID ); |
|
69 |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * C++ default constructor. |
|
75 * @param aObserver Reference to observer class. CNWRegistrationStatus is listening. |
|
76 * @param aResID Resource id number to be inserted into the notestack. |
|
77 */ |
|
78 CNetworkNotifierNoteWrapper( MNoteWrapperObserver& aObserver, |
|
79 TInt aResID ); |
|
80 |
|
81 /** |
|
82 * Second-phase constructor. |
|
83 * |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 /** |
|
88 * Informs object that asyncronous request is ready. |
|
89 * |
|
90 */ |
|
91 void RunL(); |
|
92 |
|
93 /** |
|
94 * Cancels asyncronous request(s). |
|
95 * |
|
96 */ |
|
97 void DoCancel(); |
|
98 |
|
99 /** |
|
100 * From CActive, RunError. |
|
101 * Processes any errors. |
|
102 * @param aError The leave code reported. |
|
103 * @result return KErrNone if leave is handled. |
|
104 */ |
|
105 TInt RunError( TInt aError ); |
|
106 |
|
107 /** |
|
108 * Reads the localized error strings from resource. |
|
109 * @return The localized error string. |
|
110 */ |
|
111 HBufC* ReadResourceLC(); |
|
112 |
|
113 /** |
|
114 * Displays the error note passed as a parameter. |
|
115 * @param aNote Pointer to the note. |
|
116 */ |
|
117 void DisplayPopupNoteL( HBufC* aNote ); |
|
118 |
|
119 private: // Data |
|
120 |
|
121 // Handle to file server |
|
122 RFs iFs; |
|
123 |
|
124 // Note |
|
125 CAknGlobalConfirmationQuery* iGlobalQuery; |
|
126 |
|
127 // Callback receiver |
|
128 MNoteWrapperObserver& iObserver; |
|
129 |
|
130 // Error note stack<resourceID> |
|
131 RArray<TInt> iErrNotes; |
|
132 }; |
|
133 |
|
134 #endif // __NETWORKNOTIFIER_WRAPPER_H__ |