|
1 /* |
|
2 * Component Name: Headset Simulator |
|
3 * Author: Comarch S.A. |
|
4 * Version: 1.0 |
|
5 * Copyright (c) 2010 Comarch S.A. |
|
6 * |
|
7 * This Software is submitted by Comarch S.A. to Symbian Foundation Limited on |
|
8 * the basis of the Member Contribution Agreement entered between Comarch S.A. |
|
9 * and Symbian Foundation Limited on 5th June 2009 (“Agreement”) and may be |
|
10 * used only in accordance with the terms and conditions of the Agreement. |
|
11 * Any other usage, duplication or redistribution of this Software is not |
|
12 * allowed without written permission of Comarch S.A. |
|
13 * |
|
14 */ |
|
15 |
|
16 inline CHsCoDBase* CHsCoDBase::NewL( const TUid aUid ) |
|
17 { |
|
18 TAny *impl = REComSession::CreateImplementationL( aUid, _FOFF( CHsCoDBase, |
|
19 iDtor_ID_Key ) ); |
|
20 return (CHsCoDBase*) impl; |
|
21 } |
|
22 |
|
23 inline CHsCoDBase* CHsCoDBase::NewL( const TDesC8 &aData ) |
|
24 { |
|
25 TEComResolverParams params; |
|
26 |
|
27 params.SetDataType( aData ); |
|
28 params.SetWildcardMatch( ETrue ); |
|
29 |
|
30 TAny *impl = REComSession::CreateImplementationL( |
|
31 KHsCoDBaseInterfaceDefinitionUid, |
|
32 _FOFF( CHsCoDBase, iDtor_ID_Key ), params ); |
|
33 return (CHsCoDBase*) impl; |
|
34 } |
|
35 |
|
36 inline CHsCoDBase::~CHsCoDBase() |
|
37 { |
|
38 REComSession::DestroyedImplementation( iDtor_ID_Key ); |
|
39 } |
|
40 |
|
41 inline TInt CHsCoDBase::SetDefaultCod() |
|
42 { |
|
43 TBTDeviceClass defaultDeviceClass( iDefaultDeviceClass ); |
|
44 TInt err = RProperty::Set( KPropertyUidBluetoothCategory, |
|
45 KPropertyKeyBluetoothSetDeviceClass, |
|
46 defaultDeviceClass.DeviceClass() ); |
|
47 return err; |
|
48 } |
|
49 |
|
50 inline TInt CHsCoDBase::RestoreOldCod() |
|
51 { |
|
52 return SetDefaultCod(); |
|
53 } |
|
54 |
|
55 inline TInt CHsCoDBase::SaveOldCod() |
|
56 { |
|
57 TInt defaultCoDasInt, err; |
|
58 err = RProperty::Get( KPropertyUidBluetoothCategory, |
|
59 KPropertyKeyBluetoothGetDeviceClass, defaultCoDasInt ); |
|
60 TBTDeviceClass defaultCoD( defaultCoDasInt ); |
|
61 iDefaultDeviceClass = defaultCoD.DeviceClass(); |
|
62 return err; |
|
63 } |