|
1 /* |
|
2 * Copyright (c) 2010 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: Launching Editors. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "edcontactorheaders.h" |
|
21 #include <SendUiConsts.h> |
|
22 |
|
23 #ifndef KSenduiMtmOnlineAlbumUidValue |
|
24 #define KSenduiMtmOnlineAlbumUidValue 0x200009D5 |
|
25 #endif |
|
26 |
|
27 /// Unnamed namespace for local definitions |
|
28 namespace |
|
29 { |
|
30 |
|
31 #ifdef _DEBUG |
|
32 enum TPanicCode |
|
33 { |
|
34 EPanicPreCond_ExecuteL = 1 |
|
35 }; |
|
36 |
|
37 void Panic(TPanicCode aReason) |
|
38 { |
|
39 _LIT(KPanicText, "CCmsMsgEditors"); |
|
40 User::Panic (KPanicText, aReason); |
|
41 } |
|
42 #endif // _DEBUG |
|
43 |
|
44 |
|
45 } /// namespace |
|
46 |
|
47 |
|
48 // ============================ MEMBER FUNCTIONS =============================== |
|
49 |
|
50 // --------------------------------------------------------- |
|
51 // CEDMsgEditors::ExecuteL |
|
52 // --------------------------------------------------------- |
|
53 void CEDMsgEditors::ExecuteL( const TUid aServiceUid, |
|
54 const TDesC& aAddress, const TDesC& aName ) |
|
55 { |
|
56 __ASSERT_DEBUG (NULL != &aAddress && 0 < aAddress.Size() && |
|
57 NULL != &aName && 0 < aName.Size() && |
|
58 NULL != &aServiceUid, Panic (EPanicPreCond_ExecuteL)); |
|
59 |
|
60 //ParsePhoneNumber may only short length of phonenumber, |
|
61 //so it's safe to use same lenght as given number and do the copy. |
|
62 HBufC* numBuf = aAddress.AllocLC(); |
|
63 TPtr numDesc( numBuf->Des() ); |
|
64 |
|
65 //Unieditor could also use email adresses. If parser returns EFalse, do not care. |
|
66 if ( KSenduiMtmUniMessageUid == aServiceUid) |
|
67 { |
|
68 CommonPhoneParser::ParsePhoneNumber( numDesc, |
|
69 CommonPhoneParser::EPhoneClientNumber ); |
|
70 } |
|
71 |
|
72 CSendUi* sendui = CSendUi::NewLC (); |
|
73 CMessageData* msgdata = CMessageData::NewLC (); |
|
74 msgdata->AppendToAddressL( *numBuf, aName); |
|
75 |
|
76 if (KSenduiMtmSmtpUid == aServiceUid) |
|
77 { |
|
78 const TUid KMfEUidValue = { 0x1020695B }; //Where is this defined? |
|
79 TBool mailAvailabe = EFalse; |
|
80 TBool mfeAvailable = EFalse; |
|
81 TUid selectedServiceID = KNullUid; |
|
82 RPointerArray<CSendingServiceInfo> availableServices; |
|
83 sendui->AvailableServicesL(availableServices, KGenericMtmPlugin); |
|
84 for (TInt i=0; i < availableServices.Count(); i++) |
|
85 { |
|
86 if (!(availableServices[i]->ServiceFeatures() & CSendingServiceInfo::EServiceInValid)) |
|
87 { |
|
88 if (availableServices[i]->ServiceId() == KSenduiMtmSmtpUid) |
|
89 { |
|
90 mailAvailabe = ETrue; |
|
91 } |
|
92 else if (availableServices[i]->ServiceId() == KMfEUidValue) |
|
93 { |
|
94 selectedServiceID = availableServices[i]->ServiceId(); |
|
95 mfeAvailable = ETrue; |
|
96 } |
|
97 } |
|
98 } |
|
99 availableServices.ResetAndDestroy(); |
|
100 |
|
101 if (mailAvailabe && mfeAvailable) |
|
102 { |
|
103 CArrayFixFlat<TUid>* servicesToDim = new (ELeave) CArrayFixFlat<TUid>(1); |
|
104 CleanupStack::PushL(servicesToDim); |
|
105 |
|
106 servicesToDim->AppendL(KSenduiTechnologySmsUid); |
|
107 servicesToDim->AppendL(KSenduiTechnologyMmsUid); |
|
108 //servicesToDim->AppendL(KSenduiTechnologyMailUid); Email is not to be dimmed |
|
109 servicesToDim->AppendL(KSenduiTechnologyUniEditorUid); |
|
110 servicesToDim->AppendL(KSenduiTechnologyIrUid); |
|
111 servicesToDim->AppendL(KSenduiTechnologyBtUid); |
|
112 servicesToDim->AppendL(KSenduiTechnologyIMUid); |
|
113 servicesToDim->AppendL(KMmsDirectUpload); |
|
114 servicesToDim->AppendL(KMmsIndirectUpload); |
|
115 servicesToDim->AppendL(KMmsUploadService1Id); |
|
116 servicesToDim->AppendL(KMmsUploadService2Id); |
|
117 servicesToDim->AppendL(KMmsUploadService3Id); |
|
118 servicesToDim->AppendL(KMmsUploadService4Id); |
|
119 const TUid KShareOnline = { KSenduiMtmOnlineAlbumUidValue }; // From SendUiInternalConsts.h |
|
120 servicesToDim->AppendL(KShareOnline); |
|
121 |
|
122 sendui->ShowQueryAndSendL(msgdata, KCapabilitiesForAllServices, servicesToDim); |
|
123 servicesToDim->Reset(); |
|
124 CleanupStack::PopAndDestroy(servicesToDim); |
|
125 } |
|
126 else if (mfeAvailable) |
|
127 { |
|
128 sendui->CreateAndSendMessageL(selectedServiceID, msgdata, KNullUid, EFalse); |
|
129 } |
|
130 else |
|
131 { |
|
132 sendui->CreateAndSendMessageL(aServiceUid, msgdata, KNullUid, EFalse); |
|
133 } |
|
134 } |
|
135 else |
|
136 { |
|
137 sendui->CreateAndSendMessageL(aServiceUid, msgdata, KNullUid, EFalse); |
|
138 } |
|
139 |
|
140 CleanupStack::PopAndDestroy( 3, numBuf ); //msgdata, sendui |
|
141 |
|
142 return; |
|
143 } |
|
144 // End of File |