emailuis/emailui/inc/FreestyleEMailUiCLSMatchObserverInterface.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Base class for Contact and RMU match observers
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef FREESTYLEEMAILUICLSMATCHOBSERVERINTERFACE_H
       
    20 #define FREESTYLEEMAILUICLSMATCHOBSERVERINTERFACE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 //#include <cntdef.h>				// TContactItemId
       
    25 
       
    26 #include <MPsResultsObserver.h>
       
    27 #include <CPcsDefs.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CRepository;
       
    31 class CPSRequestHandler;
       
    32 class CFSEmailUiClsListsHandler;
       
    33 class CVPbkContactManager;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37  * Base class for Contact and RMU match observers
       
    38  *
       
    39  *
       
    40  */
       
    41  
       
    42 class CFSEmailUiClsMatchObserver : public CBase, public MPsResultsObserver
       
    43 	{
       
    44 	
       
    45 public:
       
    46 	
       
    47 	static CFSEmailUiClsMatchObserver* CFSEmailUiClsMatchObserver::NewL( CRepository& aCr, 
       
    48 				CFSEmailUiClsListsHandler& aListsHandler,
       
    49 				CPSRequestHandler& aRequestHandler,
       
    50 				CVPbkContactManager* aContactManager );
       
    51 	
       
    52 	static CFSEmailUiClsMatchObserver* CFSEmailUiClsMatchObserver::NewLC( CRepository& aCr, 
       
    53 				CFSEmailUiClsListsHandler& aListsHandler,
       
    54 				CPSRequestHandler& aRequestHandler,
       
    55 				CVPbkContactManager* aContactManager);	
       
    56 	
       
    57     /**
       
    58      * Destructor.
       
    59      *
       
    60      */  
       
    61   	 virtual ~CFSEmailUiClsMatchObserver();
       
    62 
       
    63  public: // New methods
       
    64  
       
    65    /**
       
    66     * Sets new search text and either starts a search or buffers the search 
       
    67     * request. 
       
    68     *
       
    69     * @param aText new search text.
       
    70     */
       
    71  	virtual void SearchMatchesL( const TDesC& aText );
       
    72 
       
    73    /**
       
    74     * Sets given input mode to current matcher. 
       
    75     *
       
    76     * @param aInputMode weather the predictive input mode is to be set on/off.
       
    77     *				If EQwerty, multitap mode is set. If EItut predictive mode is set.
       
    78     */
       
    79  	virtual void SetInputMode( TKeyboardModes aInputMode ); 
       
    80  
       
    81  public: // From MPsResultsObserver
       
    82 	
       
    83 	 virtual void HandlePsResultsUpdate(RPointerArray<CPsClientData>& searchResults,
       
    84 	 		                                    RPointerArray<CPsPattern>& searchSeqs);
       
    85 	 void HandlePsResultsUpdateL(RPointerArray<CPsClientData>& searchResults,
       
    86 	          RPointerArray<CPsPattern>& searchSeqs );
       
    87 	 
       
    88 	 virtual void HandlePsError(TInt aErrorCode);
       
    89 	 virtual void CachingStatus(TCachingStatus& aStatus, TInt& aError);
       
    90  protected:
       
    91 
       
    92     /**
       
    93      * C++ default constructor.
       
    94      *
       
    95 	 * @param aCR refenrence to aknfep cenrep
       
    96 	 * @param aListsHandler reference to listshandler object.
       
    97 	 * @param aContactListingService reference to contact listing service object who provides
       
    98 	 *									matcher object for the MRU list
       
    99      *
       
   100      */
       
   101   	 CFSEmailUiClsMatchObserver( CRepository& aCr, 
       
   102   			 					CFSEmailUiClsListsHandler& aListsHandler,
       
   103   			 					CPSRequestHandler& aRequestHandler,
       
   104   			 					CVPbkContactManager* aContactManager );
       
   105 	 
       
   106 	/**
       
   107 	 * Returns wheather current input mode is predictive (EItut) or QWERTY. 
       
   108 	 *
       
   109 	 * @return TKeyboardModes EItut if predictive. EQwerty if anything else.
       
   110 	 */
       
   111 	virtual TKeyboardModes GetInputMode();
       
   112 	
       
   113 	
       
   114 	void ConstructL();
       
   115 
       
   116  protected: // Functions from base classes
       
   117 
       
   118  private:
       
   119 	
       
   120 	/**
       
   121 	 * Chech the status of PCS cache
       
   122 	 * KErrNone, if Cache is OK. In progress = KErrNotReady, 
       
   123 	 * not started = KErrNotFound, complete with errors = KErrCorrupt
       
   124 	 */ 
       
   125 	 TInt CheckCacheStatusL();
       
   126 
       
   127 	   /**
       
   128 	    * Takes a list of email entries linked like in the following example:
       
   129 	    * "EMAILADDRESS \x001F EMAILADDRESS \x001F EMAILADDRESS" 
       
   130 	    * Reads the consecutive entries and appends it to an array
       
   131 	    *
       
   132 	    * @param aEmail list of email entries linked by <SPACE><UnitSeparator><SPACE>
       
   133 	    * @param aEmailFields array to which entries are appended
       
   134 	    
       
   135 	    */
       
   136 	 void ChopEmailEntriesList(TPtrC &aEmail, RArray<TPtrC> &aEmailFields);
       
   137 
       
   138  protected: // data
       
   139 
       
   140 	// Pointer to Predictive contact search engine client
       
   141 	CPSRequestHandler* iRequestHandler;	// owned
       
   142 
       
   143 	// Pointer to Predictive contact search query object
       
   144 	CPsQuery* iQuery;
       
   145     
       
   146 	// Refenrence to AknFepCenRep
       
   147 	CRepository&	iAknFepCenRep;    
       
   148 
       
   149     // Reference to lists handler
       
   150     CFSEmailUiClsListsHandler& iListHandler;
       
   151   
       
   152     // What input mode is currently in use. EItut or QWERTY
       
   153     TKeyboardModes iInputMode;
       
   154     
       
   155     CVPbkContactManager* iContactManager;
       
   156     
       
   157     };
       
   158 
       
   159 #endif  // FREESTYLEEMAILUICLSMATCHOBSERVERINTERFACE_H
       
   160 
       
   161 
       
   162 
       
   163 // End of File