phonebookengines/contactsmodel/cntplsql/inc/pltables.h
changeset 24 0ba2181d7c28
parent 0 e686773b3f54
child 25 76a2435edfd4
equal deleted inserted replaced
0:e686773b3f54 24:0ba2181d7c28
     1 /**
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description: 
    15 *
    15 *
    16 */
    16 */
       
    17 
    17 
    18 
    18 
    19 
    19 
    20 
    20 /**
    21 /**
    21  @file
    22  @file
    35 #include <cntfldst.h>
    36 #include <cntfldst.h>
    36 
    37 
    37 #include <sqldb.h>
    38 #include <sqldb.h>
    38 #include <e32hashtab.h>
    39 #include <e32hashtab.h>
    39 
    40 
       
    41 class CPcsKeyMap;
    40 
    42 
    41 /**
    43 /**
    42 The CPplTableBase class forms the base class for all SQLite tables in the
    44 The CPplTableBase class forms the base class for all SQLite tables in the
    43 Persistence Layer. It implements default behaviour for some basic operations.
    45 Persistence Layer. It implements default behaviour for some basic operations.
    44 
    46 
   298 	RSqlDatabase&  iDatabase;
   300 	RSqlDatabase&  iDatabase;
   299 	};
   301 	};
   300 
   302 
   301 
   303 
   302 /**
   304 /**
       
   305 The CPplPredictiveSearchTable class contains numeric representation of the
       
   306 fields that are checked in predictive search.
       
   307 */
       
   308 NONSHARABLE_CLASS(CPplPredictiveSearchTable) : public CPplTableBase
       
   309 	{
       
   310 public:
       
   311 	static CPplPredictiveSearchTable* NewL(RSqlDatabase& aDatabase);
       
   312 	static CPplPredictiveSearchTable* NewLC(RSqlDatabase& aDatabase);
       
   313 	~CPplPredictiveSearchTable();
       
   314 
       
   315 public: // From CPplTableBase
       
   316 	void CreateInDbL(CContactItem& aItem);
       
   317 	void UpdateL(const CContactItem& aItem);
       
   318 	void DeleteL(const CContactItem& aItem, TBool& aLowDiskErrorOccurred);
       
   319 	void CreateTableL();
       
   320 
       
   321 private:
       
   322 	void ConstructL();
       
   323 	CPplPredictiveSearchTable(RSqlDatabase& aDatabase);
       
   324 	void WriteToDbL(const CContactItem& aItem, CCntSqlStatement* aStatement);
       
   325 	HBufC* ConvertToNumericRepresentationLC( const TDesC& aString /*, key map */ );
       
   326 
       
   327 private:
       
   328 	// Owned
       
   329 	CCntSqlStatement* iInsertStmnt;
       
   330 	// Owned
       
   331 	CCntSqlStatement* iUpdateStmnt;
       
   332 	// Owned
       
   333 	CCntSqlStatement* iDeleteStmnt;
       
   334 	// Owned
       
   335 	CPcsKeyMap*		  iKeyMap;
       
   336 
       
   337 	RSqlDatabase&	  iDatabase;
       
   338 	
       
   339 	// For unit testing
       
   340 	friend class UT_CPplPredictiveSearchTable;
       
   341 	};
       
   342 
       
   343 NONSHARABLE_CLASS(CPplPresenceTable) : public CPplTableBase
       
   344     {
       
   345 public:
       
   346     static CPplPresenceTable* NewL(RSqlDatabase& aDatabase);
       
   347     static CPplPresenceTable* NewLC(RSqlDatabase& aDatabase);
       
   348     ~CPplPresenceTable();
       
   349 private:
       
   350     void ConstructL();
       
   351     CPplPresenceTable(RSqlDatabase& aDatabase);
       
   352 public: // From CPplTableBase
       
   353     void CreateTableL();
       
   354     void CreateInDbL(CContactItem& aItem);
       
   355     void UpdateL(const CContactItem& aItem);
       
   356     void DeleteL(const CContactItem& aItem, TBool& aLowDiskErrorOccurred);
       
   357 private:
       
   358     RSqlDatabase&  iDatabase;
       
   359     };
       
   360 /**
   303 This class holds a set of contact database preferences and is used in conjunction
   361 This class holds a set of contact database preferences and is used in conjunction
   304 with the CPplPreferencesPersistor class.
   362 with the CPplPreferencesPersistor class.
   305 */
   363 */
   306 NONSHARABLE_CLASS(RCntPreferences)
   364 NONSHARABLE_CLASS(RCntPreferences)
   307 	{
   365 	{