diff -r 8b2d6d0384b0 -r d9aefe59d544 camerauis/cameraxui/cxengine/tsrc/unit/system_include/harvesterclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraxui/cxengine/tsrc/unit/system_include/harvesterclient.cpp Fri Apr 16 14:51:30 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +#include "cxutils.h" +#include "harvesterclient.h" + + + + +/*! +* RHarvesterClient::RHarvesterClient +*/ +RHarvesterClient::RHarvesterClient() +{ + +} + + +/*! +* open connection. +*/ +int RHarvesterClient::Connect() +{ + return KErrNone; +} + + + +/*! +* close connection. +*/ +void RHarvesterClient::Close() +{ + // nothing to do +} + + + +/*! +* register observer for receiving harvestcomplete callbacks. +*/ +void RHarvesterClient::SetObserver(MHarvestObserver* aObserver) +{ + CX_DEBUG_ENTER_FUNCTION(); + mObserver = aObserver; + CX_DEBUG_EXIT_FUNCTION(); +} + + + +/*! +* remove observer for any harvest complete callbacks. +*/ +void RHarvesterClient::RemoveObserver(MHarvestObserver* aObserver) +{ + CX_DEBUG_ENTER_FUNCTION(); + + if(aObserver == mObserver) { + mObserver = NULL; + } + + CX_DEBUG_EXIT_FUNCTION(); +} + + +/*! +* harvest file +*/ +void RHarvesterClient::HarvestFile(const TDesC& aURI, RArray &aAlbumIds, TBool aAddLocation) +{ + Q_UNUSED(aAlbumIds); + Q_UNUSED(aAddLocation); + + int error = KErrNone; + + if (aURI == KNullDesC) { + error = KErrNotFound; + } + + if (mObserver) { + TFileName filename = aURI; + // file harvested, inform clients + mObserver->HarvestingComplete(filename, error); + } + +}