imservices/searchfeatureplugin/srcsearchfrontend/srcsearchmanager/searchfeatureimp.cpp
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     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:  Implementation of MsearchFeature
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #include <ximpcontext.h>
       
    20 #include "searchapiobjbase.h"
       
    21 
       
    22 #include "ximpcontextinternal.h"
       
    23 #include "searchfeatureimp.h"
       
    24 
       
    25 #include "searchimp.h"
       
    26 #include "searchobjectfactoryimp.h"
       
    27 
       
    28 
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS =============================
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // CSearchFeatureImp::NewL()
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 EXPORT_C CSearchFeatureImp* CSearchFeatureImp::NewL(MXIMPContext* aContext)
       
    37     {
       
    38     CSearchFeatureImp* self = new( ELeave ) CSearchFeatureImp();
       
    39     CleanupStack::PushL( self );
       
    40     self->ConstructL(aContext);
       
    41     CleanupStack::Pop();
       
    42     return self;
       
    43     }
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // Implement supported interface access.
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 
       
    50 XIMPIMP_IF_BASE_GET_INTERFACE_BEGIN( CSearchFeatureImp, 
       
    51                                      MSearchFeature )
       
    52 XIMPIMP_IF_BASE_GET_INTERFACE_END()
       
    53 
       
    54 
       
    55 XIMPIMP_IF_BASE_GET_CONST_INTERFACE_BEGIN( CSearchFeatureImp, 
       
    56                                            MSearchFeature)
       
    57 XIMPIMP_IF_BASE_GET_INTERFACE_END()
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // CSearchFeatureImp::~CSearchFeatureImp()
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 CSearchFeatureImp::~CSearchFeatureImp()
       
    64     {
       
    65     delete iSearch;
       
    66     delete iSearchObjFactory;
       
    67     iCtxInternal = NULL;
       
    68     }
       
    69 
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 // CSearchFeatureImp::CSearchFeatureImp( CXIMPContextClientProxy& aCtxProxy )
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 CSearchFeatureImp::CSearchFeatureImp()
       
    76     {
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // CSearchFeatureImp::SetCtxL(MXIMPContext* aContext)
       
    81 // ---------------------------------------------------------------------------
       
    82 //
       
    83 void CSearchFeatureImp::SetCtxL(MXIMPContext* aContext)
       
    84     {
       
    85     if(!aContext)
       
    86         User::Leave(KErrArgument);
       
    87     iCtxInternal = TXIMPGetInterface<MXIMPContextInternal>::From(*aContext,EReturnNullIfUnknown);
       
    88                        
       
    89     }
       
    90 
       
    91 // ---------------------------------------------------------------------------
       
    92 // CSearchFeatureImp::ConstructL(MXIMPContext* aContext)
       
    93 // ---------------------------------------------------------------------------
       
    94 //
       
    95 void CSearchFeatureImp::ConstructL(MXIMPContext* aContext)
       
    96     {
       
    97     SetCtxL(aContext);
       
    98     iSearchObjFactory = CSearchObjectFactoryImp::NewL();
       
    99     iSearch = CSearchImp::NewL( *iCtxInternal );
       
   100 
       
   101     }
       
   102 
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // CSearchFeatureImp::SearchObjectFactory()
       
   106 // ---------------------------------------------------------------------------
       
   107  MSearchObjectFactory& CSearchFeatureImp::SearchObjectFactory() const
       
   108     {
       
   109     return *iSearchObjFactory;
       
   110     }
       
   111 
       
   112 
       
   113 
       
   114    // ---------------------------------------------------------------------------
       
   115 // CSearchFeatureImp::Search() 
       
   116 // ---------------------------------------------------------------------------
       
   117 //
       
   118  MSearch& CSearchFeatureImp::Search() const
       
   119     {
       
   120     return *iSearch;
       
   121     }  
       
   122