emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsearchengine.h
branchRCL_3
changeset 12 4ce476e64c59
parent 11 0396474f30f5
child 13 8592a65ad3fb
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
     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:  Definition of the class CPbkxRclSearchEngine.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBKXRCLSEARCHENGINE_H
       
    20 #define CPBKXRCLSEARCHENGINE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <cntitem.h>
       
    24 #include <eikcmobs.h>
       
    25 #include "tpbkxremotecontactlookupprotocolaccountid.h"
       
    26 #include "mpbkxremotecontactlookupserviceui.h"
       
    27 
       
    28 class CPbkxRemoteContactLookupProtocolAdapter;
       
    29 class CPbkxRclProtocolEnvImpl;
       
    30 
       
    31 /**
       
    32 * Class that creates accounts and context that executes the actual
       
    33 * search.
       
    34 *
       
    35 *  @lib pbkxrclengine.lib
       
    36 *  @since S60 3.1
       
    37 */
       
    38 class CPbkxRclSearchEngine : 
       
    39     public CBase,
       
    40     public MPbkxRemoteContactLookupServiceUi
       
    41     {
       
    42 
       
    43 public: // constructors and destructors
       
    44 
       
    45     /**
       
    46     * Two-phased constructor.
       
    47     *
       
    48     * @return Created object.
       
    49     */
       
    50     IMPORT_C static CPbkxRclSearchEngine* NewL();
       
    51     
       
    52     /**
       
    53     * Two-phased constructor.
       
    54     *
       
    55     * Leaves pointer of the created object on the cleanupstack.
       
    56     *
       
    57     * @return Created object.
       
    58     */
       
    59     IMPORT_C static CPbkxRclSearchEngine* NewLC();
       
    60 
       
    61     /**
       
    62     * Destructor.
       
    63     */
       
    64     virtual ~CPbkxRclSearchEngine();
       
    65     
       
    66 public: // from MPbkxRemoteContactLookupServiceUi  
       
    67 
       
    68     /**
       
    69     * Returns default account identifier.
       
    70     *
       
    71     * @return default account identifier
       
    72     */
       
    73     virtual TPbkxRemoteContactLookupProtocolAccountId DefaultAccountIdL() const;
       
    74 
       
    75     /**
       
    76     * Creates new account with given protocol account identifier.
       
    77     *
       
    78     * @param aProtocolAccountId protocol account ID.
       
    79     * @return protocol account
       
    80     */
       
    81     virtual CPbkxRemoteContactLookupProtocolAccount* NewAccountL(
       
    82         const TPbkxRemoteContactLookupProtocolAccountId& aProtocolAccountId ) const;
       
    83 
       
    84     /**
       
    85     * Create new execution context.
       
    86     *
       
    87     * @param aParams Construction parameters. 
       
    88     * @return execution context
       
    89     */     
       
    90     virtual CPbkxRemoteContactLookupServiceUiContext* NewContextL( 
       
    91         TContextParams& aParams ) const;
       
    92     
       
    93 private: // methods used internally
       
    94 
       
    95     /**
       
    96     * Tries to create adapter with a given account id.
       
    97     *
       
    98     * @param aId Account id.
       
    99     * @return Created object.
       
   100     */
       
   101     CPbkxRemoteContactLookupProtocolAdapter* CreateAdapterLC(
       
   102         const TPbkxRemoteContactLookupProtocolAccountId& aId ) const;
       
   103 
       
   104 private: // constructors
       
   105 
       
   106     /**
       
   107     * Constructor.
       
   108     */
       
   109     CPbkxRclSearchEngine();
       
   110 
       
   111     /**
       
   112     * Second-phase constructor.
       
   113     */
       
   114     void ConstructL();
       
   115 
       
   116 private: // data
       
   117     
       
   118     // Environment given to adapters. Owned.
       
   119     CPbkxRclProtocolEnvImpl* iEnvironment;
       
   120 
       
   121     };
       
   122 
       
   123 #endif // CPBKXRCLSEARCHENGINE_H