1 /* |
|
2 * Copyright (c) 2004-2007 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CBTDEVICECONTAINER_H |
|
20 #define CBTDEVICECONTAINER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <s32strm.h> |
|
24 #include <f32file.h> |
|
25 |
|
26 class CRsBtDevice; |
|
27 |
|
28 /** |
|
29 * \brief Brief Description |
|
30 * |
|
31 * Detailed Description |
|
32 */ |
|
33 NONSHARABLE_CLASS(CBtDeviceContainer) : public CBase |
|
34 { |
|
35 public: |
|
36 void StoreL(); |
|
37 void RestoreL(); |
|
38 void AppendL( CRsBtDevice* aDevice ); |
|
39 TInt Delete( const TInt aDeviceId ); // returns the position in array or KErrNotFound |
|
40 TInt Delete( const CRsBtDevice &aDevice ); // returns the position in array or KErrNotFound |
|
41 TInt Find( const CRsBtDevice &aDevice, TInt aInitIndex = -1 ) const; |
|
42 TInt Find( const TInt aDeviceId, TInt aInitIndex = -1 ) const; |
|
43 TInt Count() const; |
|
44 CRsBtDevice* At(TInt aPosition) const; |
|
45 static CBtDeviceContainer* NewL(); |
|
46 ~CBtDeviceContainer(); |
|
47 void Reset(); |
|
48 |
|
49 private: |
|
50 |
|
51 enum |
|
52 { |
|
53 ETimeLastUsed = 1, |
|
54 ETimeDiscovered = 2, |
|
55 EUsed = 4, |
|
56 ENotUsed = 8 |
|
57 }; |
|
58 |
|
59 TInt FindOldest(TUint aFlags) const; |
|
60 void ExternalizeL(RWriteStream& aStream) const; |
|
61 void InternalizeL(RReadStream& aStream); |
|
62 void ConstructL(); |
|
63 CBtDeviceContainer(); |
|
64 TInt GetAvailableId( const CRsBtDevice& aDevice ); |
|
65 TBool IsIdAvailable( TInt aId ) const; |
|
66 |
|
67 private: |
|
68 |
|
69 TInt iVersion; |
|
70 RPointerArray<CRsBtDevice> iDeviceArray; |
|
71 TFileName iDataFolder; |
|
72 TInt iCurrentId; |
|
73 RFs iFs; |
|
74 }; |
|
75 |
|
76 #endif // CBTDEVICECONTAINER_H |
|
77 |
|
78 // End of File |
|