diff -r 000000000000 -r e686773b3f54 predictivesearch/PcsServer/src/CPcsPluginInterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/predictivesearch/PcsServer/src/CPcsPluginInterface.cpp Tue Feb 02 10:12:17 2010 +0200 @@ -0,0 +1,270 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: PCS Server Plugin Interface +* +*/ + + +// INCLUDE FILES +#include "CPcsPluginInterface.h" +#include "CPcsPlugin.h" +#include "CPcsDebug.h" + +// ============================== MEMBER FUNCTIONS ============================ + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::NewL +// Two Phase Construction +// ---------------------------------------------------------------------------- +CPcsPluginInterface* CPcsPluginInterface::NewL() +{ + PRINT ( _L("Enter CPcsPluginInterface::NewL") ); + + CPcsPluginInterface* self = CPcsPluginInterface::NewLC(); + CleanupStack::Pop( self ); + + PRINT ( _L("End CPcsPluginInterface::NewL") ); + + return self; +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::NewLC +// Two Phase Construction +// ---------------------------------------------------------------------------- +CPcsPluginInterface* CPcsPluginInterface::NewLC() +{ + PRINT ( _L("Enter CPcsPluginInterface::NewLC") ); + + CPcsPluginInterface* self = new( ELeave ) CPcsPluginInterface(); + CleanupStack::PushL( self ); + self->ConstructL(); + + PRINT ( _L("End CPcsPluginInterface::NewLC") ); + + return self; +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::CPcsPluginInterface +// Constructor +// ---------------------------------------------------------------------------- +CPcsPluginInterface::CPcsPluginInterface() +{ + PRINT ( _L("Enter CPcsPluginInterface::CPcsPluginInterface") ); + PRINT ( _L("End CPcsPluginInterface::CPcsPluginInterface") ); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::ConstructL +// 2nd phase constructor +// ---------------------------------------------------------------------------- +void CPcsPluginInterface::ConstructL() +{ + PRINT ( _L("Enter CPcsPluginInterface::ConstructL") ); + PRINT ( _L("End CPcsPluginInterface::ConstructL") ); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::~CPcsPluginInterface +// Constructor +// ---------------------------------------------------------------------------- +CPcsPluginInterface::~CPcsPluginInterface( ) +{ + PRINT ( _L("Enter CPcsPluginInterface::~CPcsPluginInterface") ); + + UnloadPlugIns(); + iPcsPluginInstances.ResetAndDestroy(); + + PRINT ( _L("End CPcsPluginInterface::~CPcsPluginInterface") ); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::InstantiateAllPlugInsL +// Instantiates all plugins +// ---------------------------------------------------------------------------- +void CPcsPluginInterface::InstantiateAlgorithmL( TDes& aAlgorithm ) +{ + PRINT ( _L("Enter CPcsPluginInterface::InstantiateAlgorithmL") ); + + RImplInfoPtrArray infoArray; + + // Get list of all implementations + ListAllImplementationsL( infoArray ); + + // Instantiate plugins for all impUIds by calling + // InstantiatePlugInFromImpUidL + for ( TInt i=0; i& aPsData, + RPointerArray& aPattern) +{ + PRINT ( _L("Enter CPcsPluginInterface::PerformSearchL") ); + + for ( TInt idx = 0; idx < iPcsPluginInstances.Count(); idx++ ) + { + iPcsPluginInstances[idx]->PerformSearchL( aSettings, + aCondition, + aPsData, + aPattern ); + } + + PRINT ( _L("End CPcsPluginInterface::PerformSearchL") ); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::SearchInputL +// Search +// ---------------------------------------------------------------------------- +void CPcsPluginInterface::SearchInputL(CPsQuery& aSearchQuery, + TDesC& aSearchData, + RPointerArray& aMatchSet, + RArray& aMatchLocation) +{ + PRINT ( _L("Enter CPcsPluginInterface::SearchInputL") ); + + for ( TInt idx = 0; idx < iPcsPluginInstances.Count(); idx++ ) + { + iPcsPluginInstances[idx]->SearchInputL( aSearchQuery, + aSearchData, + aMatchSet, + aMatchLocation ); + } + + PRINT ( _L("End CPcsPluginInterface::SearchInputL") ); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::SearchMatchStringL +// Search +// ---------------------------------------------------------------------------- +void CPcsPluginInterface::SearchMatchStringL(CPsQuery& aSearchQuery, + TDesC& aSearchData, + TDes& aMatch ) +{ + PRINT ( _L("Enter CPcsPluginInterface::SearchMatchStringL") ); + + for ( TInt idx = 0; idx < iPcsPluginInstances.Count(); idx++ ) + { + iPcsPluginInstances[idx]->SearchMatchStringL( aSearchQuery, + aSearchData, + aMatch ); + } + + PRINT ( _L("End CPcsPluginInterface::SearchMatchStringL") ); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::IsLanguageSupported +// +// ---------------------------------------------------------------------------- +TBool CPcsPluginInterface::IsLanguageSupportedL(const TUint32 aLanguage) +{ + return(iPcsPluginInstances[0]->IsLanguageSupportedL(aLanguage)); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::GetDataOrderL +// +// ---------------------------------------------------------------------------- +void CPcsPluginInterface::GetDataOrderL(TDesC& aURI, RArray& aDataOrder) +{ + return(iPcsPluginInstances[0]->GetDataOrderL(aURI, aDataOrder)); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::GetSortOrderL +// +// ---------------------------------------------------------------------------- +void CPcsPluginInterface::GetSortOrderL(TDesC& aURI, RArray& aSortOrder) +{ + return(iPcsPluginInstances[0]->GetSortOrderL(aURI, aSortOrder)); +} + +// ---------------------------------------------------------------------------- +// CPcsPluginInterface::ChangeSortOrderL +// +// ---------------------------------------------------------------------------- +void CPcsPluginInterface::ChangeSortOrderL(TDesC& aURI, RArray& aSortOrder) +{ + return(iPcsPluginInstances[0]->ChangeSortOrderL(aURI, aSortOrder)); +} +// End of file