|
1 /* |
|
2 * Copyright (c) 2005 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: Container for SIPSettings view |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SIP_SETTINGS_CONTAINER_H |
|
20 #define SIP_SETTINGS_CONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <coecntrl.h> |
|
25 #include "MGsFWMSKLabelObserver.h" |
|
26 |
|
27 |
|
28 #include <aknlongtapdetector.h> |
|
29 #include <aknstyluspopupmenu.h> |
|
30 #include <eikmobs.h> |
|
31 #include "gssiptimer.h" |
|
32 // FORWARD DECLARATIONS |
|
33 |
|
34 class CSIPSettingsModel; |
|
35 class CSIPSettingsPlugin; |
|
36 class UT_CSIPSettingsContainer; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * CSIPSettingsContainer container class |
|
42 * @since 3.1 |
|
43 * container class for SIP Profiles view |
|
44 */ |
|
45 class CSIPSettingsContainer : public CCoeControl, |
|
46 public MAknLongTapDetectorCallBack, |
|
47 public MEikMenuObserver |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * SetEmphasis |
|
53 */ |
|
54 void SetEmphasis( CCoeControl* /*aMenuControl*/, TBool /*aEmphasis*/ ); |
|
55 |
|
56 /** |
|
57 * Process command |
|
58 */ |
|
59 void ProcessCommandL( TInt aCommandId ); |
|
60 |
|
61 /** |
|
62 * Handle long type event |
|
63 */ |
|
64 virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); |
|
65 |
|
66 /** |
|
67 * Handle pointer event |
|
68 */ |
|
69 virtual void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
70 |
|
71 /** |
|
72 * Judge whether it is a pointer event |
|
73 */ |
|
74 TBool IfPointerEvent(); |
|
75 |
|
76 /** |
|
77 * Get PenEventLocation |
|
78 */ |
|
79 TPoint PenEventLocation(); |
|
80 |
|
81 /** |
|
82 * C++ default constructor. |
|
83 */ |
|
84 CSIPSettingsContainer( CSIPSettingsPlugin* aObserver ); |
|
85 |
|
86 /** |
|
87 * By default Symbian 2nd phase constructor is private. |
|
88 * @param aRect Client rectangle |
|
89 * @param aActiveIndex Active index on the list |
|
90 * @param aModel Pointer to the (list box) model |
|
91 */ |
|
92 void ConstructL( |
|
93 const TRect& aRect, |
|
94 TInt aActiveIndex, |
|
95 CSIPSettingsModel* aModel ); |
|
96 |
|
97 /** |
|
98 * Destructor. |
|
99 */ |
|
100 virtual ~CSIPSettingsContainer(); |
|
101 |
|
102 public: // New functions |
|
103 |
|
104 /** |
|
105 * Returns the currently selected list box item |
|
106 * @return Index of the selected item |
|
107 */ |
|
108 TInt CurrentIndex(); |
|
109 |
|
110 /** |
|
111 * Selects the existing index and redraws the view. |
|
112 * Called after updating/adding a profile |
|
113 * @param aIndex an index to the modified item |
|
114 */ |
|
115 void ListItemModifiedL( TInt aIndex ); |
|
116 |
|
117 /** |
|
118 * Selects the next index and redraws the view. |
|
119 * Called after deletion of a profile |
|
120 */ |
|
121 void ListItemDeletedL(); |
|
122 |
|
123 /** |
|
124 * Retrieves the currently selected listbox feature id |
|
125 * @return feature id. |
|
126 */ |
|
127 TInt CurrentFeatureId( ); |
|
128 |
|
129 /** |
|
130 * Defines observer for the middle softkey label changes. |
|
131 * Can only be set once. Further attempts are ignored. |
|
132 */ |
|
133 virtual void SetMiddleSoftkeyObserver( MGsFWMSKObserver* aObserver ); |
|
134 |
|
135 protected: // Functions from base classes |
|
136 |
|
137 /** |
|
138 * From CoeControl returns the amount of controls |
|
139 */ |
|
140 TInt CountComponentControls() const; |
|
141 |
|
142 /** |
|
143 * From CCoeControl returns controls for CONE actions |
|
144 */ |
|
145 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
146 |
|
147 /** |
|
148 * From CCoeControl changes the size of the list box |
|
149 */ |
|
150 void SizeChanged(); |
|
151 |
|
152 /** |
|
153 * From CCoeControl, receives key events and passes them |
|
154 * to list box |
|
155 */ |
|
156 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
157 TEventCode aType ); |
|
158 |
|
159 /** |
|
160 * From CCoeControl, responds to a change in focus |
|
161 */ |
|
162 void FocusChanged( TDrawNow aDrawNow ); |
|
163 |
|
164 /** |
|
165 * From CoeControl, resource change handling |
|
166 */ |
|
167 void HandleResourceChange( TInt aType ); |
|
168 |
|
169 private: |
|
170 class CItemDrawer; |
|
171 class CListBox; |
|
172 friend class CListBox; |
|
173 |
|
174 /** |
|
175 * Required for help. |
|
176 * |
|
177 */ |
|
178 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
179 |
|
180 /** |
|
181 * For testing purposes |
|
182 */ |
|
183 friend class UT_CSIPSettingsContainer; |
|
184 |
|
185 public: // Data |
|
186 // The list box for showing the profiles and the status of each profile |
|
187 CListBox* iListBox; |
|
188 |
|
189 //Get long press status |
|
190 TBool LongPressStatus(); |
|
191 |
|
192 // set long press |
|
193 void SetLongPress( TBool aLongPress = ETrue ); |
|
194 |
|
195 CAknLongTapDetector* LongTapDetector(); |
|
196 |
|
197 TPointerEvent PointerEvent(); |
|
198 |
|
199 protected: // Data |
|
200 TBool iLongPress; |
|
201 CSIPSettingsModel* iModel;//not needed? |
|
202 CSIPSettingsPlugin* iObs; |
|
203 /** |
|
204 * Middle softkey label observer. |
|
205 * Own. |
|
206 */ |
|
207 MGsFWMSKObserver* iMSKObserver; |
|
208 |
|
209 // Long tap detector object for deciding whether showing stylus pop up menu. |
|
210 CAknLongTapDetector* iLongTapDetector; |
|
211 |
|
212 // stylus popup menu object for showing popup menu |
|
213 CAknStylusPopUpMenu* iStylusPopupMenu; |
|
214 |
|
215 //Timer |
|
216 CGSSIPTimer* iTimer; |
|
217 |
|
218 //Get pen event location |
|
219 TPoint iPoint; |
|
220 |
|
221 TPointerEvent iPointerEvent; |
|
222 }; |
|
223 |
|
224 #endif // SIP_SETTINGS_CONTAINER_H |
|
225 |
|
226 // End of File |