|
1 /* |
|
2 * Copyright (c) 2005-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: The Service & MIME list dlg |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_DEFAULTAPPSRVMIMEDLG_H |
|
20 #define C_DEFAULTAPPSRVMIMEDLG_H |
|
21 |
|
22 |
|
23 #include <badesca.h> // CDesCArray |
|
24 #include <coecntrl.h> // CCoeControl |
|
25 #include <eiklbo.h> // MEikListBoxObserver |
|
26 |
|
27 |
|
28 #include <aknselectionlist.h> |
|
29 #include <aknsettingitemlist.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CAknDoubleStyleListBox; |
|
33 class CDefaultAppAppUi; |
|
34 //class CDefaultAppServMimeApps; |
|
35 |
|
36 /** |
|
37 * This is the Dialog class of the application |
|
38 * |
|
39 * This dialog displays a double list box and it can also display a pop-up list on top of it. |
|
40 * The elements of the lists are created by the engine (CDefaultAppServMimeApps class) |
|
41 * |
|
42 * @since S60 v5.0 |
|
43 */ |
|
44 class CDefaultAppSrvMimeDlg : public CAknSelectionListDialog, |
|
45 public MListBoxItemChangeObserver |
|
46 { |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Symbian OS two-phased constructor |
|
51 * @return |
|
52 */ |
|
53 static CDefaultAppSrvMimeDlg* NewL(CDefaultAppAppUi* aAppUi); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CDefaultAppSrvMimeDlg(); |
|
59 |
|
60 public: //from CAknSelectionListDialog |
|
61 |
|
62 /** |
|
63 * From CAknSelectionListDialog. |
|
64 * This function is called when buttons/softkeys are pressed, to check if the dlg should exit. |
|
65 * We always return EFalse, since this is a modeless & nonwaiting dialog. |
|
66 * |
|
67 * @since S60 v5.0 |
|
68 * @param aButtonId the list box for which the event happened |
|
69 */ |
|
70 virtual TBool OkToExitL(TInt aButtonId); |
|
71 |
|
72 /** |
|
73 * From CAknSelectionListDialog. |
|
74 * This function is called when a command is issued by the user. |
|
75 * |
|
76 * @since S60 v5.0 |
|
77 * @param aCommandId the list box for which the event happened |
|
78 */ |
|
79 virtual void ProcessCommandL(TInt aCommand); |
|
80 |
|
81 /** |
|
82 * From CAknSelectionListDialog. |
|
83 * This function is called during the construction of the dialog. |
|
84 * We build the list of elements here. |
|
85 * |
|
86 * @since S60 v5.0 |
|
87 */ |
|
88 virtual void PreLayoutDynInitL(); |
|
89 |
|
90 |
|
91 public: //from CAknDialog |
|
92 |
|
93 /** |
|
94 * From CAknDialog. |
|
95 * This function is called to complete the menu construction. |
|
96 * |
|
97 * @since S60 v5.0 |
|
98 * @param aResourceId the resource id |
|
99 * @param aMenuPane the menu class instance |
|
100 */ |
|
101 virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
102 |
|
103 public: //from CCoeControl |
|
104 |
|
105 /** |
|
106 * From CCoeControl. |
|
107 * This function is called to get the help context |
|
108 * |
|
109 * @since S60 v5.0 |
|
110 * @param aContext recipient for the help context |
|
111 */ |
|
112 virtual void GetHelpContext(TCoeHelpContext& aContext) const; |
|
113 |
|
114 /** |
|
115 * From CCoeControl. |
|
116 * Called by the framework when the view size is changed |
|
117 * |
|
118 * @since S60 v5.0 |
|
119 */ |
|
120 virtual void SizeChanged(); |
|
121 |
|
122 /** |
|
123 * From CCoeControl. |
|
124 * Called by the framework to process the key event |
|
125 * |
|
126 * @since S60 v5.0 |
|
127 */ |
|
128 virtual TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType); |
|
129 |
|
130 |
|
131 public: //own functions |
|
132 |
|
133 /** |
|
134 * Enables marquee for the list elements. |
|
135 * |
|
136 * @since S60 v5.0 |
|
137 */ |
|
138 void EnableMarqueeL(); |
|
139 |
|
140 |
|
141 /** |
|
142 * Part of the popup menu construction process: |
|
143 * gets 2 icons, the selected (ticked) and empty icon |
|
144 * |
|
145 * @since S60 v5.0 |
|
146 * @return an array with the 2 icons |
|
147 */ |
|
148 CArrayPtr<CGulIcon>* GetPopupListIconsL() const; |
|
149 |
|
150 /** |
|
151 * Creates a pop-up list for a selected item of the list-box. |
|
152 * |
|
153 * @since S60 v5.0 |
|
154 * @param aSelectedIndex the selected element (used to get the content of the pop-up list) |
|
155 */ |
|
156 void OpenMenuForSelectedServiceAndMimeL(TInt aSelectedIndex); |
|
157 public: |
|
158 //from MListBoxItemChangeObserver |
|
159 void ListBoxItemsChanged(CEikListBox* aListBox); |
|
160 |
|
161 private: //construction |
|
162 |
|
163 /** |
|
164 * C++ default constructor. |
|
165 */ |
|
166 CDefaultAppSrvMimeDlg(CDefaultAppAppUi* aAppUi, TInt *aSelected); |
|
167 |
|
168 private: //data |
|
169 /** |
|
170 * Pointer to the AppUi |
|
171 * Not Owned. |
|
172 */ |
|
173 CDefaultAppAppUi* iDefaultAppUi; |
|
174 |
|
175 /** |
|
176 * The index of the selected element in the list. This is pointer to AppUI's index |
|
177 * Not owned. |
|
178 */ |
|
179 TInt *iSelected; |
|
180 |
|
181 /** |
|
182 * Flag allowing to exit the dialog |
|
183 */ |
|
184 TBool iOkToExit; |
|
185 |
|
186 /** |
|
187 * Pointer refer to CAknPopupList |
|
188 */ |
|
189 CAknPopupList* iPopupList; |
|
190 }; |
|
191 |
|
192 |
|
193 #endif // C_DEFAULTAPPSRVMIMEDLG_H |
|
194 |
|
195 // end of file |
|
196 |
|
197 |