phonebookengines_old/contactsmodel/cntmodel/inc/cviewiterator.h
changeset 40 b46a585f6909
equal deleted inserted replaced
37:fd64c38c277d 40:b46a585f6909
       
     1 /**
       
     2 * Copyright (c) 2005-2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25 
       
    26 
       
    27 #ifndef CVIEWITERATOR_H
       
    28 #define CVIEWITERATOR_H
       
    29 
       
    30 #include "persistencelayer.h"
       
    31 
       
    32 #define KIgnoreSessionId 0
       
    33 
       
    34 
       
    35 /**
       
    36 The CViewIterator class prepares and saves data for calls to the
       
    37 MlplViewIteratorManager::ItemAtL() method which does the real work on database
       
    38 views.
       
    39 */
       
    40 NONSHARABLE_CLASS(CViewIterator) : public CBase
       
    41 	{
       
    42 public:
       
    43 	CViewIterator(MLplViewIteratorManager& aManager,const CContactTextDef& aTextDef, TContactViewPreferences aViewPreferences);
       
    44 	~CViewIterator();
       
    45 
       
    46 	void GoFirstL();
       
    47 	CViewContact* NextItemL();
       
    48 	CViewContact* ItemAtL(TInt aCntItemId);
       
    49 
       
    50 private:
       
    51 	MLplViewIteratorManager::TTableMask TableMask(const CContactTextDef& aTextDef);
       
    52 
       
    53 	TBool UsesIdentityTableOnly(TInt aFindFlags);
       
    54 	TBool SearchIdentityTableRequired(TInt aFindFlags);
       
    55 
       
    56 	void SetFindFlagsAndColumnsCount(TInt32 aUid,TInt& aFindFlags,TInt& aIdentityColumnsCount);
       
    57 	void ConstructBitwiseFlagsFromTextDef(TInt& aFindFlags,TInt& aIdentityColumnsCount,const CContactTextDef* aTextDef);
       
    58 	void ConstructBitwiseFindFlags(TInt& aFindFlags,TInt& aIdentityColumnsCount,const CContactItemFieldDef* aFieldDef);
       
    59 
       
    60 private:
       
    61 	enum TFindFieldFlags
       
    62 		{
       
    63 		EFindInAllFields				=0x00000001,
       
    64 		EFindFirstName					=0x00000002,
       
    65 		EFindLastName					=0x00000004,
       
    66 		EFindCompanyName				=0x00000008,
       
    67 		EFindInEmailTableOnly			=0x00000010,
       
    68 		EFindInAnyIdentityField			=0x00000020,
       
    69 		EFindFirstNamePronunciation		=0x00000040,
       
    70 		EFindLastNamePronunciation		=0x00000080,
       
    71 		EFindCompanyNamePronunciation	=0x00000100,
       
    72 		};
       
    73 
       
    74 	MLplViewIteratorManager& iManager;
       
    75 	TInt iCurrentItemId;
       
    76 	/**	Mask of tables required for returning a view. */
       
    77 	MLplViewIteratorManager::TTableMask	iTableMask;
       
    78 	TContactViewPreferences	iViewPreferences;
       
    79 	const CContactTextDef& iTextDef;
       
    80 	};
       
    81 
       
    82 
       
    83 #endif // CVIEWITERATOR_H