|
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: LandmarksUi Content File - |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 // INCLUDE FILES |
|
26 #include "CLmkDoubleGraphicLBModel.h" |
|
27 #include "CLmkListProviderBase.h" |
|
28 #include "CLmkSelectorCache.h" |
|
29 #include "CLmkUiItemBase.h" |
|
30 #include <lmkui.rsg> |
|
31 #include <EPos_Landmarks.h> |
|
32 #include <e32keys.h> |
|
33 #include <eikenv.h> |
|
34 |
|
35 // ============================ MEMBER FUNCTIONS =============================== |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CLmkDoubleGraphicLBModel::CLmkDoubleGraphicLBModel |
|
39 // C++ default constructor can NOT contain any code, that |
|
40 // might leave. |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CLmkDoubleGraphicLBModel::CLmkDoubleGraphicLBModel() |
|
44 { |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CLmkDoubleGraphicLBModel::ConstructL |
|
49 // Symbian 2nd phase constructor can leave. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 void CLmkDoubleGraphicLBModel::ConstructL(CLmkListProviderBase& aListProvider) |
|
53 { |
|
54 BaseConstructL( aListProvider ); |
|
55 |
|
56 iEmpty = CEikonEnv::Static()->AllocReadResourceL( |
|
57 R_LMK_CATEGORY_SETTINGS_EMPTY ); |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CLmkDoubleGraphicLBModel::NewL |
|
62 // Two-phased constructor. |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 CLmkDoubleGraphicLBModel* CLmkDoubleGraphicLBModel::NewL( |
|
66 CLmkListProviderBase& aListProvider ) |
|
67 { |
|
68 CLmkDoubleGraphicLBModel* self = new( ELeave ) |
|
69 CLmkDoubleGraphicLBModel(); |
|
70 |
|
71 CleanupStack::PushL( self ); |
|
72 self->ConstructL( aListProvider ); |
|
73 CleanupStack::Pop(); |
|
74 |
|
75 return self; |
|
76 } |
|
77 |
|
78 // ---------------------------------------------------- |
|
79 // CLmkDoubleGraphicLBModel::~CLmkDoubleGraphicLBModel |
|
80 // ---------------------------------------------------- |
|
81 // |
|
82 CLmkDoubleGraphicLBModel::~CLmkDoubleGraphicLBModel() |
|
83 { |
|
84 delete iEmpty; |
|
85 } |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // CLmkDoubleGraphicLBModel::MdcaPointL |
|
89 // ?implementation_description |
|
90 // (other items were commented in a header). |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 void CLmkDoubleGraphicLBModel::MdcaPointL( TInt aIndex ) const |
|
94 { |
|
95 CLmkUiItemBase& item = iCache->ItemAtL( aIndex ); |
|
96 TPtr16 modBuffer = iBuffer->Des(); |
|
97 modBuffer.Zero(); |
|
98 modBuffer.AppendNum( item.GetIconId() ); |
|
99 modBuffer.Append( EKeyTab ); |
|
100 modBuffer.Append( item.Text() ); |
|
101 modBuffer.Append( EKeyTab ); |
|
102 if ( item.ExtensionIntExists() && !item.ExtensionInt() ) |
|
103 { |
|
104 modBuffer.Append( *iEmpty ); |
|
105 } |
|
106 modBuffer.Append( EKeyTab ); |
|
107 } |
|
108 // End of File |