23
|
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: contentinfodb update api.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
#ifndef CONTENTINFODBUPDATE_H
|
|
18 |
#define CONTENTINFODBUPDATE_H
|
|
19 |
#include "contentinfodbcommon.h"
|
|
20 |
#include <qobject.h>
|
|
21 |
#include <qmap.h>
|
|
22 |
#include <qstringlist.h>
|
|
23 |
|
|
24 |
CONTENTINFODB_CLASS(ContentinfodbTest)
|
|
25 |
|
|
26 |
class ContentInfoDbParser;
|
|
27 |
class ContentInfoDb;
|
|
28 |
|
|
29 |
class DECL_CONTENTINFODB ContentInfoDbUpdate : public QObject
|
|
30 |
{
|
|
31 |
Q_OBJECT
|
|
32 |
public:
|
|
33 |
/**
|
|
34 |
* Constructor.
|
|
35 |
* @since S60 ?S60_version.
|
|
36 |
*/
|
|
37 |
ContentInfoDbUpdate();
|
|
38 |
|
|
39 |
/**
|
|
40 |
* Destructor.
|
|
41 |
* @since S60 ?S60_version.
|
|
42 |
*/
|
|
43 |
~ContentInfoDbUpdate();
|
|
44 |
|
|
45 |
public:
|
|
46 |
|
|
47 |
/**
|
|
48 |
* returns success/failure status.
|
|
49 |
* @since S60 ?S60_version.
|
|
50 |
* @param xmlpath is the file path
|
|
51 |
*/
|
|
52 |
bool UpdateDb(QString xmlpath);
|
|
53 |
|
|
54 |
/**
|
|
55 |
* returns success/failure status.
|
|
56 |
* @since S60 ?S60_version.
|
|
57 |
* @param primarykey
|
|
58 |
* @param value is the blacklisted status
|
|
59 |
*/
|
|
60 |
bool UpdateBlacklisted(QString primarykey, int value);
|
|
61 |
|
|
62 |
/**
|
|
63 |
* returns success/failure status.
|
|
64 |
* @since S60 ?S60_version.
|
|
65 |
* @param primarykey
|
|
66 |
* @param value is the indexing status
|
|
67 |
*/
|
|
68 |
bool UpdateIndexStatus(QString primarykey, int value);
|
|
69 |
|
|
70 |
/**
|
|
71 |
* deletes the row for the mentioned primarykey
|
|
72 |
* @since S60 ?S60_version.
|
|
73 |
* @param primarykey
|
|
74 |
*/
|
|
75 |
void deleteCategory(QString primarykey);
|
|
76 |
|
|
77 |
private:
|
|
78 |
|
|
79 |
/**
|
|
80 |
* funtion to create a row with primary key on mentioned table.
|
|
81 |
* @param tablename
|
|
82 |
* @param tagname
|
|
83 |
* @param data will have mapped data of tagname and value
|
|
84 |
*/
|
|
85 |
QString InsertPrimaryKey(QString tableName, QString tagName, QMap<
|
|
86 |
QString, QString> data);
|
|
87 |
|
|
88 |
public slots:
|
|
89 |
|
|
90 |
/**
|
|
91 |
* slot to update the category details to db.
|
|
92 |
* @param map will have mapped data of tagname and value
|
|
93 |
*/
|
|
94 |
void slotupdateCategoryInfo(QMap<QString, QString> );
|
|
95 |
|
|
96 |
/**
|
|
97 |
* slot to update the activity uri details to db.
|
|
98 |
* @param map will have mapped data of tagname and value
|
|
99 |
*/
|
|
100 |
void slotupdateUri(QMap<QString, QString> );
|
|
101 |
|
|
102 |
/**
|
|
103 |
* slot to update the fieldmapping details to db.
|
|
104 |
* @param string will be having name of the field
|
|
105 |
* @param list will be having the uri reference number list
|
|
106 |
*/
|
|
107 |
void slotupdateFieldmapping(QString, QStringList);
|
|
108 |
|
|
109 |
/**
|
|
110 |
* slot to update the first line details to db.
|
|
111 |
* @param list will be having the field name as values
|
|
112 |
*/
|
|
113 |
void slotfirstLineMapping(QStringList);
|
|
114 |
|
|
115 |
/**
|
|
116 |
* slot to update the relevancy details to db.
|
|
117 |
* @param string as field name
|
|
118 |
* @param string as boostfactor
|
|
119 |
*/
|
|
120 |
void slotrelevancyMapping(QString, QString);
|
|
121 |
|
|
122 |
private:
|
|
123 |
|
|
124 |
/**
|
|
125 |
* parser handler
|
|
126 |
* Own.
|
|
127 |
*/
|
|
128 |
ContentInfoDbParser* iParser;
|
|
129 |
|
|
130 |
/**
|
|
131 |
* handler to manage database operations
|
|
132 |
* Own.
|
|
133 |
*/
|
|
134 |
ContentInfoDb* mdb;
|
|
135 |
|
|
136 |
/**
|
|
137 |
* not to create a repeated table names for dynamic table creation
|
|
138 |
* Own.
|
|
139 |
*/
|
|
140 |
int counter;
|
|
141 |
|
|
142 |
/**
|
|
143 |
* primary key
|
|
144 |
* Own.
|
|
145 |
*/
|
|
146 |
QString primarykey;
|
|
147 |
private:
|
|
148 |
CONTENTINFODB_FRIEND_CLASS(ContentinfodbTest)
|
|
149 |
};
|
|
150 |
#endif //CONTENTINFODBUPDATE_H
|