|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Logs "Settings" view container control class implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __Logs_App_CLogsSettingsControlContainer_H__ |
|
21 #define __Logs_App_CLogsSettingsControlContainer_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include "CLogsBaseControlContainer.h" |
|
25 |
|
26 #include "LogsEng.hrh" |
|
27 |
|
28 |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // DATA TYPES |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class CAknSettingStyleListBox; |
|
40 class CLogsSettingsView; |
|
41 |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Logs "Settings" view container control class implementation. |
|
47 */ |
|
48 class CLogsSettingsControlContainer : |
|
49 public CLogsBaseControlContainer |
|
50 |
|
51 { |
|
52 public: // interface |
|
53 /** |
|
54 * Standard creation function. |
|
55 * |
|
56 * @param aSettingsView this control's creation view. |
|
57 * @param aRect client rect |
|
58 * @param aForGs Is created for general settings |
|
59 * @return new object |
|
60 */ |
|
61 static CLogsSettingsControlContainer* NewL |
|
62 ( CLogsSettingsView* aSettingsView, |
|
63 const TRect& aRect, |
|
64 TBool aForGs ); |
|
65 |
|
66 /** |
|
67 * Destructor. Deletes child controls. |
|
68 */ |
|
69 ~CLogsSettingsControlContainer(); |
|
70 |
|
71 private: |
|
72 /** |
|
73 * Constructor, second phase. |
|
74 * |
|
75 * @param aRect client rect. |
|
76 * @param aForGs |
|
77 */ |
|
78 void ConstructL( const TRect& aRect, |
|
79 TBool aForGs ); |
|
80 |
|
81 /** |
|
82 * C++ constructor |
|
83 * @param aSettingsView this control's creation view. |
|
84 */ |
|
85 CLogsSettingsControlContainer( CLogsSettingsView* aSettingsView ); |
|
86 public: |
|
87 /** |
|
88 * Returns the iListBox. |
|
89 * @return listbox |
|
90 */ |
|
91 CAknSettingStyleListBox* ListBox(); |
|
92 |
|
93 public: // operations |
|
94 /** |
|
95 * Create empty listbox. |
|
96 */ |
|
97 void CreateListBoxL(); |
|
98 |
|
99 /** |
|
100 * Update listbox contents by using resource and model information. |
|
101 */ |
|
102 void UpdateListBoxContentL(); |
|
103 |
|
104 private: // from CCoeControl |
|
105 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
106 TEventCode aType ); |
|
107 |
|
108 /** |
|
109 * Returns the child controls at aIndex. |
|
110 * |
|
111 * @param aIndex Control's index. |
|
112 * |
|
113 * @return Sub control from the aIndex. |
|
114 */ |
|
115 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
116 |
|
117 /** |
|
118 * Called when control's size changed. |
|
119 */ |
|
120 void SizeChanged(); |
|
121 |
|
122 public: // Called from Settings view (not from Gs appui as usual) |
|
123 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
124 |
|
125 private: // operations |
|
126 |
|
127 /** |
|
128 * Makes Setting view's one line with the current information |
|
129 * |
|
130 * @param aItems Array where to put the line information |
|
131 * @param aFirstResourceText First line's resource id |
|
132 * @param aSecondResourceText Second line's resource id |
|
133 */ |
|
134 void AddOneListBoxTextLineL( CDesCArrayFlat* aItems, |
|
135 TInt aFirstResourceText, |
|
136 TInt aSecondResourceText ); |
|
137 |
|
138 /** |
|
139 * Handles focus change events. This will hand over focus changes to list so that |
|
140 * focus animations are displayed on the list. |
|
141 */ |
|
142 void FocusChanged(TDrawNow aDrawNow); |
|
143 |
|
144 |
|
145 |
|
146 private: // data |
|
147 |
|
148 /// Own: ListBox control |
|
149 CAknSettingStyleListBox* iListBox; |
|
150 |
|
151 /// Ref: Pointer to the SettingsView |
|
152 CLogsSettingsView* iSettingsView; |
|
153 |
|
154 /// Own: The index of the line that has the focus. |
|
155 TInt iCurrentListBoxIndex; |
|
156 |
|
157 /// Own: The index of the top line that has the focus. |
|
158 TInt iCurrentListBoxTopIndex; |
|
159 |
|
160 }; |
|
161 |
|
162 #endif // __Logs_App_CLogsSettingsControlContainer_H__ |
|
163 |
|
164 // End of File |