equal
deleted
inserted
replaced
|
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 #ifndef IRSEARCHCRITERIADB_H |
|
19 #define IRSEARCHCRITERIADB_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <QEvent> |
|
23 #include <QStringList> |
|
24 #include "irqenums.h" |
|
25 |
|
26 /* use this macro to limit the length of the input string */ |
|
27 #define CRITERIA_UPLIMIT_LENGTH 127 |
|
28 |
|
29 class QSqlDatabase; |
|
30 |
|
31 class IRSearchCriteriaDB : public QObject |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 |
|
37 explicit IRSearchCriteriaDB(int aMaxCount = 100); |
|
38 ~IRSearchCriteriaDB(); |
|
39 IRQError addOneCriteria(const QString& aCriteria); |
|
40 bool getAllCriteria(QStringList& aStrList) const; |
|
41 bool isAlreadyExist(const QString& aCriteria) const; |
|
42 |
|
43 signals: |
|
44 void dataAdded(); |
|
45 |
|
46 private: |
|
47 void createDBConnection(); |
|
48 bool deleteSomeCriteria(); |
|
49 |
|
50 private: |
|
51 |
|
52 QSqlDatabase *iDB; |
|
53 int iMaxCount; |
|
54 }; |
|
55 #endif |