|
1 /* |
|
2 * Copyright (c) 2010 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: Retrieves the character map for each of the numeric keys. |
|
15 */ |
|
16 |
|
17 // INCLUDE FILES |
|
18 #include "cntpredictivesearch.h" |
|
19 #include "cntsqlsearch.h" |
|
20 |
|
21 #include <QtGlobal> |
|
22 #include <QString> |
|
23 #include <QChar> |
|
24 |
|
25 // ============================== MEMBER FUNCTIONS ============================ |
|
26 |
|
27 // ---------------------------------------------------------------------------- |
|
28 // CntPredictiveSearch::NewL |
|
29 // ---------------------------------------------------------------------------- |
|
30 EXPORT_C CntPredictiveSearch* CntPredictiveSearch::NewL() |
|
31 { |
|
32 CntPredictiveSearch* self = new (ELeave) CntPredictiveSearch(); |
|
33 CleanupStack::PushL(self); |
|
34 self->ConstructL(); |
|
35 CleanupStack::Pop(self); |
|
36 return self; |
|
37 } |
|
38 |
|
39 // ---------------------------------------------------------------------------- |
|
40 // CntPredictiveSearch::NewL |
|
41 // ---------------------------------------------------------------------------- |
|
42 EXPORT_C CntPredictiveSearch::~CntPredictiveSearch() |
|
43 { |
|
44 |
|
45 } |
|
46 |
|
47 // ---------------------------------------------------------------------------- |
|
48 // CntPredictiveSearch::CreateSQLQuery |
|
49 // Construct SQL query. |
|
50 // ---------------------------------------------------------------------------- |
|
51 EXPORT_C HBufC* CntPredictiveSearch::CreateSQLQueryL(HBufC& searchQuery, int aKeypad) |
|
52 { |
|
53 QString qString; |
|
54 QString queryString; |
|
55 QT_TRYCATCH_LEAVING({ |
|
56 qString = QString((QChar*)searchQuery.Des().Ptr(),searchQuery.Length()); |
|
57 CntSqlSearch SqlSearch; |
|
58 queryString = SqlSearch.CreatePredictiveSearch(qString); |
|
59 }); |
|
60 TPtrC myDescriptor (reinterpret_cast<const TText*>(queryString.constData()),queryString.length()); |
|
61 return myDescriptor.AllocL(); |
|
62 } |
|
63 |
|
64 // ---------------------------------------------------------------------------- |
|
65 // CntPredictiveSearch::CntPredictiveSearch |
|
66 // ---------------------------------------------------------------------------- |
|
67 CntPredictiveSearch::CntPredictiveSearch() |
|
68 { |
|
69 } |
|
70 |
|
71 // ---------------------------------------------------------------------------- |
|
72 // CntPredictiveSearch::ConstructL |
|
73 // ---------------------------------------------------------------------------- |
|
74 void CntPredictiveSearch::ConstructL() |
|
75 { |
|
76 } |
|
77 // End of file |