|
1 // Copyright (c) 2007-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 // btengdevman.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef BTGPSDEVMANOBSERVER_H |
|
19 #define BTGPSDEVMANOBSERVER_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <e32base.h> //For CTimer |
|
24 #include <btdevice.h> |
|
25 #include <btmanclient.h> |
|
26 |
|
27 /** |
|
28 * Observer for DevMan queries |
|
29 */ |
|
30 class MBTGPSDevManObserver |
|
31 { |
|
32 public: |
|
33 virtual void HandleGetDevicesComplete(TInt aErr, RBTDeviceArray* aDeviceArray) = 0; |
|
34 virtual void HandleAddDeviceComplete(TInt aErr) = 0; |
|
35 virtual void HandleDeleteDevicesComplete(TInt aErr) = 0; |
|
36 }; |
|
37 |
|
38 /** |
|
39 * Wrapper class for performing a BTRegistry search |
|
40 * @internalTechnology |
|
41 */ |
|
42 class CBTGPSDevMan : public CActive |
|
43 { |
|
44 public: |
|
45 virtual TInt GetDevices(TBTRegistrySearch& aSearchPattern, RBTDeviceArray* aDeviceArray); |
|
46 static CBTGPSDevMan* NewL(MBTGPSDevManObserver* aObserver); |
|
47 ~CBTGPSDevMan(); |
|
48 |
|
49 private: |
|
50 void ConstructL(MBTGPSDevManObserver* aObserver); |
|
51 CBTGPSDevMan(); |
|
52 void Find(TBTRegistrySearch aSearchPattern); |
|
53 void RunL(); |
|
54 TInt RunError(TInt aError); |
|
55 void DoCancel(); |
|
56 |
|
57 private: |
|
58 enum TRegistryState |
|
59 { |
|
60 EFinding = 0, |
|
61 EGetting |
|
62 }; |
|
63 TBTRegistrySearch* iSearch; |
|
64 CBTRegistryResponse* iResponse; |
|
65 RBTRegistry iRegistryView; |
|
66 RBTRegServ iRegServer; |
|
67 RBTDeviceArray* iDeviceArray; |
|
68 TRegistryState iRegistryState; |
|
69 MBTGPSDevManObserver* iObserver; |
|
70 }; |
|
71 |
|
72 #endif |
|
73 // End of File |
|
74 |