meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclsmatchobserver.h
changeset 0 8466d47a6819
child 16 4ce476e64c59
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  Base class for Contact and RMU match observers
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRCLSMATCHOBSERVER_H
       
    20 #define CESMRCLSMATCHOBSERVER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <cntdef.h>
       
    25 
       
    26 #include <MPsResultsObserver.h>
       
    27 #include <CPsRequestHandler.h>
       
    28 #include <CPcsDefs.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CRepository;
       
    32 class CPSRequestHandler;
       
    33 class CESMRClsListsHandler;
       
    34 class CVPbkContactManager;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 /**
       
    38  * Base class for Contact and RMU match observers
       
    39  *
       
    40  *
       
    41  */
       
    42 
       
    43 NONSHARABLE_CLASS( CESMRClsMatchObserver ) : public CBase, public MPsResultsObserver
       
    44     {
       
    45 
       
    46 public:
       
    47     static CESMRClsMatchObserver* NewL( CRepository& aCr,
       
    48                 CESMRClsListsHandler& aListsHandler,
       
    49                 CPSRequestHandler& aRequestHandler,
       
    50                 CVPbkContactManager* aContactManager );
       
    51 
       
    52     static CESMRClsMatchObserver* NewLC( CRepository& aCr,
       
    53                 CESMRClsListsHandler& aListsHandler,
       
    54                 CPSRequestHandler& aRequestHandler,
       
    55                 CVPbkContactManager* aContactManager);
       
    56 
       
    57     /**
       
    58      * Destructor.
       
    59      *
       
    60      */
       
    61      virtual ~CESMRClsMatchObserver();
       
    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      virtual void HandlePsError(TInt aErrorCode);
       
    86      virtual void CachingStatus(TCachingStatus& aStatus, TInt& aError);
       
    87  protected:
       
    88 
       
    89     /**
       
    90      * C++ default constructor.
       
    91      *
       
    92      * @param aCR refenrence to aknfep cenrep
       
    93      * @param aListsHandler reference to listshandler object.
       
    94      * @param aContactListingService reference to contact listing service object who provides
       
    95      *                                  matcher object for the MRU list
       
    96      *
       
    97      */
       
    98      CESMRClsMatchObserver( CRepository& aCr,
       
    99                                 CESMRClsListsHandler& aListsHandler,
       
   100                                 CPSRequestHandler& aRequestHandler,
       
   101                                 CVPbkContactManager* aContactManager );
       
   102 
       
   103     /**
       
   104      * Returns wheather current input mode is predictive (EItut) or QWERTY.
       
   105      *
       
   106      * @return TKeyboardModes EItut if predictive. EQwerty if anything else.
       
   107      */
       
   108     virtual TKeyboardModes GetInputMode();
       
   109 
       
   110 
       
   111     void ConstructL();
       
   112 
       
   113  protected: // Functions from base classes
       
   114 
       
   115  private:
       
   116 
       
   117     /**
       
   118      * Chech the status of PCS cache
       
   119      * ETrue, if Cache is OK. Otherwise EFalse
       
   120      */
       
   121      TBool CheckCacheStatusL();
       
   122 
       
   123      HBufC* CreateDisplayNameLC( const TDesC& aFirstname, const TDesC& aLastname, const TDesC& aEmailField );
       
   124 
       
   125      void HandlePsResultsUpdateL(
       
   126              RPointerArray<CPsClientData>& searchResults,
       
   127              RPointerArray<CPsPattern>& searchSeqs );
       
   128 
       
   129  protected: // data
       
   130 
       
   131     // Pointer to Predictive contact search engine client
       
   132     CPSRequestHandler* iRequestHandler; // owned
       
   133 
       
   134     // Pointer to Predictive contact search query object
       
   135     CPsQuery* iQuery;
       
   136 
       
   137     // Refenrence to AknFepCenRep
       
   138     CRepository&    iAknFepCenRep;
       
   139 
       
   140     // Reference to lists handler
       
   141     CESMRClsListsHandler& iListHandler;
       
   142 
       
   143     // What input mode is currently in use. EItut or QWERTY
       
   144     TKeyboardModes iInputMode;
       
   145 
       
   146     CVPbkContactManager* iContactManager;
       
   147 
       
   148     };
       
   149 
       
   150 
       
   151 #endif  // CESMRCLSMATCHOBSERVER_H
       
   152 
       
   153 // End of File