|
1 /* |
|
2 * Copyright (c) 2006 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: One value adapter for MDesCArray. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDES |
|
19 #include "tbsmdescarrayadapter.h" |
|
20 #include <e32std.h> |
|
21 #include <badesca.h> |
|
22 |
|
23 |
|
24 //LOCAL constants |
|
25 namespace |
|
26 { |
|
27 //Panic |
|
28 _LIT( KBSMDesArrayAdapterPanic, "BSDesArrAdp" ); |
|
29 |
|
30 //Panic reasons |
|
31 enum TBSMDesArrayAdapterReasons |
|
32 { |
|
33 EMdcaPointOutOfBounds |
|
34 }; |
|
35 |
|
36 void BSMDesAdapPanic( TBSMDesArrayAdapterReasons aPanicReason ) |
|
37 { |
|
38 User::Panic( KBSMDesArrayAdapterPanic, aPanicReason ); |
|
39 } |
|
40 } |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 // ================= MEMBER FUNCTIONS ======================= |
|
46 // C++ default constructor can NOT contain any code, that |
|
47 // might leave. |
|
48 // |
|
49 EXPORT_C TBSMDesCArrayAdapter::TBSMDesCArrayAdapter( const TDesC& aDesc ) |
|
50 : iDesc( aDesc ) |
|
51 { |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // TBSMDesCArrayAdapter::MdcaCount() |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 EXPORT_C TInt TBSMDesCArrayAdapter::MdcaCount() const |
|
59 { |
|
60 //there is just one adapted descriptor |
|
61 return 1; |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // TBSMDesCArrayAdapter::MdcaPoint() |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 EXPORT_C TPtrC TBSMDesCArrayAdapter::MdcaPoint( TInt aIndex ) const |
|
69 { |
|
70 //there is just one adapted descriptor |
|
71 __ASSERT_ALWAYS( aIndex == 0, BSMDesAdapPanic( EMdcaPointOutOfBounds ) ); |
|
72 return iDesc; |
|
73 } |
|
74 |
|
75 |
|
76 |
|
77 // End of File |
|
78 |