|
1 /* |
|
2 * Copyright (c) 2003-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: Declaration of the CCertManUIContainerTrustedSite class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CERTMANUICONTAINERTRUSTEDSITE_H |
|
20 #define CERTMANUICONTAINERTRUSTEDSITE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "CertmanuiviewTrustedSite.h" |
|
24 |
|
25 // CLASS DECLARATION |
|
26 |
|
27 class CAknIconArray; |
|
28 |
|
29 /** |
|
30 * CCertManUIContainerTrustedSite container control class. |
|
31 * |
|
32 * @lib certmanui.lib |
|
33 */ |
|
34 NONSHARABLE_CLASS( CCertManUIContainerTrustedSite ): |
|
35 public CCoeControl, public MCoeControlObserver, public MEikListBoxObserver |
|
36 { |
|
37 |
|
38 /** |
|
39 * Container trusted site needs to get access to CCertManUIViewTrustedSite's DoActivateL |
|
40 */ |
|
41 friend void CCertManUIViewTrustedSite::DoActivateL( const TVwsViewId&, |
|
42 TUid, const TDesC8& ); |
|
43 |
|
44 public: // functions |
|
45 |
|
46 /** |
|
47 * Overrided Default constructor |
|
48 */ |
|
49 CCertManUIContainerTrustedSite( CCertManUIViewTrustedSite& aParent, |
|
50 CCertManUIKeeper& aKeeper ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CCertManUIContainerTrustedSite(); |
|
56 |
|
57 /** |
|
58 * Change focus |
|
59 */ |
|
60 void FocusChanged( TDrawNow aDrawNow ); |
|
61 |
|
62 /** |
|
63 * Draws listbox, fetches graphic icons for markable list |
|
64 */ |
|
65 void DrawListBoxL( TInt aCurrentPosition, TInt aTopItem ); |
|
66 |
|
67 /** |
|
68 * Gets list of certificates from CertManAPI, displays them, |
|
69 * sets No label/No subject text to them if their names are empty |
|
70 */ |
|
71 void UpdateListBoxL( TInt& aCurrentPosition, TInt& aTopItem ); |
|
72 |
|
73 /** |
|
74 * Handles listbox events |
|
75 */ |
|
76 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
77 |
|
78 /** |
|
79 * Handles resource change |
|
80 */ |
|
81 void HandleResourceChange( TInt aType ); |
|
82 |
|
83 public: // data |
|
84 |
|
85 /** |
|
86 * To handle listbox |
|
87 * Type column for making the list markable |
|
88 * Cannot be private because CertManUIViewTrust uses it |
|
89 */ |
|
90 CEikColumnListBox* iListBox; |
|
91 |
|
92 /** |
|
93 * To get hold of ViewAuthority |
|
94 */ |
|
95 CCertManUIViewTrustedSite& iParent; |
|
96 |
|
97 /** |
|
98 * To get hold of CertManUIKeeper |
|
99 */ |
|
100 CCertManUIKeeper& iKeeper; |
|
101 |
|
102 /** |
|
103 * To store the list item count |
|
104 */ |
|
105 TInt iListItemCount; |
|
106 |
|
107 private: // functions |
|
108 |
|
109 /** |
|
110 * Default constructor |
|
111 */ |
|
112 CCertManUIContainerTrustedSite(); |
|
113 |
|
114 /** |
|
115 * EPOC default constructor. |
|
116 * @param aRect Frame rectangle for container. |
|
117 */ |
|
118 void ConstructL( const TRect& aRect, TInt& aCurrentPosition, TInt& aTopItem ); |
|
119 |
|
120 /** |
|
121 * Creates listbox, sets empty listbox text |
|
122 */ |
|
123 void CreateListBoxL(); |
|
124 |
|
125 /** |
|
126 * From CoeControl,SizeChanged. |
|
127 */ |
|
128 void SizeChanged(); |
|
129 |
|
130 /** |
|
131 * From CoeControl,CountComponentControls. |
|
132 */ |
|
133 TInt CountComponentControls() const; |
|
134 |
|
135 /** |
|
136 * From CCoeControl,ComponentControl. |
|
137 */ |
|
138 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
139 |
|
140 /** |
|
141 * From CCoeControl,Draw. |
|
142 */ |
|
143 void Draw( const TRect& aRect ) const; |
|
144 |
|
145 /** |
|
146 * Handles control events |
|
147 * Cannot be changed to non-leaving function. |
|
148 * L-function is required by the class definition, even if empty. |
|
149 */ |
|
150 void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); |
|
151 |
|
152 /** |
|
153 * Handles the key events OK button, arrow keys, delete key. |
|
154 * OK button functionality is different depending on the number of marked items |
|
155 * in the list; zero marked -> show details view, one or more marked -> show |
|
156 * OKOptions list, list empty -> OK inactive. |
|
157 * Delete active only if list not empty. |
|
158 */ |
|
159 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
160 |
|
161 /** |
|
162 * Create the iconarray. Derived classes please don't forget that the |
|
163 * 0th icon must be the markable listbox's mark icon. |
|
164 * @return The created iconarray. Owner is the caller. |
|
165 */ |
|
166 CAknIconArray* CreateIconArrayL() const; |
|
167 |
|
168 /** |
|
169 * Get resource id for the iconarray. |
|
170 * @return The resource id for the iconarray. |
|
171 */ |
|
172 TInt IconArrayResourceId() const; |
|
173 |
|
174 /** |
|
175 * This function is called when Help application is launched. |
|
176 * (other items were commented in a header). |
|
177 */ |
|
178 void GetHelpContext(TCoeHelpContext& aContext) const; |
|
179 |
|
180 protected: //data |
|
181 |
|
182 /** |
|
183 * If ETrue, OK-Options menu is shown instead of normal Options menu. |
|
184 */ |
|
185 TBool iShowOkOptions; |
|
186 |
|
187 private: //data |
|
188 |
|
189 /** |
|
190 * Icon handler (this creates icons and calculates icon indexes). |
|
191 */ |
|
192 const CCertManUIContainerTrustedSite* iIconHandler; |
|
193 }; |
|
194 |
|
195 #endif // CERTMANUICONTAINERTRUSTEDSITE_H |
|
196 |
|
197 // End of File |
|
198 |
|
199 |