|
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: Custom listbox component for the contact list |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "ccacontactlistbox.h" |
|
20 #include "ccacontactlistboxmodel.h" |
|
21 #include "MCAMainViewArrayPC.h" |
|
22 |
|
23 // ======== MEMBER FUNCTIONS ======== |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // CCAContactListBox::CreateModelL |
|
27 // Here we change the listbox model |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 void CCAContactListBox::CreateModelL() |
|
31 { |
|
32 // we have to make sure that the model is ours, |
|
33 // so we can leave if the model creation fails. |
|
34 // (just make sure that the pointer is NULL) |
|
35 delete iModel; |
|
36 iModel = NULL; |
|
37 iModel = new ( ELeave ) CCAContactListBoxModel; |
|
38 } |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // CCAContactListBox::SetContactListModel |
|
42 // ConstructL has to be called before calling this |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 void CCAContactListBox::SetContactListModel( MCAMainViewArrayPC& |
|
46 aMainViewArrayPC ) |
|
47 { |
|
48 if ( iModel ) |
|
49 { |
|
50 static_cast<CCAContactListBoxModel*>( iModel )->SetContactListModel( aMainViewArrayPC ); |
|
51 } |
|
52 } |
|
53 |