|
1 /* |
|
2 * Copyright (c) 2004 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: Shows reconnect continuation global confirmation query and |
|
15 * follows user answering |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CIMPSRECONNECTNOTEHANDLER_H |
|
22 #define __CIMPSRECONNECTNOTEHANDLER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include "impspresenceconnectionuiconstsng.h" |
|
26 #include <e32base.h> |
|
27 #include <e32std.h> |
|
28 #include <f32file.h> |
|
29 #include <barsc.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class MIMPSReconnectNoteObserver; |
|
33 class CAknGlobalConfirmationQuery; |
|
34 class CIMPSPresenceAAConnection; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * class for showing global confirmation query for continuing reconnecting |
|
40 * @lib PEngAOPlugin.lib |
|
41 * @since 2.1 |
|
42 */ |
|
43 class CIMPSReconnectNoteHandler : public CActive |
|
44 { |
|
45 |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CIMPSReconnectNoteHandler* NewL( TIMPSConnectionClient aClient ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CIMPSReconnectNoteHandler(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Shows global note, if not already shown and adds observer |
|
62 * to listen answer for global note |
|
63 * @param aObserver Observer for global note |
|
64 */ |
|
65 void ShowNote( MIMPSReconnectNoteObserver* aObserver ); |
|
66 |
|
67 /** |
|
68 * Stops global note showing, and informs other observers |
|
69 * ands removes observer for global note |
|
70 * @param aObserver Observer for global note |
|
71 */ |
|
72 void CancelNoteShowing( MIMPSReconnectNoteObserver* aObserver ); |
|
73 |
|
74 /** |
|
75 * Mark the testing class a friend, because this class is not "public" class |
|
76 */ |
|
77 friend class T_CIMPSReconnectNoteHandler; // CSI: 36 # Only used for testing |
|
78 |
|
79 protected: // From CActive |
|
80 |
|
81 /** |
|
82 * @see CActive. |
|
83 */ |
|
84 void DoCancel(); |
|
85 |
|
86 /** |
|
87 * @see CActive. |
|
88 */ |
|
89 void RunL(); |
|
90 |
|
91 /** |
|
92 * @see CActive. |
|
93 */ |
|
94 TInt RunError( TInt aError ); |
|
95 |
|
96 private: |
|
97 |
|
98 /** |
|
99 * C++ default constructor. |
|
100 */ |
|
101 CIMPSReconnectNoteHandler(); |
|
102 |
|
103 /** |
|
104 * By default Symbian 2nd phase constructor is private. |
|
105 */ |
|
106 void ConstructL( TIMPSConnectionClient aClient ); |
|
107 |
|
108 private: // helpers |
|
109 |
|
110 /** |
|
111 * Starts the call observing |
|
112 */ |
|
113 void DoShowNoteL( MIMPSReconnectNoteObserver* aObserver ); |
|
114 |
|
115 /** |
|
116 * Adds observer to observer array if not already there. |
|
117 * @param aObserver Call observer |
|
118 * @since 2.6 |
|
119 */ |
|
120 void AddObserverL( MIMPSReconnectNoteObserver* aObserver ); |
|
121 |
|
122 /** |
|
123 * Removes observer to observer array if found from array |
|
124 * @param aObserver Call observer |
|
125 * @since 2.6 |
|
126 */ |
|
127 void RemoveObserver( MIMPSReconnectNoteObserver* aObserver ); |
|
128 |
|
129 /** |
|
130 * Calls HandleNoteAnswered for all observers |
|
131 * @param TInt value of answer |
|
132 */ |
|
133 void HandleNoteAnswered( TInt aAnswer ); |
|
134 |
|
135 /** |
|
136 * Calls HandleNoteCanceled for all observers |
|
137 */ |
|
138 void HandleNoteCancelled(); |
|
139 |
|
140 /** |
|
141 * Loads prompt text resource |
|
142 * @return prompt text |
|
143 */ |
|
144 HBufC* PromptTextLC(); |
|
145 |
|
146 /** |
|
147 * Reads TBUF resource with given id |
|
148 * @param aNoteTextResourceId TBUF resource id |
|
149 * @return read resource as string |
|
150 */ |
|
151 HBufC* ReadResourceLC( TInt aNoteTextResourceId ); |
|
152 |
|
153 /** |
|
154 * Reads TBUF resource wit given id and replaces |
|
155 * %s with given text |
|
156 * @param aNoteTextResourceId TBUF resource id |
|
157 * @param aInsertText text to replace |
|
158 * @return read resource as string |
|
159 */ |
|
160 HBufC* ReadResourceWithDynTextLC( TInt aNoteTextResourceId, |
|
161 const TDesC& aInsertText ); |
|
162 |
|
163 private: // Data |
|
164 |
|
165 /// Array for observing objects. |
|
166 RPointerArray<MIMPSReconnectNoteObserver> iObservers; |
|
167 |
|
168 /// Global confirmation query, owned |
|
169 CAknGlobalConfirmationQuery* iGlobalConfirmationQuery; |
|
170 |
|
171 /// A pointer to the connection UI, owned |
|
172 /// Used for fetching default server name |
|
173 CIMPSPresenceAAConnection* iConnectionUI; |
|
174 |
|
175 /// File server session, owned |
|
176 RFs iFs; |
|
177 |
|
178 /// IMPS AO plugin resource file, owned |
|
179 RResourceFile iResFile; |
|
180 |
|
181 TIMPSConnectionClient iClient; |
|
182 |
|
183 }; |
|
184 |
|
185 #endif // __CIMPSRECONNECTNOTEHANDLER_H |
|
186 |
|
187 // End of File |
|
188 |