|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 #if !defined(__CNTSTD_H__) |
|
18 #define __CNTSTD_H__ |
|
19 |
|
20 #if !defined(__E32DEF_H__) |
|
21 #include <e32def.h> |
|
22 #endif |
|
23 |
|
24 const TInt KNumberOfNewTables = 8;//Used for discovering if we're opening an old version of cntmodel |
|
25 |
|
26 _LIT(KContactTableName,"CONTACTS"); |
|
27 _LIT(KContactGroupTableName,"GROUPS"); |
|
28 _LIT(KContactGroupTableNameByGroup,"GROUPS2"); |
|
29 _LIT(KContactPrefTableName,"PREFERENCES"); |
|
30 _LIT(KContactPhoneMatchingTableName,"PHONE"); |
|
31 _LIT(KSyncTableName,"SYNC"); |
|
32 |
|
33 _LIT(KIdentifierColName,"CM_Id"); |
|
34 _LIT(KLastLastSyncColName,"CM_LastSyncDate"); |
|
35 _LIT(KUidStringColName,"CM_UIDString"); |
|
36 _LIT(KTypeColName,"CM_Type"); |
|
37 _LIT(KTemplateRefId,"CM_PrefTemplateRefId"); |
|
38 _LIT(KLastModifiedColName,"CM_Last_modified"); |
|
39 _LIT(KCreationDateColName,"CM_ContactCreationDate"); |
|
40 _LIT(KAttributesColName,"CM_Attributes"); |
|
41 _LIT(KTextFieldsColName,"CM_TextBlob"); |
|
42 _LIT(KFieldHeaderColName, "CM_Header"); |
|
43 _LIT(KSearchableTextColName,"CM_SearchableText"); |
|
44 _LIT(KPhoneMatchingColName,"CM_PhoneMatching"); |
|
45 _LIT(KPhoneMatchingColNameTwo,"CM_ExtendedPhoneMatching"); |
|
46 _LIT(KItemsContainedColName,"CM_Members"); |
|
47 _LIT(KGroupMembersName,"CM_GroupMembers"); |
|
48 _LIT(KReplicationCountColName,"CM_ReplicationCount"); |
|
49 _LIT(KPrefId,"CM_PrefId"); |
|
50 _LIT(KPrefTemplateId,"CM_PrefTemplateId"); |
|
51 _LIT(KPrefTemplateFileVersion,"CM_PrefFileVer"); |
|
52 _LIT(KPrefFileId,"CM_PrefFileId"); |
|
53 _LIT(KContactTableIdIndex,"cnt_id_index"); |
|
54 _LIT(KSyncTableIdIndex,"sync_id_index"); |
|
55 _LIT(KContactGroupIndex,"cnt_group_index"); |
|
56 _LIT(KContactGroupIndexByGroupId,"cnt_group_index2"); |
|
57 _LIT(KContactPhoneMatchingIndex,"cnt_phone_index"); |
|
58 _LIT(KPrefCreationDate,"CM_creationdate"); |
|
59 _LIT(KPrefOwnCardId,"CM_PrefOwnCardId"); |
|
60 _LIT(KPrefCardTemplateId,"CM_PrefCardTemplateId"); |
|
61 _LIT(KPrefGroupIdList,"CM_PrefGroupIdList"); |
|
62 _LIT(KPrefCardTemplatePrefId,"CM_PrefCardTemplatePrefId"); |
|
63 _LIT(KPrefMachineUniqueId,"CM_MachineUID"); |
|
64 _LIT(KPrefSortOrder,"CM_PrefSortOrder"); |
|
65 _LIT(KContactHintField,"CM_HintField"); |
|
66 |
|
67 _LIT(KContactExtHintField, "CM_ExtHintField"); |
|
68 |
|
69 //LPD//Identity TABLE |
|
70 _LIT(KIdentityTableName, "IDENTITYTABLE"); |
|
71 _LIT(KParentCMID, "Parent_CMID"); |
|
72 _LIT(KFirstNameColName,"CM_FirstName"); |
|
73 _LIT(KLastNameColName,"CM_LastName"); |
|
74 _LIT(KCompanyNameColName,"CM_CompanyName"); |
|
75 _LIT(KFirstNamePronunciationColName,"CM_FirstNmPrn"); |
|
76 _LIT(KLastNamePronunciationColName,"CM_LastNmPrn"); |
|
77 _LIT(KCompanyNamePronunciationColName,"CM_CompanyNmPrn"); |
|
78 _LIT(KIdentityIdIndex, "IdentityIdIndex"); |
|
79 |
|
80 //Email Table |
|
81 _LIT(KEMailTableName, "EMAILTABLE"); |
|
82 _LIT(KEMailParentCMID, "EmailParent_CMID");// |
|
83 _LIT(KEMailFieldID, "EMail_FieldID");//Together these match a unique id. |
|
84 _LIT(KEMailAddress,"EMailAddress"); |
|
85 _LIT(KEMailIdentityIdIndex, "EmailIdentityIdIndex"); |
|
86 |
|
87 //SQL Literals |
|
88 _LIT(KASC,"ASC"); |
|
89 _LIT(KDESC,"DESC"); |
|
90 |
|
91 //Asych Sort Consts |
|
92 //Values for sort window |
|
93 const TInt KSortWindowForeSlots=5; |
|
94 const TInt KSortWindowRearSlots=0; |
|
95 |
|
96 //const TInt KMaxPhoneNumberLenghForSearch=50; |
|
97 _LIT(KSelectStringFromEmailTable,"SELECT EmailParent_CMID FROM EMAILTABLE WHERE EMailAddress LIKE '%S'"); |
|
98 _LIT(KSelectAddressFromEmailTableByCntID,"SELECT EMailAddress FROM EMAILTABLE WHERE EmailParent_CMID = %d"); |
|
99 |
|
100 //Find String Sql lits |
|
101 //_LIT(KSelectStringFromIdentityTable,"SELECT Parent_CMID FROM IDENTITYTABLE WHERE (CM_FirstName LIKE '%S') OR (CM_LastName LIKE '%S') OR (CM_CompanyName LIKE '%S')"); |
|
102 _LIT(KSelectStringFromIdentityTable,"SELECT * FROM IDENTITYTABLE WHERE (CM_FirstName LIKE '%S') OR (CM_LastName LIKE '%S') OR (CM_CompanyName LIKE '%S') OR (CM_FirstNmPrn LIKE '%S') OR (CM_LastNmPrn LIKE '%S') OR (CM_CompanyNmPrn LIKE '%S')"); |
|
103 |
|
104 //_LIT(KSelectStringFromIdentityTableWhere,"SELECT Parent_CMID FROM IDENTITYTABLE WHERE "); |
|
105 _LIT(KSelectStringFromIdentityTableWhere,"SELECT * FROM IDENTITYTABLE WHERE "); |
|
106 |
|
107 _LIT(KSelectAllIdsFromIdentity,"SELECT Parent_CMID, CM_Type FROM IDENTITYTABLE");//Gives an unsorted list of contact ids for every contact |
|
108 _LIT(KSelectStringForTextDefSearch,"SELECT Parent_CMID,CM_FirstName,CM_LastName,CM_CompanyName,CM_FirstNmPrn,CM_LastNmPrn,CM_CompanyNmPrn,CM_Type FROM IDENTITYTABLE WHERE "); |
|
109 |
|
110 _LIT(KLeftBracket,"("); |
|
111 _LIT(KLikeString," LIKE '"); |
|
112 _LIT(KLikeStringRight,"')"); |
|
113 _LIT(KOR," OR "); |
|
114 |
|
115 _LIT(KNullBlobTextField," "); |
|
116 |
|
117 |
|
118 |
|
119 _LIT(KSqlDeleteFromTableFormat,"DELETE FROM %S WHERE %S=%d"); |
|
120 |
|
121 |
|
122 enum TCntModelPanic |
|
123 { |
|
124 ECntPanicInvalidColumnName, |
|
125 ECntPanicInvalidColumnIndex, |
|
126 ECntPanicInvalidItemType, |
|
127 ECntPanicInvalidItemIndex, |
|
128 ECntPanicDbmsResourceNotFreed, |
|
129 ECntPanicNullFieldDefinition, |
|
130 ECntPanicInvalidFieldContentType, |
|
131 ECntPanicViewIsEmpty, |
|
132 ECntPanicDuplicateViewFields, |
|
133 ECntPanicFieldDoesNotExist, |
|
134 ECntPanicNullPointer, |
|
135 ECntPanicDuplicateIds, |
|
136 ECntPanicInternalSortError, |
|
137 ECntPanicUnhandledUid, |
|
138 ECntPanicFieldTypeIndex, |
|
139 ECntPanicInvalidStorageType, |
|
140 ECntPanicStorageAlreadyAllocated, |
|
141 ECntPanicServerNotFound, |
|
142 ECntPanicSystemTemplate, |
|
143 ECntPanicAgentNotNull, |
|
144 ECntPanicTemplateNotEmpty, |
|
145 ECntPanicItemAlreadyExists, |
|
146 ECntPanicInvalidSortArray, |
|
147 ECntPanicPhoneMatchLength, |
|
148 ECntPanicDuffGroup, |
|
149 ECntPanicInvalidSpeedDialContactId, |
|
150 ECntPanicInvalidSpeedDialIndex, |
|
151 ECntPanicInvalidViewIndex, |
|
152 ECntPanicInvalidIndexForSubView, |
|
153 ECntPanicInvalidIndexForConcatenatedView, |
|
154 ECntPanicViewNotReady, |
|
155 ECntPanicNoViewIndexMatchCriteria, |
|
156 ECntPanicUnderlyingViewUnsorted, |
|
157 ECntPanicAsyncViewNotificationPending, |
|
158 ECntPanicObserverNotFound, |
|
159 ECntPanicComponentViewNotFound, |
|
160 ECntPanicInvalidFieldText, |
|
161 ECntPanicFieldTextNotInitialised, |
|
162 ECntPanicUnableToRestartServer, |
|
163 ECntPanicFilterableFieldMaxNumberInUse, |
|
164 ECntPanicFieldTextNotBlank, |
|
165 ECntPanicInvalidConnectionId, |
|
166 ECntPanicAPIRemoved, |
|
167 ECntPanicDuplicateBackupEvent, |
|
168 ECntPanicDuplicateRestoreEvent, |
|
169 ECntPanicUnexpectedEndofRestoreEvent, |
|
170 ECntPanicFieldBufferNotAllocated, |
|
171 ECntPanicFieldBufferAllocError, |
|
172 ECntPanicFieldBufferWrongSize, |
|
173 ECntPanicViewSorterStateMachine, |
|
174 ECntPhonebookSyncObserverList, |
|
175 ECntPanicContactsLeftLocked, |
|
176 ECntPanicLast |
|
177 }; |
|
178 |
|
179 GLREF_C void Panic(TCntModelPanic aPanic); |
|
180 |
|
181 |
|
182 |
|
183 #endif |