|
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 * Description: |
|
13 * |
|
14 */ |
|
15 |
|
16 #ifndef _FAVORITES_WRAPPER_H_ |
|
17 #define _FAVORITES_WRAPPER_H_ |
|
18 |
|
19 #include "irdbexport.h" |
|
20 #include "irdbwrapper.h" |
|
21 |
|
22 class IRDB_DLL_EXPORT favoritesWrapper: public IRDBWrapper |
|
23 { |
|
24 public: |
|
25 favoritesWrapper(); |
|
26 ~favoritesWrapper(); |
|
27 |
|
28 public: |
|
29 /* |
|
30 * RowData: [direction: in] table row value; |
|
31 * bNewRow: [direction: out] true for new row added to favorites table; |
|
32 * false for row updated; |
|
33 * return true if operation success; |
|
34 */ |
|
35 bool putFavorites(columnMap* const RowData, |
|
36 bool& bNewRow); |
|
37 |
|
38 public: |
|
39 /* |
|
40 * If all parameters are default,all rows in favorites will be deleted if not violating constraint; |
|
41 * condAND: [direction: in]condition for search favorites, it is AND relationship in every pair; |
|
42 * condOR: [direction: in]condition for search favorites, it is OR relationship in every pair; |
|
43 * return true if operation success; |
|
44 */ |
|
45 bool deleteFavorites(const columnMap* const condAND = NULL, |
|
46 const columnMap* const condOR = NULL); |
|
47 |
|
48 public: |
|
49 /* |
|
50 * If all parameters are default, all rows in favorites will return; |
|
51 * condAND: [direction: in]condition for search favorites, it is AND relationship in every pair; |
|
52 * condOR: [direction: in]condition for search favorites, it is OR relationship in every pair; |
|
53 * return true if operation success; |
|
54 */ |
|
55 QList<QVariant*>* getFavorites(const columnMap* const condAND = NULL, |
|
56 const columnMap* const condOR = NULL); |
|
57 |
|
58 private: |
|
59 /* |
|
60 * It is called by IRDB instance; |
|
61 * IRDB instance delivers rows set to IRDBWrapper via this function; |
|
62 * the rows set is storaged in m_IRDataSet; |
|
63 */ |
|
64 bool getIRTableCB(QSqlQuery& aIRDataSet, |
|
65 QList<QVariant*>* pDataSet); |
|
66 |
|
67 }; |
|
68 |
|
69 #endif |
|
70 |