|
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: This component is to store the details of harvester plugins |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CCOTENTINFODB_H_ |
|
19 #define CCOTENTINFODB_H_ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <f32file.h> |
|
23 #include <sqldb.h> |
|
24 |
|
25 class CContentInfo; |
|
26 |
|
27 class CContentInfoDb : public CBase |
|
28 { |
|
29 public : |
|
30 /* |
|
31 * Construction |
|
32 * @return instance of CContentInfo database |
|
33 */ |
|
34 static CContentInfoDb* NewL(); |
|
35 |
|
36 /* |
|
37 * Construction |
|
38 * @return instance of CContentInfo database |
|
39 */ |
|
40 static CContentInfoDb* NewLC(); |
|
41 //Destructor |
|
42 virtual ~CContentInfoDb(); |
|
43 |
|
44 private : |
|
45 /* |
|
46 * Default constructor |
|
47 */ |
|
48 CContentInfoDb(); |
|
49 |
|
50 /* |
|
51 * Second phase constructor |
|
52 */ |
|
53 void ConstructL(); |
|
54 |
|
55 public : |
|
56 /* |
|
57 * @description Adds the given details of a plugin to the contentinfo DB. |
|
58 * @param aContentInfo name,Indexing status,blacklist status of the plugin |
|
59 * @return sysmbian error code |
|
60 * Leaves in case of errors. |
|
61 */ |
|
62 TInt AddL( CContentInfo* aContentInfo ); |
|
63 |
|
64 /* |
|
65 * @description Updates the blacklsit status of the plugin. |
|
66 * @param aContentName name of the plugin |
|
67 * @param aBlacklistStatus blacklist status of plugin |
|
68 * @return sysmbian error code |
|
69 * Leaves in case of errors. |
|
70 */ |
|
71 TInt UpdateBlacklistStatusL( const TDesC& aContentName , TInt aBlacklistStatus ); |
|
72 |
|
73 /* |
|
74 * @description Updates the enable status of the plugin. |
|
75 * @param aContentName name of the plugin |
|
76 * @param aIndexStatus Indexing status of plugin |
|
77 * @return sysmbian error code |
|
78 * Leaves in case of errors. |
|
79 */ |
|
80 TInt UpdatePluginIndexStatusL( const TDesC& aContentName , TInt aIndexStatus ); |
|
81 |
|
82 /* |
|
83 * @description Removes the given details of a plugin from the contentInfo DB. |
|
84 * @param aContentName name of the plugin |
|
85 * Leaves in case of errors. |
|
86 */ |
|
87 void RemoveL( const TDesC& aContentName ); |
|
88 |
|
89 /* |
|
90 * @description Removes all the rows in the database. |
|
91 * Leaves in case of errors. |
|
92 */ |
|
93 void ResetDatabaseL( ); |
|
94 |
|
95 /* |
|
96 * @description Returns the count of the content in content info DB |
|
97 * @return content count |
|
98 * Leaves in case of errors. |
|
99 */ |
|
100 TInt GetContentCountL( ); |
|
101 |
|
102 /* |
|
103 * @description Checks if the plugin details is present in the database. |
|
104 * @param aContentName name of the plugin |
|
105 * Leaves in case of errors. |
|
106 */ |
|
107 TBool FindL(const TDesC& aContentName); |
|
108 |
|
109 |
|
110 private : |
|
111 /* |
|
112 * @description Creates the ContentInfo sql database. |
|
113 * Leaves in case of errors. |
|
114 */ |
|
115 void CreateDBL(); |
|
116 |
|
117 private: |
|
118 /* |
|
119 * Database to maintain the details of ContentInfo plugin.Owned |
|
120 */ |
|
121 RSqlDatabase iDatabase; |
|
122 /** |
|
123 * Flag for, whether database has been opened |
|
124 */ |
|
125 TBool iOpened; |
|
126 }; |
|
127 |
|
128 #endif /* CCOTENTINFODB_H_ */ |