1 /* |
|
2 * Copyright (c) 2005, 2009 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: Declares container control for application. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef USBCLASSCHANGEUIPLUGINCONTAINER_H |
|
20 #define USBCLASSCHANGEUIPLUGINCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <eikfrlb.h> |
|
25 #include <eikclb.h> |
|
26 #include <aknlists.h> |
|
27 #include <AknInfoPopupNoteController.h> |
|
28 #include <AknIconArray.h> |
|
29 #include "USBClassChangeUIPlugin.hrh" |
|
30 |
|
31 // CONSTANTS |
|
32 /** number of controls inside this component */ |
|
33 const TInt KUSBClassChangeUIComponentCount = 1; |
|
34 const TInt KUSBClassChangeUIIconGranularity = 3; |
|
35 const TInt KMaxVisibleTime = 3500; |
|
36 const TInt KMsToWaitBeforePopup = 1000; |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class CUSBClassChangeUIPluginView; |
|
40 class CUSBClassChangeUIPluginModel; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * This class handles main view dependent requests from user and |
|
46 * contains listbox for main view items. |
|
47 * @lib |
|
48 */ |
|
49 class CUSBClassChangeUIPluginContainer : public CCoeControl, |
|
50 public MEikListBoxObserver, |
|
51 public MDesCArray |
|
52 { |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Factory method NewL |
|
57 * @return a pointer to itself |
|
58 */ |
|
59 static CUSBClassChangeUIPluginContainer* NewL( |
|
60 CUSBClassChangeUIPluginView* aView, |
|
61 CUSBClassChangeUIPluginModel* aModel ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CUSBClassChangeUIPluginContainer(); |
|
67 |
|
68 private: |
|
69 |
|
70 /** |
|
71 * C++ constructor. |
|
72 */ |
|
73 CUSBClassChangeUIPluginContainer( |
|
74 CUSBClassChangeUIPluginView* aView, |
|
75 CUSBClassChangeUIPluginModel* aModel); |
|
76 |
|
77 /** |
|
78 * Symbian 2nd phase constructor. |
|
79 */ |
|
80 void ConstructL(); |
|
81 |
|
82 public: // new functions |
|
83 |
|
84 /** |
|
85 * Handles setting changes. |
|
86 */ |
|
87 void SettingChanged(); |
|
88 |
|
89 /** |
|
90 * Handles screen resolution changes |
|
91 * @param aType informs the type of resource change |
|
92 */ |
|
93 void HandleResourceChange( TInt aType ); |
|
94 |
|
95 /** |
|
96 * Returns the current item index (highlight position) |
|
97 * for main setting list. |
|
98 * @return Current item index. |
|
99 */ |
|
100 TInt CurrentItemIndex(); |
|
101 |
|
102 // MDesCArray implementation |
|
103 |
|
104 /** |
|
105 * Returns number of items in array / main list. |
|
106 * @return Number of items. |
|
107 */ |
|
108 TInt MdcaCount() const; |
|
109 |
|
110 /** |
|
111 * Returns the current format string for the given item. |
|
112 * @param aIndex Index of the item. |
|
113 * @return Pointer to the format string. |
|
114 */ |
|
115 TPtrC MdcaPoint( TInt aIndex ) const; |
|
116 |
|
117 /** |
|
118 * selects the string to be passed to ShowPopUpL |
|
119 * @param aValue is the index of the item in the list. |
|
120 */ |
|
121 void ShowPopUpsL( TInt aIndex); |
|
122 |
|
123 private: // Functions from base classes |
|
124 |
|
125 /** |
|
126 * From CoeControl Gets the number of controls contained |
|
127 * in a compound control. |
|
128 * @return The number of component controls contained by this control. |
|
129 */ |
|
130 TInt CountComponentControls() const; |
|
131 |
|
132 /** |
|
133 * From CoeControl Gets the specified component of a compound control. |
|
134 * @param aIndex The index of the control to get. |
|
135 * @return Reference to the component control. |
|
136 */ |
|
137 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
138 |
|
139 /** |
|
140 * From CoeControl Handles key events. |
|
141 * @param aKeyEvent The key event that occurred. |
|
142 * @param aType The event type. |
|
143 * @return Response to the key event. |
|
144 */ |
|
145 TKeyResponse OfferKeyEventL( |
|
146 const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
147 |
|
148 /** |
|
149 * From CoeControl Gets the control's help context. |
|
150 * @param aContext The control's help context |
|
151 */ |
|
152 void GetHelpContext(TCoeHelpContext& aContext) const; |
|
153 |
|
154 /** |
|
155 * From CoeControl Responds to size changes. |
|
156 * Sets the size and position of the contents of this control. |
|
157 */ |
|
158 void SizeChanged(); |
|
159 |
|
160 /** |
|
161 * From CoeControl Responds to a change in focus. |
|
162 * @param aDrawnow Contains the value that was passed to it by |
|
163 * SetFocus(). |
|
164 */ |
|
165 void FocusChanged( TDrawNow aDrawnow ); |
|
166 |
|
167 |
|
168 protected: |
|
169 /** |
|
170 * From MEikListBoxObserver Handles list box events. |
|
171 * @param aListBox The originating list box. |
|
172 * @param aEventType The event type. |
|
173 */ |
|
174 void HandleListBoxEventL( |
|
175 CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
176 |
|
177 private: // Data |
|
178 |
|
179 // The setting items listbox |
|
180 // owned by this class |
|
181 CAknDoubleLargeStyleListBox* iUSBMainListBox; |
|
182 // Reference to appui object |
|
183 CUSBClassChangeUIPluginView* iViewRef; |
|
184 // To get personality IDs arrays |
|
185 // not owned by this class |
|
186 CUSBClassChangeUIPluginModel* iModelRef; |
|
187 // All format string combinations |
|
188 // owned by this class |
|
189 CDesCArrayFlat* iUSBAllItemsArray; |
|
190 // All format string combinations |
|
191 // owned by this class |
|
192 CDesCArrayFlat* iUSBAllItemsArrayDefault; |
|
193 // All format string combinations |
|
194 // owned by this class |
|
195 CDesCArrayFlat* iUSBAllItemsArrayActive; |
|
196 // All format string combinations |
|
197 // owned by this class |
|
198 CDesCArrayFlat* iPopUpItems; |
|
199 |
|
200 // Current highlighted main list item |
|
201 TInt iCurrentItemIndex; |
|
202 |
|
203 // The controller for the PopUps (tooltips) in UI Setting view |
|
204 // owned by this class |
|
205 CAknInfoPopupNoteController* iPopupController; |
|
206 |
|
207 }; |
|
208 |
|
209 #endif |
|
210 |
|
211 // End of File |
|