|
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: Represents the search data for UI |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDES |
|
21 #include "CCASearchDataPC.h" |
|
22 #include "CCAStorageManagerFactory.h" |
|
23 #include "MCAStoredContacts.h" |
|
24 |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CCASearchDataPC: Constructor |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 CCASearchDataPC::CCASearchDataPC( MCASearchData* aSearchData ) |
|
34 : iDataInterface( aSearchData ) |
|
35 { |
|
36 |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CCASearchDataPC: NewL |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CCASearchDataPC* CCASearchDataPC::NewL( MCASearchData* aSearchData ) |
|
44 { |
|
45 CCASearchDataPC* self = new ( ELeave ) CCASearchDataPC( aSearchData ); |
|
46 return self; |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CCASearchDataPC: Destructor |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 CCASearchDataPC::~CCASearchDataPC() |
|
54 { |
|
55 |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CCASearchDataPC: SearchData |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 TPtrC CCASearchDataPC::SearchData( TInt aIndex ) const |
|
63 { |
|
64 if ( iDataInterface ) |
|
65 { |
|
66 return iDataInterface->SearchData( aIndex ); |
|
67 } |
|
68 else |
|
69 { |
|
70 return KNullDesC(); |
|
71 } |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CCASearchDataPC: SearchDataCount |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 TInt CCASearchDataPC::SearchDataCount() const |
|
79 { |
|
80 if ( iDataInterface ) |
|
81 { |
|
82 return iDataInterface->SearchDataCount(); |
|
83 } |
|
84 else |
|
85 { |
|
86 return EFalse; |
|
87 } |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CCASearchDataPC: HowManyResultsAvailable |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 TInt CCASearchDataPC::HowManyResultsAvailable() const |
|
95 { |
|
96 if ( iDataInterface ) |
|
97 { |
|
98 return iDataInterface->HowManyResultsAvailable(); |
|
99 } |
|
100 else |
|
101 { |
|
102 return EFalse; |
|
103 } |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CCASearchDataPC: IdentificationL |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 const TPtrC CCASearchDataPC::IdentificationL( const TDesC& aContactId ) |
|
111 { |
|
112 MCAStoredContacts* storedContacts = CCAStorageManagerFactory::ContactListInterfaceL(); |
|
113 return storedContacts->Identification( aContactId ); |
|
114 } |
|
115 |
|
116 // End of File |