|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Contains NcdProviderDefines namespace |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef NCD_PROVIDER_DEFINES_H |
|
20 #define NCD_PROVIDER_DEFINES_H |
|
21 |
|
22 |
|
23 #include <e32def.h> |
|
24 #include <e32cmn.h> |
|
25 #include <f32file.h> |
|
26 |
|
27 /** |
|
28 * NcdProviderDefines |
|
29 * |
|
30 * @lib |
|
31 * @since S60 v3.2 |
|
32 */ |
|
33 namespace NcdProviderDefines |
|
34 { |
|
35 // Node definitions |
|
36 |
|
37 // This is used when the ram caches sizes are checked |
|
38 // for example to check if the cache cleanup is required. |
|
39 // If the elements in the cache exceed the max count, then |
|
40 // elements that are not in any other use are removed from |
|
41 // the cache until the cache count has reached |
|
42 // KNodeRamCacheDelimiterCount or until no free elements exist |
|
43 // in the cache. |
|
44 // So, KNodeRamCacheDelimiterCount should be set here to be |
|
45 // less than KNodeRamCacheMaxCount. |
|
46 const TInt KNodeRamCacheMaxCount = 50; |
|
47 const TInt KNodeRamCacheDelimiterCount = 25; |
|
48 |
|
49 // Maximum length of client ID. |
|
50 const TInt KClientIdMaxLength = 24; |
|
51 |
|
52 |
|
53 // Maximum number of previews per client |
|
54 const TInt KMaxClientPreviews = 3; |
|
55 |
|
56 |
|
57 // Database definitions |
|
58 |
|
59 _LIT( KPurchaseHistoryDirectory, "ph\\" ); |
|
60 |
|
61 _LIT( KDatabaseExtension, ".db" ); |
|
62 |
|
63 // Default UID for client databases |
|
64 _LIT( KDefaultDatabaseUid, "Db0" ); |
|
65 |
|
66 // UID for download report databases |
|
67 _LIT( KReportDatabaseUid, "Reports" ); |
|
68 |
|
69 // Client definitions |
|
70 |
|
71 // Default UID for file storages in a namespace |
|
72 // There's no need to change this unless more than one filestorage |
|
73 // is needed for a namespace |
|
74 _LIT( KDefaultFileStorageUid, "Fs0" ); |
|
75 |
|
76 // Namespaces that are also used as db directory names |
|
77 _LIT( KRootNodeNameSpace, "r_" ); |
|
78 |
|
79 _LIT( KSearchRootNameSpace, "s_" ); |
|
80 |
|
81 |
|
82 // Namespace used for serialized content downloads |
|
83 _LIT( KDownloadNamespace, "Dl0" ); |
|
84 |
|
85 _LIT( KSubscriptionNamespace, "sub_" ); |
|
86 |
|
87 _LIT( KProviderStorageNamespace, "p_" ); |
|
88 |
|
89 _LIT( KPreviewStorageNamespace, "pr_" ); |
|
90 |
|
91 _LIT( KDataNamespace, "data" ); |
|
92 |
|
93 _LIT( KTempNamespace, "temp" ); |
|
94 |
|
95 // This default byte size that may be used for the db cache cleaner. |
|
96 // If db size exeeds this value, then db cleaning should be |
|
97 // started. Notice, this is bytes not kilobytes. |
|
98 const TInt KDbDefaultMaxByteSize = 1000000; |
|
99 |
|
100 |
|
101 // Protocol defines |
|
102 const TInt KNeverExpires = -1; |
|
103 |
|
104 |
|
105 /** |
|
106 * Hardcoded Master Server URI |
|
107 */ |
|
108 //_LIT( KMasterServerUri, "http://lynx.ionific.com:9084/" ); |
|
109 _LIT( KMasterServerUri, "" ); |
|
110 |
|
111 /** |
|
112 * Types used for database dataitems in provider's storage |
|
113 */ |
|
114 enum TNcdDatabaseDataType |
|
115 { |
|
116 ENcdReservedTypes = 20000, |
|
117 ENcdBinaryData = ENcdReservedTypes, |
|
118 ENcdMasterServerAddress, |
|
119 ENcdContextData, |
|
120 ENcdAccessPointManager, |
|
121 ENcdPreviewManager, |
|
122 ENcdDownloadData, |
|
123 ENcdFavoriteManager, |
|
124 ENcdNodeSeenInfo |
|
125 }; |
|
126 |
|
127 // Namespace used to differentiate between CDB and CGW server details |
|
128 // (cookies, capabilities) |
|
129 _LIT( KConfigNamespace, "cfg" ); |
|
130 |
|
131 _LIT( KNcdTempDir, "temp" ); |
|
132 |
|
133 // File used to check if the startup sequence was successful or not |
|
134 _LIT( KNcdProviderStartupFile, "ncdstartup" ); |
|
135 |
|
136 _LIT( KNcdProviderShutdownFile, "ncdshutdown" ); |
|
137 |
|
138 _LIT( KNcdDatabaseVersionFile, "ncddbversions.cfg" ); |
|
139 |
|
140 /** |
|
141 * Maximum number of failed shutdowns before the dbs are cleaned |
|
142 */ |
|
143 const TInt KNcdMaxFailedShutdowns = 3; |
|
144 |
|
145 /** |
|
146 * String types used to index CCatalogsStringManager |
|
147 */ |
|
148 enum TNcdStringTypes |
|
149 { |
|
150 ENcdStringNodeId = 0, |
|
151 ENcdStringNamespace, |
|
152 // Server URI and Namespace are often the same so this |
|
153 // can save some space |
|
154 ENcdStringServerUri = ENcdStringNamespace |
|
155 }; |
|
156 |
|
157 const TInt KNcdBufferExpandSize = 4096; |
|
158 |
|
159 const TUint KNcdDefaultSearchRecursionDepth = 2; |
|
160 const TUint KNcdMaxSearchRecursionDepth = 5; |
|
161 |
|
162 const TUint KNcdSharableFileOpenFlags = EFileShareReadersOrWriters; |
|
163 |
|
164 /** |
|
165 * These are used for separating objects and end of data |
|
166 * in a data stream |
|
167 */ |
|
168 enum TNcdStreamDataState |
|
169 { |
|
170 ENcdStreamDataObject, |
|
171 ENcdStreamDataEnd |
|
172 }; |
|
173 } |
|
174 |
|
175 #endif // NCD_PROVIDER_DEFINES_H |
|
176 |