|
1 // Copyright (c) 2005-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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 |
|
22 #include <conarc.h> |
|
23 #include "TCON3_V2.H" |
|
24 #include <ecom/ecom.h> |
|
25 #include <ecom/implementationproxy.h> |
|
26 #include "TCon3.hrh" |
|
27 |
|
28 const TUid KUidTcon3={KTCon3ImplementationUid}; |
|
29 |
|
30 #include <e32std.h> |
|
31 #include <e32uid.h> |
|
32 |
|
33 // Implementation of virtual interface classes |
|
34 class CTcon3Extended1Impl : public CTcon3Extended1 |
|
35 { |
|
36 public: |
|
37 void TestFunction1(); |
|
38 void FileExtension(TDes& aDes); |
|
39 }; |
|
40 |
|
41 |
|
42 class CTcon3Extended2Impl : public CTcon3Extended2 |
|
43 { |
|
44 public: |
|
45 void TestFunction2(TDes& aDes); |
|
46 }; |
|
47 |
|
48 |
|
49 GLDEF_C TInt E32Dll( |
|
50 ) |
|
51 { |
|
52 return(KErrNone); |
|
53 } |
|
54 |
|
55 CConverterBase2* CTcon3::NewL() |
|
56 { |
|
57 CConverterBase2* tcon3=new (ELeave) CTcon3(); |
|
58 return tcon3; |
|
59 } |
|
60 |
|
61 const TImplementationProxy ImplementationTable[] = |
|
62 { |
|
63 IMPLEMENTATION_PROXY_ENTRY(KTCon3ImplementationUid,CTcon3::NewL) |
|
64 }; |
|
65 |
|
66 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
67 { |
|
68 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); |
|
69 return ImplementationTable; |
|
70 } |
|
71 |
|
72 // |
|
73 // class CTcon3 |
|
74 // |
|
75 |
|
76 CTcon3::CTcon3() |
|
77 {} |
|
78 |
|
79 CTcon3::~CTcon3() |
|
80 { |
|
81 } |
|
82 |
|
83 TUid CTcon3::Uid() |
|
84 { |
|
85 return KUidTcon3; |
|
86 } |
|
87 |
|
88 void CTcon3::ExtendedInterfaceL(TUid aInterfaceUid, CBase*& aInterface) |
|
89 { |
|
90 switch (aInterfaceUid.iUid) |
|
91 { |
|
92 case KUid1: |
|
93 aInterface = new(ELeave) (CTcon3Extended1Impl); |
|
94 break; |
|
95 case KUid2: |
|
96 aInterface = new(ELeave) (CTcon3Extended2Impl); |
|
97 break; |
|
98 default: |
|
99 aInterface = NULL; |
|
100 break; |
|
101 } |
|
102 } |
|
103 |
|
104 |
|
105 // Extended Interface classes |
|
106 |
|
107 /** Sample implementation of an extended function - this could |
|
108 be anything sensisble used to extend the connarc interface |
|
109 */ |
|
110 void CTcon3Extended1Impl::FileExtension(TDes& aDes) |
|
111 { |
|
112 _LIT(KFileExt, "doc"); |
|
113 aDes.Append(KFileExt); |
|
114 } |
|
115 |
|
116 |
|
117 void CTcon3Extended2Impl::TestFunction2(TDes& aDes) |
|
118 { |
|
119 _LIT(KFuncName, "TestFunction2"); |
|
120 aDes.Append(KFuncName); |
|
121 } |