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