1 /* |
|
2 * Copyright (c) 2003-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: Declaration of the CVpnManagementUiLogContainer class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __VPNMANAGEMENTUILOGCONTAINER_H__ |
|
22 #define __VPNMANAGEMENTUILOGCONTAINER_H__ |
|
23 // INCLUDES |
|
24 #include "vpnmanagementuilogview.h" |
|
25 #include "eventviewer2.h" |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CAknIconArray; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * CVpnManagementUiLogContainer container control class. |
|
35 * |
|
36 * @lib vpnmanagementui.lib |
|
37 */ |
|
38 class CVpnManagementUiLogContainer : public CCoeControl, MCoeControlObserver, MEikListBoxObserver |
|
39 { |
|
40 |
|
41 /** |
|
42 * Policy Container needs to get access to CVpnManagementUiLogView's DoActivateL |
|
43 */ |
|
44 friend void CVpnManagementUiLogView::DoActivateL(const TVwsViewId&, TUid, const TDesC8&); |
|
45 |
|
46 public: // functions |
|
47 |
|
48 /** |
|
49 * Overrided Default constructor |
|
50 */ |
|
51 CVpnManagementUiLogContainer(CVpnManagementUiLogView& aParent, CVpnUiLoader& aLoader); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CVpnManagementUiLogContainer(); |
|
57 |
|
58 /** |
|
59 * Change focus |
|
60 */ |
|
61 void FocusChanged(TDrawNow aDrawNow); |
|
62 |
|
63 /** |
|
64 * From CCoeControl |
|
65 */ |
|
66 void HandleResourceChange( TInt aType ); |
|
67 |
|
68 /** |
|
69 * Draws listbox, fetches graphic icons for markable list |
|
70 */ |
|
71 void DrawListBoxL(TInt aCurrentPosition, TInt aTopItem); |
|
72 |
|
73 /** |
|
74 * Gets previous log event and updates listbox. |
|
75 * @return KErrNone or KErrNotFound. |
|
76 */ |
|
77 TInt UpdateListBoxL(TInt& aCurrentPosition); |
|
78 |
|
79 /** |
|
80 * Handles listbox events |
|
81 */ |
|
82 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
83 |
|
84 /** |
|
85 * Gets list of Log events and displays them in listbox. |
|
86 */ |
|
87 void ShowLogsL(); |
|
88 |
|
89 /** |
|
90 * Creates the log details message query |
|
91 * Appends strings from resource and eventviewer to one |
|
92 * message body text and displays it. |
|
93 */ |
|
94 void LogDetailsL(TInt aIndex); |
|
95 |
|
96 /** |
|
97 * Asks confirmation from user. |
|
98 * Clears VPN log view. |
|
99 * Calls eventviewer to clear log. |
|
100 */ |
|
101 void ClearLogL(); |
|
102 |
|
103 public: // data |
|
104 |
|
105 /** |
|
106 * To handle listbox |
|
107 * Cannot be private because CVpnManagementUiLogView uses it |
|
108 */ |
|
109 CAknDoubleGraphicStyleListBox* iListBox; |
|
110 |
|
111 /** |
|
112 * To get hold of PolicyView |
|
113 */ |
|
114 CVpnManagementUiLogView& iParent; |
|
115 |
|
116 /** |
|
117 * To get hold of CVpnUiLoader |
|
118 */ |
|
119 CVpnUiLoader& iLoader; |
|
120 |
|
121 /** |
|
122 * To store the list item count |
|
123 */ |
|
124 TInt iListItemCount; |
|
125 |
|
126 private: // functions |
|
127 |
|
128 /** |
|
129 * Default constructor |
|
130 */ |
|
131 CVpnManagementUiLogContainer(); |
|
132 |
|
133 /** |
|
134 * Symbian OS default constructor. |
|
135 * @param aRect Frame rectangle for container. |
|
136 */ |
|
137 void ConstructL(const TRect& aRect, TInt& aCurrentPosition); |
|
138 |
|
139 /** |
|
140 * Creates listbox, sets empty listbox text |
|
141 */ |
|
142 void CreateListBoxL(); |
|
143 |
|
144 /** |
|
145 * Reads text from resource to empty log view |
|
146 * and put text to the listbox. |
|
147 */ |
|
148 void EmptyViewTextL(); |
|
149 |
|
150 /** |
|
151 * Reads text from resource |
|
152 */ |
|
153 void ReadResourceL(HBufC& aText, TInt aResource); |
|
154 |
|
155 /** |
|
156 * Removes all from listbox. |
|
157 */ |
|
158 void RemoveAllFromListBoxL(); |
|
159 |
|
160 /** |
|
161 * From CoeControl,SizeChanged. |
|
162 */ |
|
163 void SizeChanged(); |
|
164 |
|
165 /** |
|
166 * From CoeControl,CountComponentControls. |
|
167 */ |
|
168 TInt CountComponentControls() const; |
|
169 |
|
170 /** |
|
171 * From CCoeControl,ComponentControl. |
|
172 */ |
|
173 CCoeControl* ComponentControl(TInt aIndex) const; |
|
174 |
|
175 /** |
|
176 * Handles control events |
|
177 * |
|
178 * event handling section |
|
179 * e.g Listbox events |
|
180 */ |
|
181 void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); |
|
182 |
|
183 /** |
|
184 * Handles the key events OK button, arrow keys, delete key. |
|
185 */ |
|
186 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
187 |
|
188 /** |
|
189 * Creates the iconarray. 0th icon is info icon, |
|
190 * 1st icon is warning icon and 2nd icon is error icon. |
|
191 * @return The created iconarray. Owner is the caller. |
|
192 */ |
|
193 CAknIconArray* CreateIconArrayL() const; |
|
194 |
|
195 /** |
|
196 * Get resource id for the iconarray. |
|
197 * @return The resource id for the icon array. |
|
198 */ |
|
199 TInt IconArrayResourceId() const; |
|
200 |
|
201 /** |
|
202 * Get corresponding icon of category |
|
203 * @param aCategory category of logtext |
|
204 * @return The index of icon array. |
|
205 */ |
|
206 TInt GetIconArrayIndex(TLogCategory2& aCategory); |
|
207 |
|
208 /** |
|
209 * Formats date and time string for Log entry. |
|
210 */ |
|
211 void TimeLogEntryL(TDes& aDes, TTime aTime); |
|
212 |
|
213 /** |
|
214 * Searches all drive letters and tries |
|
215 * to find vpnmanagementui.mif file. |
|
216 * @return The full name and path of the MIF file |
|
217 * containing icons for VPN Log view |
|
218 */ |
|
219 TFileName CVpnManagementUiLogContainer::GetIconFilenameL(); |
|
220 |
|
221 |
|
222 |
|
223 #ifdef __SERIES60_HELP |
|
224 /** |
|
225 * This function is called when Help application is launched. |
|
226 * (other items were commented in a header). |
|
227 */ |
|
228 void GetHelpContext(TCoeHelpContext& aContext) const; |
|
229 #endif //__SERIES60_HELP |
|
230 |
|
231 private: //data |
|
232 |
|
233 CEventViewer* iEventViewer; |
|
234 CArrayFixFlat<TEventProperties>* iLogList; |
|
235 }; |
|
236 |
|
237 #endif // __VPNMANAGEMENTUILOGCONTAINER_H__ |
|
238 |
|
239 // End of File |
|