|
1 /* |
|
2 * Copyright (c) 2002 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: Base class for obex searchers |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef COBEXSEARCHERBASE_H |
|
21 #define COBEXSEARCHERBASE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // DATA TYPES |
|
27 enum TObexSearcherPanics |
|
28 { |
|
29 ObexSearcherInvalidState |
|
30 }; |
|
31 |
|
32 enum TState |
|
33 { |
|
34 EIdle, |
|
35 EDeviceSearch, |
|
36 EDeviceSearchTimeout, |
|
37 EServiceSearch |
|
38 }; |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 class MObexSearcherObserver; |
|
42 class MExtBTSearcherObserver; |
|
43 class CObexClient; |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 class CObexSearcherBase : public CActive |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CObexSearcherBase(); |
|
55 |
|
56 public: // New functions |
|
57 |
|
58 void SetObserver( MObexSearcherObserver* aObserver ); |
|
59 void SetExtObserver( MExtBTSearcherObserver* aExtObserver ); |
|
60 |
|
61 public: // Abstract functions |
|
62 |
|
63 /** |
|
64 * Search for a device |
|
65 */ |
|
66 virtual void SearchDeviceL() = 0; |
|
67 |
|
68 /** |
|
69 * Search for a service |
|
70 */ |
|
71 virtual void SearchServiceL() = 0; |
|
72 |
|
73 /** |
|
74 * Creates an obex client |
|
75 */ |
|
76 virtual CObexClient* CreateObexClientL() = 0; |
|
77 |
|
78 protected: // New functions |
|
79 |
|
80 /** |
|
81 * Handle device found |
|
82 */ |
|
83 void NotifyDeviceFoundL(); |
|
84 |
|
85 /** |
|
86 * Handle device search error |
|
87 */ |
|
88 void NotifyDeviceErrorL( TInt aErr ); |
|
89 |
|
90 /** |
|
91 * Handle service found |
|
92 */ |
|
93 void NotifyServiceFoundL(); |
|
94 |
|
95 /** |
|
96 * Handle service search error |
|
97 */ |
|
98 void NotifyServiceErrorL( TInt aErr ); |
|
99 |
|
100 protected: |
|
101 |
|
102 CObexSearcherBase(); |
|
103 void BaseConstructL(); |
|
104 |
|
105 protected: // Data |
|
106 |
|
107 MExtBTSearcherObserver* iExtObserver; |
|
108 TState iState; |
|
109 |
|
110 private: // Data |
|
111 |
|
112 MObexSearcherObserver* iObserver; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // COBEXSEARCHERBASE_H |
|
117 |
|
118 // End of File |