|
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: Repository of remote Bluetooth devices |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <btservices/btdevrepository.h> |
|
19 #include "btdevrepositoryimpl.h" |
|
20 |
|
21 // ======== MEMBER FUNCTIONS ======== |
|
22 |
|
23 // --------------------------------------------------------------------------- |
|
24 // C++ default constructor |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 CBtDevRepository::CBtDevRepository() |
|
28 { |
|
29 } |
|
30 |
|
31 // --------------------------------------------------------------------------- |
|
32 // Symbian 2nd-phase constructor |
|
33 // --------------------------------------------------------------------------- |
|
34 // |
|
35 void CBtDevRepository::ConstructL() |
|
36 { |
|
37 iImpl = CBtDevRepositoryImpl::NewL(); |
|
38 } |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // NewL |
|
42 // --------------------------------------------------------------------------- |
|
43 // |
|
44 EXPORT_C CBtDevRepository* CBtDevRepository::NewL() |
|
45 { |
|
46 CBtDevRepository* self = NULL; |
|
47 self = new (ELeave) CBtDevRepository(); |
|
48 CleanupStack::PushL( self ); |
|
49 self->ConstructL(); |
|
50 CleanupStack::Pop( self ); |
|
51 return self; |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // Destructor |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 EXPORT_C CBtDevRepository::~CBtDevRepository() |
|
59 { |
|
60 delete iImpl; |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // AddObserverL. |
|
65 // Delegate to the implementor |
|
66 // --------------------------------------------------------------------------- |
|
67 // |
|
68 EXPORT_C void CBtDevRepository::AddObserverL( MBtDevRepositoryObserver* aObserver ) |
|
69 { |
|
70 iImpl->AddObserverL( aObserver ); |
|
71 } |
|
72 |
|
73 // --------------------------------------------------------------------------- |
|
74 // RemoveObserver. |
|
75 // Delegate to the implementor |
|
76 // --------------------------------------------------------------------------- |
|
77 // |
|
78 EXPORT_C void CBtDevRepository::RemoveObserver( MBtDevRepositoryObserver* aObserver ) |
|
79 { |
|
80 iImpl->RemoveObserver( aObserver ); |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------------------------- |
|
84 // AllDevices |
|
85 // --------------------------------------------------------------------------- |
|
86 // |
|
87 EXPORT_C TBool CBtDevRepository::IsInitialized() const |
|
88 { |
|
89 return iImpl->IsInitialized(); |
|
90 } |
|
91 |
|
92 // --------------------------------------------------------------------------- |
|
93 // AllDevices |
|
94 // --------------------------------------------------------------------------- |
|
95 // |
|
96 EXPORT_C const RDevExtensionArray& CBtDevRepository::AllDevices() const |
|
97 { |
|
98 return iImpl->AllDevices(); |
|
99 } |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // Device |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 EXPORT_C const CBtDevExtension* CBtDevRepository::Device( |
|
106 const TBTDevAddr& aAddr ) const |
|
107 { |
|
108 return iImpl->Device( aAddr ); |
|
109 } |