|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 |
|
25 |
|
26 #ifndef __CPREDICTIVESEARCHSETTINGSTABLE_H__ |
|
27 #define __CPREDICTIVESEARCHSETTINGSTABLE_H__ |
|
28 |
|
29 #include "pltables.h" |
|
30 #include <QLocale> |
|
31 |
|
32 class CCntSqlStatement; |
|
33 class RSqlDatabase; |
|
34 |
|
35 /** |
|
36 The CPplPredictiveSearchTable class contains numeric representation of the |
|
37 fields that are checked in predictive search. |
|
38 */ |
|
39 NONSHARABLE_CLASS(CPredictiveSearchSettingsTable) : public CPplPredictiveSearchTableBase |
|
40 { |
|
41 public: |
|
42 static CPredictiveSearchSettingsTable* NewL(RSqlDatabase& aDatabase); |
|
43 static CPredictiveSearchSettingsTable* NewLC(RSqlDatabase& aDatabase); |
|
44 virtual ~CPredictiveSearchSettingsTable(); |
|
45 |
|
46 public: // From CPplTableBase |
|
47 void CreateInDbL(CContactItem& aItem); |
|
48 void UpdateL(const CContactItem& aItem); |
|
49 void DeleteL(const CContactItem& aItem, TBool& aLowDiskErrorOccurred); |
|
50 void CreateTableL(); |
|
51 |
|
52 public: // CPplPredictiveSearchTableBase |
|
53 QList<QChar> FillAllTables() const; |
|
54 |
|
55 private: // From CPplPredictiveSearchTableBase |
|
56 HBufC* TableNameL(const QChar aCh) const; |
|
57 |
|
58 TBool IsValidChar(const QChar /*aChar*/) const { return ETrue; } |
|
59 void FillKeyboardSpecificFieldsL(RSqlStatement& /*aSqlStatement*/, |
|
60 QStringList /*aTokens*/) {} |
|
61 |
|
62 public: // New functions |
|
63 TBool IsLanguageValidL() const; |
|
64 void StoreCurrentLanguageL() const; |
|
65 |
|
66 protected: |
|
67 void ConstructL(); |
|
68 CPredictiveSearchSettingsTable(RSqlDatabase& aDatabase); |
|
69 |
|
70 private: |
|
71 void WriteToDbL(const CContactItem& aItem); |
|
72 |
|
73 enum QLocale::Language GetCurrentLanguageL() const; |
|
74 |
|
75 enum QLocale::Language ReadStoredLanguageL() const; |
|
76 |
|
77 // For unit testing |
|
78 friend class UT_CPredictiveSearchSettingsTable; |
|
79 }; |
|
80 |
|
81 #endif // __CPREDICTIVESEARCHSETTINGSTABLE_H__ |