phonebookengines/contactsmodel/inc/CNTDB.H
changeset 37 fd64c38c277d
parent 24 0ba2181d7c28
child 40 b46a585f6909
equal deleted inserted replaced
31:2a11b5b00470 37:fd64c38c277d
     1 /*
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 * All rights reserved.
     3 // This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 *
     8 // Initial Contributors:
     9 * Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    10 //
    11 *
    11 // Contributors:
    12 * Contributors:
    12 //
    13 *
    13 // Description:
    14 * Description: 
    14 //
    15 *
       
    16 */
       
    17 
       
    18 
    15 
    19 #ifndef __CNTDB_H__
    16 #ifndef __CNTDB_H__
    20 #define __CNTDB_H__
    17 #define __CNTDB_H__
    21 
    18 
    22 // System includes
    19 // System includes
    58 class MLplPersistenceLayerFactory;
    55 class MLplPersistenceLayerFactory;
    59 class CContactOpenOperation;
    56 class CContactOpenOperation;
    60 class CDataBaseChangeObserver;
    57 class CDataBaseChangeObserver;
    61 class CContactConverter;
    58 class CContactConverter;
    62 
    59 
       
    60 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    61 class CContactSynchroniser;
       
    62 #endif
       
    63 
    63 // Constants
    64 // Constants
    64 
    65 
    65 /** 
    66 /** 
    66 Maximum string length used to separate the fields in the text definition.
    67 Maximum string length used to separate the fields in the text definition.
    67 @see TContactTextDefItem
    68 @see TContactTextDefItem
    79 Maximum number of fields that can be set as filterable fields by licensees.
    80 Maximum number of fields that can be set as filterable fields by licensees.
    80 @publishedAll
    81 @publishedAll
    81 @released
    82 @released
    82 */
    83 */
    83 const TInt KMaxCustomFilterableFields=4;
    84 const TInt KMaxCustomFilterableFields=4;
       
    85 
       
    86 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    84 
    87 
    85 /** @internalComponent */
    88 /** @internalComponent */
    86 const TInt KMajorVersion=1;
    89 const TInt KMajorVersion=1;
    87 /** @internalComponent */
    90 /** @internalComponent */
    88 const TInt KMinorVersion=0;
    91 const TInt KMinorVersion=0;
    89 /** @internalComponent */
    92 /** @internalComponent */
    90 const TInt KBuildNumber=41;
    93 const TInt KBuildNumber=41;
    91 
    94 
       
    95 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
    92 
    96 
    93 //
    97 //
    94 // Classes used for compact
    98 // Classes used for compact
    95 //
    99 //
    96 
   100 
   133 	IMPORT_C virtual void MContactUiActive_Reserved1();
   137 	IMPORT_C virtual void MContactUiActive_Reserved1();
   134 	};
   138 	};
   135 
   139 
   136 class CContactActiveBase : public CBase, public MContactUiActive
   140 class CContactActiveBase : public CBase, public MContactUiActive
   137 /**
   141 /**
   138 @internalTechnology
   142 @publishedAll
       
   143 @released
   139 */
   144 */
   140 	{
   145 	{
   141 public:
   146 public:
   142 	~CContactActiveBase();
   147 	~CContactActiveBase();
   143 	void SetObserver(MContactUiCompactObserver *aObserver);
   148 	void SetObserver(MContactUiCompactObserver *aObserver);
   524     @deprecated
   529     @deprecated
   525     */
   530     */
   526 	virtual void HandleSortEventL(TInt aContactsSorted, TInt aContactsTotal)=0;
   531 	virtual void HandleSortEventL(TInt aContactsSorted, TInt aContactsTotal)=0;
   527 	};
   532 	};
   528 
   533 
       
   534 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   529 class MConverterCallBack
   535 class MConverterCallBack
   530 /**
   536 /**
   531 Interface class for providing Intra-Contact Properties during a PBAP specific contacts export.
   537 Interface class for providing Intra-Contact Properties during a PBAP specific contacts export.
   532 @released
   538 @released
   533 @internalTechnology
   539 @internalTechnology
   538 	PBAP clients are supposed to provide any information regarding the contact item represented by aContactId.
   544 	PBAP clients are supposed to provide any information regarding the contact item represented by aContactId.
   539 	This information should be in form of standard vCard property, all such properties should be appended to the array aPropertyList.
   545 	This information should be in form of standard vCard property, all such properties should be appended to the array aPropertyList.
   540 	*/
   546 	*/
   541 	virtual	void AddIntraContactPropertiesL(const TContactItemId& aContactId, CArrayPtr<CParserProperty>* aPropertyList) = 0;
   547 	virtual	void AddIntraContactPropertiesL(const TContactItemId& aContactId, CArrayPtr<CParserProperty>* aPropertyList) = 0;
   542 };
   548 };
       
   549 #else
       
   550 class MConverterCallBack;
       
   551 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
   543 
   552 
   544 enum TVCardVersion
   553 enum TVCardVersion
   545 /**
   554 /**
   546 Specifies type of export of contact items.
   555 Specifies type of export of contact items.
   547 PBAP clients should use EPBAPVCard21 and EPBAPVCard30.
   556 PBAP clients should use EPBAPVCard21 and EPBAPVCard30.
   548 @released
   557 @publishedAll
   549 @internalTechnology
   558 @released
   550 */
   559 */
   551 	{
   560 	{
   552 	EVCardUDEF = -1,
   561 	EVCardUDEF = -1,
   553 	EVCard21 = 0,
   562 	EVCard21 = 0,
   554 	EVCard30,
   563 	EVCard30,
   731 		/** Allows for a multi-threaded program to access the contact database from multiple
   740 		/** Allows for a multi-threaded program to access the contact database from multiple
   732 		threads but note that the contacts model provides no synchronisation support
   741 		threads but note that the contacts model provides no synchronisation support
   733 		for such use. */
   742 		for such use. */
   734 		EMultiThread
   743 		EMultiThread
   735 		};
   744 		};
       
   745 		
       
   746 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   736 /**
   747 /**
   737 @internalComponent
   748 @internalComponent
   738 */
   749 */
   739 	enum TSortDataSource
   750 	enum TSortDataSource
   740 		{
   751 		{
   741 		ENoOrder,
   752 		ENoOrder,
   742 		EUsesIdentityTableOnly,
   753 		EUsesIdentityTableOnly,
   743 		EUsesAllTables,
   754 		EUsesAllTables,
   744 		EIdentityTableNotUsed //Not used
   755 		EIdentityTableNotUsed //Not used
   745 		};
   756 		};
       
   757 #endif
   746 public:
   758 public:
   747 	IMPORT_C static CContactDatabase* OpenL(TThreadAccess aAccess=ESingleThread);
   759 	IMPORT_C static CContactDatabase* OpenL(TThreadAccess aAccess=ESingleThread);
   748 	IMPORT_C static CContactDatabase* OpenL(const TDesC& aFileName,TThreadAccess aAccess=ESingleThread);
   760 	IMPORT_C static CContactDatabase* OpenL(const TDesC& aFileName,TThreadAccess aAccess=ESingleThread);
   749 	IMPORT_C static CContactDatabase* CreateL(TThreadAccess aAccess=ESingleThread);
   761 	IMPORT_C static CContactDatabase* CreateL(TThreadAccess aAccess=ESingleThread);
   750 	IMPORT_C static CContactDatabase* CreateL(const TDesC& aFileName,TThreadAccess aAccess=ESingleThread);
   762 	IMPORT_C static CContactDatabase* CreateL(const TDesC& aFileName,TThreadAccess aAccess=ESingleThread);
   994 	void FetchGroupAndTemplateListsL();
  1006 	void FetchGroupAndTemplateListsL();
   995 
  1007 
   996 public:
  1008 public:
   997 	void CancelNotifyRequestL();
  1009 	void CancelNotifyRequestL();
   998 	TBool IsICCSynchronisedL();
  1010 	TBool IsICCSynchronisedL();
   999 	
  1011 
  1000 	void OpenDatabaseAsyncL(TRequestStatus& aStatus, const TDesC& aFileName = KNullDesC);
  1012 	void OpenDatabaseAsyncL(TRequestStatus& aStatus, const TDesC& aFileName = KNullDesC);
  1001 	static void CleanupLastLockedContact(TAny *aDatabase);
  1013 	static void CleanupLastLockedContact(TAny *aDatabase);
  1002 
  1014 
  1003 private:
  1015 private:
  1004 	CContactConverter& ConverterL(const TUid& aFormat);
  1016 	CContactConverter& ConverterL(const TUid& aFormat);
  1153 	MContactDbObserver* iObserver;
  1165 	MContactDbObserver* iObserver;
  1154 	};
  1166 	};
  1155 
  1167 
  1156 
  1168 
  1157 /** The UID of the default vCard converter implemented by an ECom plugin.
  1169 /** The UID of the default vCard converter implemented by an ECom plugin.
  1158 @internalComponent
  1170 @publishedAll
       
  1171 @released
  1159 */
  1172 */
  1160 #define KUidEComCntVCardConverterDefaultImplementation  0x102035F9
  1173 #define KUidEComCntVCardConverterDefaultImplementation  0x102035F9
  1161 /** The UID of the default vCard converter plugin implementation. This
  1174 /** The UID of the default vCard converter plugin implementation. This
  1162 implementation is independent of the plugin framework used. 
  1175 implementation is independent of the plugin framework used. 
  1163 @publishedAll
  1176 @publishedAll
  1164 @released
  1177 @released
  1165 */
  1178 */
  1166 #define KUidVCardConvDefaultImpl 	KUidEComCntVCardConverterDefaultImplementation
  1179 #define KUidVCardConvDefaultImpl 	KUidEComCntVCardConverterDefaultImplementation
  1167 
  1180 
  1168 /** The UID of the vCard converter ECom plugin interface. */
  1181 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
  1182 
       
  1183 /** The UID of the vCard converter ECom plugin interface. 
       
  1184 @released
       
  1185 @internalTechnology
       
  1186 */
  1169 const TUid KUidEcomCntVCardConverterInterface = {0x102035F7};
  1187 const TUid KUidEcomCntVCardConverterInterface = {0x102035F7};
  1170 
  1188 
  1171 /** The UID of the phone number parser ECom plugin interface. */
  1189 /** The UID of the phone number parser ECom plugin interface. 
       
  1190 @released
       
  1191 @internalTechnology
       
  1192 */
  1172 const TUid KUidEcomCntPhoneNumberParserInterface = {0x102035FA};
  1193 const TUid KUidEcomCntPhoneNumberParserInterface = {0x102035FA};
  1173 
  1194 
  1174 /** The UID of PBAP vCard Converter plugin Implementation.
  1195 /** The UID of PBAP vCard Converter plugin Implementation.
  1175 @released
       
  1176 @internalTechnology
  1196 @internalTechnology
       
  1197 @released
  1177 */
  1198 */
  1178 #define KUidPBAPVCardConvImpl 0xA00015C1
  1199 #define KUidPBAPVCardConvImpl 0xA00015C1
       
  1200 
       
  1201 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
  1179 
  1202 
  1180 class TPluginParameters
  1203 class TPluginParameters
  1181 /**
  1204 /**
  1182 Class used to pack the extra arguments required for a PBAP conveter,
  1205 Class used to pack the extra arguments required for a PBAP conveter,
  1183 PBAP client provides these arguments using overloaded CContactDatabase::ExportSelectedContacts.
  1206 PBAP client provides these arguments using overloaded CContactDatabase::ExportSelectedContacts.
  1184 @released
  1207 @publishedAll
  1185 @internalComponent
  1208 @released
  1186 */
  1209 */
  1187 {
  1210 {
  1188 public:
  1211 public:
  1189 	TPluginParameters(TInt64 aContactFieldFilter, MConverterCallBack* aCallback, TVCardVersion aVersion, TBool aExportTel);
  1212 	TPluginParameters(TInt64 aContactFieldFilter, MConverterCallBack* aCallback, TVCardVersion aVersion, TBool aExportTel);
  1190 	TInt64 GetFilter()const;
  1213 	TInt64 GetFilter()const;
  1223 
  1246 
  1224 class CContactConverter : public CBase
  1247 class CContactConverter : public CBase
  1225 /** Provides functionality to import and export vCards.
  1248 /** Provides functionality to import and export vCards.
  1226 One or more vCards can be imported from a read stream (the vCards are converted 
  1249 One or more vCards can be imported from a read stream (the vCards are converted 
  1227 into contact items and added to the database). Also, contact items can be exported as vCards.
  1250 into contact items and added to the database). Also, contact items can be exported as vCards.
  1228 
  1251 @publishedAll
  1229 @publishedPartner
       
  1230 @released
  1252 @released
  1231 */
  1253 */
  1232 	{
  1254 	{
  1233 public:
  1255 public:
  1234 	virtual CArrayPtr<CContactItem>*  ImportL(CContactDatabase& aDb,RReadStream& aReadStream,TBool& aImportSuccessful,TInt aOptions,TBool aImportSingle)=0;
  1256 	virtual CArrayPtr<CContactItem>*  ImportL(CContactDatabase& aDb,RReadStream& aReadStream,TBool& aImportSuccessful,TInt aOptions,TBool aImportSingle)=0;
  1238 
  1260 
  1239 class CContactEcomConverter : public CContactConverter
  1261 class CContactEcomConverter : public CContactConverter
  1240 /**
  1262 /**
  1241 It provides Ecom Framework based facilities to resolve and load the appropriate implementations at run-time.
  1263 It provides Ecom Framework based facilities to resolve and load the appropriate implementations at run-time.
  1242 The framework supplies a default resolver for selecting appropriate implementations.
  1264 The framework supplies a default resolver for selecting appropriate implementations.
  1243 @publishedPartner
  1265 @publishedAll
  1244 @released
  1266 @released
  1245 */
  1267 */
  1246 	{
  1268 	{
  1247 public:
  1269 public:
  1248 	static CContactEcomConverter* NewL(TUid aImplementationUid);
  1270 	static CContactEcomConverter* NewL(TUid aImplementationUid);
  1285 /** The destruction of the interface implementation referred to by iDtor_ID_Key */
  1307 /** The destruction of the interface implementation referred to by iDtor_ID_Key */
  1286 	{
  1308 	{
  1287 	REComSession::DestroyedImplementation(iDtor_ID_Key);
  1309 	REComSession::DestroyedImplementation(iDtor_ID_Key);
  1288 	}
  1310 	}
  1289 
  1311 
  1290 
  1312 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
  1291 class CContactPhoneNumberParser : public CBase
  1313 class CContactPhoneNumberParser : public CBase
  1292 /** Provides functionality to extract the real phone number from a contact's phone number field.
  1314 /** Provides functionality to extract the real phone number from a contact's phone number field.
  1293 @publishedPartner
  1315 @publishedPartner
  1294 @released
  1316 @released
  1295 */
  1317 */
  1327 inline CContactEcomPhoneNumberParser::~CContactEcomPhoneNumberParser()
  1349 inline CContactEcomPhoneNumberParser::~CContactEcomPhoneNumberParser()
  1328 /** The destruction of the interface implementation referred to by iDtor_ID_Key */
  1350 /** The destruction of the interface implementation referred to by iDtor_ID_Key */
  1329 	{
  1351 	{
  1330 	REComSession::DestroyedImplementation(iDtor_ID_Key);
  1352 	REComSession::DestroyedImplementation(iDtor_ID_Key);
  1331 	}
  1353 	}
  1332 
  1354 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
  1333 
  1355 
  1334 inline TInt CContactDatabase::TemplateCount() const
  1356 inline TInt CContactDatabase::TemplateCount() const
  1335 /** Gets the number of contact card templates that exist in the database.
  1357 /** Gets the number of contact card templates that exist in the database.
  1336 This does not include the system template.
  1358 This does not include the system template.
  1337 @deprecated
  1359 @deprecated