|
1 /* |
|
2 * Copyright (c) 2009 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: Generic Stub plugin that load required CI stub in WINSCW |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "cistubplugin.h" |
|
21 |
|
22 #ifdef _DEBUG |
|
23 #define DEBPRN0 RDebug::Printf( "*CI STUB PLUGIN* %s", __PRETTY_FUNCTION__); |
|
24 #define DEBPRN1(str) RDebug::Printf( "%s %s", __PRETTY_FUNCTION__, str ); |
|
25 #else |
|
26 #define DEBPRN0 |
|
27 #define DEBPRN1(str) |
|
28 #endif |
|
29 |
|
30 #define KTenSeconds 3000000 |
|
31 // Member Functions |
|
32 |
|
33 |
|
34 CCIStubPlugin* CCIStubPlugin::NewLC() |
|
35 { |
|
36 DEBPRN0; |
|
37 CCIStubPlugin* self = new (ELeave) CCIStubPlugin; |
|
38 CleanupStack::PushL(self); |
|
39 self->ConstructL(); |
|
40 return self; |
|
41 } |
|
42 |
|
43 MyMCustomInterface* CCIStubPlugin::NewL() |
|
44 { |
|
45 DEBPRN0; |
|
46 CCIStubPlugin* self = CCIStubPlugin::NewLC(); |
|
47 CleanupStack::Pop(self); |
|
48 return (MyMCustomInterface*) self; |
|
49 } |
|
50 |
|
51 CCIStubPlugin::CCIStubPlugin() |
|
52 // note, CBase initialises all member variables to zero |
|
53 { |
|
54 DEBPRN0; |
|
55 } |
|
56 |
|
57 void CCIStubPlugin::ConstructL() |
|
58 { |
|
59 DEBPRN0; |
|
60 } |
|
61 |
|
62 CCIStubPlugin::~CCIStubPlugin() |
|
63 { |
|
64 DEBPRN0; |
|
65 } |
|
66 |
|
67 TAny* CCIStubPlugin::CustomInterface(TUid aInterfaceId) |
|
68 { |
|
69 DEBPRN0; |
|
70 if (aInterfaceId == KUidRestrictedAudioOutput) |
|
71 { |
|
72 return (TAny*)CRestrictedAudioOutputCI::NewL(); |
|
73 } |
|
74 if(aInterfaceId == KUidAudioOutput) |
|
75 { |
|
76 return (TAny*)CAudioOutputCI::NewL(); |
|
77 } |
|
78 if(aInterfaceId == KUidAudioInput) |
|
79 { |
|
80 return (TAny*)CAudioInputCI::NewL(); |
|
81 } |
|
82 return NULL; |
|
83 } |
|
84 |
|
85 void CCIStubPlugin::Release() |
|
86 { |
|
87 DEBPRN0; |
|
88 REComSession::DestroyedImplementation(iDtor_ID_Key); |
|
89 delete this; |
|
90 } |
|
91 void CCIStubPlugin::PassDestructionKey(TUid aUid) |
|
92 { |
|
93 DEBPRN0; |
|
94 iDtor_ID_Key = aUid; |
|
95 } |