18 import org.eclipse.swt.widgets.Composite; |
18 import org.eclipse.swt.widgets.Composite; |
19 import org.eclipse.swt.widgets.Event; |
19 import org.eclipse.swt.widgets.Event; |
20 import org.eclipse.swt.widgets.Internal_PackageSupport; |
20 import org.eclipse.swt.widgets.Internal_PackageSupport; |
21 import org.eclipse.swt.internal.qt.OS; |
21 import org.eclipse.swt.internal.qt.OS; |
22 import org.eclipse.swt.internal.qt.PackageProxy; |
22 import org.eclipse.swt.internal.qt.PackageProxy; |
|
23 import org.eclipse.swt.internal.qt.QObjectDeleteWrapper; |
23 |
24 |
24 /** |
25 /** |
25 * |
26 * |
26 * Instances of this class represent a selectable user interface object that |
27 * Instances of this class represent a selectable user interface object that |
27 * launchs other applications when activated by the end-user. |
28 * launchs other applications when activated by the end-user. |
161 Internal_PackageSupport.sendEvent(this, SWT.Selection, event); |
162 Internal_PackageSupport.sendEvent(this, SWT.Selection, event); |
162 |
163 |
163 if (event.doit == true) { |
164 if (event.doit == true) { |
164 if (extraStyle() == PHONE) { |
165 if (extraStyle() == PHONE) { |
165 if (OS.windowServer == OS.WS_SYMBIAN_S60) { |
166 if (OS.windowServer == OS.WS_SYMBIAN_S60) { |
166 // TODO: Launch S60 phone application |
167 callToNumber(); |
167 } |
168 } |
|
169 return; |
168 } |
170 } |
169 String url = getText(); |
171 String url = getText(); |
170 if ((extraStyle() == EMAIL) && (!getText().trim().toLowerCase().startsWith(emailScheme))) |
172 if ((extraStyle() == EMAIL) && (!getText().trim().toLowerCase().startsWith(emailScheme))) |
171 url = emailScheme + url; |
173 url = emailScheme + url; |
172 OS.QDesktopServices_openUrl(url); |
174 OS.QDesktopServices_openUrl(url); |
173 } |
175 } |
174 } |
176 } |
175 |
177 |
|
178 void callToNumber(){ |
|
179 int appMgr = OS.XQApplicationManager_new(); |
|
180 int serviceRequest = OS.XQApplicationManager_create(appMgr, "phoneui","com.nokia.symbian.ICallDial","dial(QString)",false); |
|
181 if (serviceRequest <= 0) { |
|
182 return; |
|
183 } |
|
184 OS.XQAiwRequest_setArguments(serviceRequest, getText()); |
|
185 OS.XQAiwRequest_send(serviceRequest); |
|
186 QObjectDeleteWrapper.deleteSafely(serviceRequest); |
|
187 QObjectDeleteWrapper.deleteSafely(appMgr); |
|
188 } |
|
189 |
176 public void setText(String string) { |
190 public void setText(String string) { |
177 checkWidget(); |
191 checkWidget(); |
178 if (string == null) |
192 if (string == null) |
179 SWT.error(SWT.ERROR_NULL_ARGUMENT); |
193 SWT.error(SWT.ERROR_NULL_ARGUMENT); |
180 super.setText(string); |
194 super.setText(string); |