phonebookengines/contactsmodel/cntplsql/inc/clplproxyfactory.h
changeset 0 e686773b3f54
child 24 0ba2181d7c28
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /**
       
     2 * Copyright (c) 2007-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 CLPLPERSISTENCELAYERFACTORY_H
       
    28 #define CLPLPERSISTENCELAYERFACTORY_H
       
    29 
       
    30 #include "persistencelayer.h"
       
    31 
       
    32 
       
    33 /**
       
    34 The CViewIteratorProxyManager class is a proxy for the MLplViewIteratorManager
       
    35 class.  The proxy is used for client-side access to the required view functions
       
    36 in the Persistence Layer on the server.
       
    37 
       
    38 Internally the proxy makes the relevant IPC calls using the Contacts Model
       
    39 session handle from the Contacts database used to create the proxy object.
       
    40 */
       
    41 NONSHARABLE_CLASS(CViewIteratorProxyManager) : public CBase , public MLplViewIteratorManager
       
    42 	{
       
    43 public:
       
    44 	static CViewIteratorProxyManager* NewL(const CContactDatabase& aDb);
       
    45 	~CViewIteratorProxyManager();
       
    46 
       
    47 	TInt OpenViewL(const CContactTextDef& aTextDef, TContactViewPreferences aViewPrefs);
       
    48 	void CloseView(TInt aViewId);
       
    49 	
       
    50 	void ChangeSortOrderL(TInt aViewId, const CContactTextDef& aTextDef);
       
    51 	
       
    52 	//Iterator Methods
       
    53 	void BeginIterateL(TInt aViewId);
       
    54 	void EndIterateL(TInt aViewId);
       
    55 	CViewContact* NextItemL(TInt aViewId, TContactViewPreferences aViewPrefs);
       
    56 	CViewContact* ItemAtL(TContactItemId aContactId, TInt aViewId);
       
    57 
       
    58     TUid ReadContactTextDefL(TContactItemId aContactId, TDes &aResult,const CContactTextDef& aTextDef);
       
    59 	void TextFieldL(TInt aCntItemId,TFieldType aFieldType, TDes& aText);
       
    60     	
       
    61 private:
       
    62 	void ConstructL();
       
    63 	CViewIteratorProxyManager(const CContactDatabase& aDb);
       
    64 
       
    65 private:
       
    66 	const CContactDatabase& iDb;
       
    67 	};
       
    68 
       
    69 
       
    70 /**
       
    71 The CCollectionProxy class is a proxy for the MLplCollection class.  The proxy
       
    72 is used for client-side access to the required collection functions in the
       
    73 Persistence Layer on the server.
       
    74 
       
    75 Internally the proxy makes the relevant IPC calls using the Contacts Model
       
    76 session handle from the Contacts database used to create the proxy object.
       
    77 */
       
    78 NONSHARABLE_CLASS(CCollectionProxy) : public CBase , public MLplCollection
       
    79 	{
       
    80 public:
       
    81 	CCollectionProxy(const CContactDatabase& aDb);
       
    82 
       
    83 	CContactIdArray* CollectionL(TLplViewType aViewType,TTime aTime = 0,const TDesC& aGuid = KNullDesC);
       
    84 
       
    85 	TInt ContactCountL();
       
    86 
       
    87 	void Reset();
       
    88 
       
    89 	void FindAsyncInitL(const TDesC& aText,CContactItemFieldDef* aFieldDef);
       
    90 	void FindAsyncTextDefInitL(const CDesCArray& aWords,CContactTextDef* aTextDef);
       
    91 	CContactIdArray* FindAsyncL(TBool& aMoreToGo, TUint aSessionId);
       
    92 	CContactIdArray* FindL(const TDesC& aText, const CContactItemFieldDef* aFieldDef, TUint aSessionId);
       
    93 
       
    94 	TBool ContactMatchesHintFieldL (TInt aBitWiseFilter, TContactItemId aContactId);
       
    95 	CContactIdArray* MatchPhoneNumberL(const TDesC& aNumber, const TInt aMatchLengthFromRight);
       
    96 
       
    97 	CContactIdArray* FilterDatabaseL(CCntFilter& aFilter);
       
    98 	
       
    99 	TBool UsesIdentityFieldsOnly(TInt aFindFlags);
       
   100 	void ConstructBitwiseFlagsFromTextDef(TInt& aFindFlags,TInt& aIdentityColumnsCount,const CContactTextDef* aTextDef);
       
   101 	TBool SeekContactL(TContactItemId aReqId,TContactItemId& aId,TUid& aContactType, TBool& aDeleted);
       
   102 private:
       
   103 	const CContactDatabase& iDb;
       
   104 	};
       
   105 
       
   106 
       
   107 /**
       
   108 The CProxyFactory class is a proxy for the MLplPersistenceLayerFactory class.
       
   109 It provides methods for accessing several interfaces (which at this level are
       
   110 themselves implemented as proxies).
       
   111 */
       
   112 NONSHARABLE_CLASS(CProxyFactory) : public CBase, public MLplPersistenceLayerFactory
       
   113 	{
       
   114 public:
       
   115 	static CProxyFactory* NewL(const CContactDatabase& aDb);
       
   116 	~CProxyFactory();
       
   117 
       
   118 	MLplViewIteratorManager& GetViewIteratorManagerL();
       
   119 	MContactSynchroniser& GetContactSynchroniserL(TUint aSessionId);
       
   120 	MLplCollection& GetCollectorL();
       
   121 
       
   122 private:
       
   123 	void ConstructL();
       
   124 	CProxyFactory(const CContactDatabase& aDb);
       
   125 
       
   126 private:
       
   127 	const CContactDatabase& iDb;
       
   128 	CViewIteratorProxyManager* iManager;
       
   129 	CContactSynchroniser* iSynchroniser;
       
   130 	CCollectionProxy* iCollection;
       
   131 	};
       
   132 
       
   133 #endif // CLPLPERSISTENCELAYERFACTORY_H