|
1 /* |
|
2 * Copyright (c) 2004 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: Implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "CTTCNResolverPluginBase.h" |
|
21 #include <apacmdln.h> |
|
22 |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CTTCNResolverPluginBase::ConstructL |
|
26 // ----------------------------------------------------------------------------- |
|
27 // |
|
28 void CTTCNResolverPluginBase::ConstructL() |
|
29 { |
|
30 const TUid KMyImplementationUid = { MyUid() }; |
|
31 |
|
32 RImplInfoPtrArray infoArray; |
|
33 REComSession::ListImplementationsL( KSIPResolvedClientIFUid, infoArray ); |
|
34 CleanupStack::PushL( TCleanupItem( ResetAndDestroy, &infoArray ) ); |
|
35 |
|
36 TBool found = EFalse; |
|
37 for (TInt i=0; !found && i<infoArray.Count(); i++) |
|
38 { |
|
39 CImplementationInformation* info = infoArray[ i ]; |
|
40 if ( info->ImplementationUid() == KMyImplementationUid ) |
|
41 { |
|
42 TLex8 lex( info->DataType() ); |
|
43 TUint value( 0 ); |
|
44 User::LeaveIfError( lex.Val( value, EHex ) ); |
|
45 iApplicationUID.iUid = value; |
|
46 found = ETrue; |
|
47 } |
|
48 } |
|
49 |
|
50 CleanupStack::PopAndDestroy( 1 ); // infoArray |
|
51 |
|
52 if ( !found ) |
|
53 { |
|
54 User::Leave( KErrNotFound ); |
|
55 } |
|
56 |
|
57 User::LeaveIfError( iApaSession.Connect() ); |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CTTCNResolverPluginBase::~CTTCNResolverPluginBase |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 CTTCNResolverPluginBase::~CTTCNResolverPluginBase() |
|
65 { |
|
66 iApaSession.Close(); |
|
67 } |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // CTTCNResolverPluginBase::ChannelL |
|
71 // ----------------------------------------------------------------------------- |
|
72 // |
|
73 TUid CTTCNResolverPluginBase::ChannelL( RStringF /*aMethod*/, |
|
74 const TDesC8& /*aRequestUri*/, |
|
75 const RPointerArray<CSIPHeaderBase>& /*aHeaders*/, |
|
76 const TDesC8& /*aContent*/, |
|
77 const CSIPContentTypeHeader* /*aContentType*/) |
|
78 { |
|
79 //return iApplicationUID; |
|
80 const TUid KServerUid3 = {0x10203355}; |
|
81 return KServerUid3; |
|
82 |
|
83 } |
|
84 |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CTTCNResolverPluginBase::ConnectL |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 void CTTCNResolverPluginBase::ConnectL( TUid /*aUid*/ ) |
|
91 { |
|
92 /* |
|
93 TApaAppInfo appInfo; |
|
94 User::LeaveIfError( iApaSession.GetAppInfo( appInfo, aUid ) ); |
|
95 CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); |
|
96 #ifdef EKA2 |
|
97 cmdLine->SetExecutableNameL( appInfo.iFullName ); |
|
98 #else |
|
99 cmdLine->SetLibraryNameL( appInfo.iFullName ); |
|
100 #endif |
|
101 User::LeaveIfError( iApaSession.StartApp( *cmdLine ) ); |
|
102 CleanupStack::PopAndDestroy( cmdLine ); |
|
103 */ |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CTTCNResolverPluginBase::ResetAndDestroy |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 void CTTCNResolverPluginBase::ResetAndDestroy( TAny* anArray ) |
|
111 { |
|
112 RImplInfoPtrArray* array = reinterpret_cast<RImplInfoPtrArray*>( anArray ); |
|
113 if (array) |
|
114 { |
|
115 array->ResetAndDestroy(); |
|
116 } |
|
117 } |
|
118 |