|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This file contains the implementation for the class defined in |
|
15 // TestMsgUrlHandlerApp.h |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @see TestMsgUrlHandlerApp.h |
|
22 */ |
|
23 |
|
24 //#include <TextUtils.h> |
|
25 #include <uri16.h> |
|
26 #include <apgcli.h> |
|
27 |
|
28 #include "TestMsgUrlHandlerApp.H" |
|
29 |
|
30 CTestMsgUrlHandlerAppUi::CTestMsgUrlHandlerAppUi() |
|
31 { |
|
32 } |
|
33 |
|
34 // The second phase constructor of the application UI class. |
|
35 // |
|
36 void CTestMsgUrlHandlerAppUi::ConstructL() |
|
37 { |
|
38 // BaseConstructL() completes the UI framework's |
|
39 // construction of the App UI. |
|
40 BaseConstructL(); |
|
41 iAppView = CTestMsgUrlHandlerAppView::NewL(ClientRect()); |
|
42 } |
|
43 |
|
44 CTestMsgUrlHandlerAppUi::~CTestMsgUrlHandlerAppUi() |
|
45 { |
|
46 delete iAppView; |
|
47 } |
|
48 |
|
49 void CTestMsgUrlHandlerAppUi::HandleCommandL(TInt aCommand) |
|
50 { |
|
51 switch (aCommand) |
|
52 { |
|
53 case EItem0: |
|
54 { |
|
55 Exit(); |
|
56 break; |
|
57 } |
|
58 case EItem1: |
|
59 { |
|
60 TThreadId thread; |
|
61 _LIT(url, "mailto:shahadat@symbian,david@symbian"); |
|
62 RApaLsSession apaLsSess; |
|
63 TDataRecognitionResult result; |
|
64 User::LeaveIfError(apaLsSess.Connect()); |
|
65 User::LeaveIfError(apaLsSess.RecognizeData(url,KNullDesC8, result)); |
|
66 User::LeaveIfError(apaLsSess.StartDocument(url,result.iDataType,thread)); |
|
67 apaLsSess.Close(); |
|
68 break; |
|
69 } |
|
70 case EItem2: |
|
71 { |
|
72 TThreadId thread; |
|
73 _LIT(url, "sms:+2516136;via=2836482"); |
|
74 RApaLsSession apaLsSess; |
|
75 TDataRecognitionResult result; |
|
76 User::LeaveIfError(apaLsSess.Connect()); |
|
77 User::LeaveIfError(apaLsSess.RecognizeData(url,KNullDesC8, result)); |
|
78 User::LeaveIfError(apaLsSess.StartDocument(url,result.iDataType,thread)); |
|
79 apaLsSess.Close(); |
|
80 break; |
|
81 } |
|
82 |
|
83 case EEikCmdExit: |
|
84 Exit(); |
|
85 break; |
|
86 } |
|
87 } |