63
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 |
* ccappcommlaunchercustomlistbox.cpp
|
|
19 |
*
|
|
20 |
* Created on: 2009-10-30
|
|
21 |
* Author: dev
|
|
22 |
*/
|
|
23 |
|
|
24 |
// System includes
|
|
25 |
#include <barsread.h>
|
|
26 |
#include <aknlayoutscalable_apps.cdl.h>
|
|
27 |
|
|
28 |
|
|
29 |
#include "ccappcommlaunchercustomlistbox.h"
|
|
30 |
#include "ccappcommlaunchercustomlistboxitemdrawer.h"
|
|
31 |
#include "ccappcommlaunchercustomlistboxdata.h"
|
|
32 |
|
|
33 |
// --------------------------------------------------------------------------
|
|
34 |
// CCCAppCommLauncherCustomListBox::CCCAppCommLauncherCustomListBox
|
|
35 |
// --------------------------------------------------------------------------
|
|
36 |
//
|
|
37 |
inline CCCAppCommLauncherCustomListBox::CCCAppCommLauncherCustomListBox
|
|
38 |
()
|
|
39 |
{
|
|
40 |
}
|
|
41 |
|
|
42 |
// --------------------------------------------------------------------------
|
|
43 |
// CCCAppCommLauncherCustomListBox::~CCCAppCommLauncherCustomListBox
|
|
44 |
// --------------------------------------------------------------------------
|
|
45 |
//
|
|
46 |
CCCAppCommLauncherCustomListBox::~CCCAppCommLauncherCustomListBox()
|
|
47 |
{
|
|
48 |
|
|
49 |
}
|
|
50 |
|
|
51 |
// --------------------------------------------------------------------------
|
|
52 |
// CCCAppCommLauncherCustomListBox::NewL
|
|
53 |
// --------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
CCCAppCommLauncherCustomListBox* CCCAppCommLauncherCustomListBox::NewL()
|
|
56 |
{
|
|
57 |
CCCAppCommLauncherCustomListBox* self =
|
|
58 |
new ( ELeave ) CCCAppCommLauncherCustomListBox();
|
|
59 |
|
|
60 |
return self;
|
|
61 |
}
|
|
62 |
|
|
63 |
// --------------------------------------------------------------------------
|
|
64 |
// CCCAppCommLauncherCustomListBox::CreateItemDrawerL
|
|
65 |
// --------------------------------------------------------------------------
|
|
66 |
//
|
|
67 |
void CCCAppCommLauncherCustomListBox::CreateItemDrawerL()
|
|
68 |
{
|
|
69 |
CCCAppCommLauncherCustomListBoxData* columnData = CCCAppCommLauncherCustomListBoxData::NewL();
|
|
70 |
|
|
71 |
CleanupStack::PushL( columnData );
|
|
72 |
|
|
73 |
iItemDrawer = new (ELeave) CCCAppCommLauncherCustomListBoxItemDrawer(
|
|
74 |
static_cast<MTextListBoxModel*>(Model()), iCoeEnv->NormalFont(),
|
|
75 |
columnData);
|
|
76 |
CleanupStack::Pop( columnData );
|
|
77 |
|
|
78 |
//Ownership has been transferred to iItemDrawer
|
|
79 |
iColumnData = columnData;
|
|
80 |
}
|
|
81 |
// --------------------------------------------------------------------------
|
|
82 |
// CCCAppCommLauncherCustomListBox::SizeChanged
|
|
83 |
// --------------------------------------------------------------------------
|
|
84 |
//
|
|
85 |
void CCCAppCommLauncherCustomListBox::SizeChanged()
|
|
86 |
{
|
|
87 |
CAknDoubleLargeStyleListBox::SizeChanged();
|
|
88 |
TRAP_IGNORE( SizeChangedL() );
|
|
89 |
}
|
|
90 |
|
|
91 |
// --------------------------------------------------------------------------
|
|
92 |
// CCCAppCommLauncherCustomListBox::SizeChangedL
|
|
93 |
// --------------------------------------------------------------------------
|
|
94 |
//
|
|
95 |
void CCCAppCommLauncherCustomListBox::SizeChangedL()
|
|
96 |
{
|
|
97 |
// Text format: "0\tCommunicationName\tContent\t1\t2"
|
|
98 |
// Icons:
|
|
99 |
// 0: Communication method icon
|
|
100 |
// 1: Presence icon
|
|
101 |
// 2: Multi indication icon
|
|
102 |
//
|
|
103 |
// Layout: list_double_large_graphic_phob2_cc_pane
|
|
104 |
// ------------------------------------------------
|
|
105 |
// | | |
|
|
106 |
// | | Communication method name [1] |
|
|
107 |
// | [0] | |
|
|
108 |
// | | Content [2] |
|
|
109 |
// | | |
|
|
110 |
// ------------------------------------------------
|
|
111 |
//
|
|
112 |
|
|
113 |
// Calculate listbox rect
|
|
114 |
TAknWindowComponentLayout listPaneLayout( TAknWindowComponentLayout::Compose(
|
|
115 |
AknLayoutScalable_Apps::phob2_cc_listscroll_pane( 0 ),
|
|
116 |
TAknWindowComponentLayout::Compose(
|
|
117 |
AknLayoutScalable_Apps::phob2_cc_list_pane( 0 ),
|
|
118 |
AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane( 0 ) ) ) );
|
|
119 |
|
|
120 |
TAknLayoutRect listPaneLayoutRect;
|
|
121 |
listPaneLayoutRect.LayoutRect( TRect( Size() ), listPaneLayout.LayoutLine() );
|
|
122 |
TRect listPaneRowRect( listPaneLayoutRect.Rect() );
|
|
123 |
|
|
124 |
// Set listbox item height
|
|
125 |
SetItemHeightL( listPaneRowRect.Height() );
|
|
126 |
iItemDrawer->SetItemCellSize( listPaneRowRect.Size() );
|
|
127 |
|
|
128 |
|
|
129 |
// Reset sub cell array
|
|
130 |
iColumnData->ResetSLSubCellArray();
|
|
131 |
|
|
132 |
// Comm method icon
|
|
133 |
TAknWindowLineLayout gl( AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_g1( 0 ) );
|
|
134 |
iColumnData->SetGraphicSubCellL( 0, gl );
|
|
135 |
|
|
136 |
// Line 1 text
|
|
137 |
TAknTextComponentLayout textLayout = AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_t1( 0 );
|
|
138 |
iColumnData->SetTextSubCellL( 1, textLayout );
|
|
139 |
|
|
140 |
// Line 2 text
|
|
141 |
TAknTextComponentLayout textLayout2 = AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_t2( 0 );
|
|
142 |
iColumnData->SetTextSubCellL( 2, textLayout2 );
|
|
143 |
|
|
144 |
// Presence icon
|
|
145 |
TAknWindowLineLayout g2( AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_g2( 0 ) );
|
|
146 |
iColumnData->SetGraphicSubCellL( 3, g2 );
|
|
147 |
|
|
148 |
// Multi indication icon
|
|
149 |
TAknWindowLineLayout g3( AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_g3( 0 ) );
|
|
150 |
iColumnData->SetGraphicSubCellL( 4, g3 );
|
|
151 |
|
|
152 |
// Conditional subcells must be added in priority order!
|
|
153 |
// Line 1 text variation for 1 post icon
|
|
154 |
TAknTextComponentLayout textLayout3 = AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_t1( 2 );
|
|
155 |
iColumnData->SetConditionalSubCellL( 3, textLayout3, 1 );
|
|
156 |
|
|
157 |
// Line 2 text variation for 2 post icon
|
|
158 |
TAknTextComponentLayout textLayout4 = AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_t2( 2 );
|
|
159 |
iColumnData->SetConditionalSubCellL( 4, textLayout4, 2 );
|
|
160 |
|
|
161 |
}
|