diff -r d0b4e67b3a60 -r f291796e213d ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlercropimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlercropimage.cpp Tue Jul 06 14:16:16 2010 +0300 @@ -0,0 +1,77 @@ +/* +* 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 "glxcommandhandlercropimage.h" + +#include +#include +#include +#include +#include +#include +#include + + +GlxCommandHandlerCropImage::GlxCommandHandlerCropImage() : mReq(NULL) + { + //Nothing to do here for now + } + +GlxCommandHandlerCropImage::~GlxCommandHandlerCropImage() + { + delete mReq; + mReq = NULL; + } + +void GlxCommandHandlerCropImage::doHandleUserAction(GlxMediaModel* model, + QList /*indexList*/) const + { + const QString interface = QLatin1String("com.nokia.symbian.imageeditor"); + const QString operation = QLatin1String("view(QString,int)"); + const QString service = QLatin1String("PhotoEditor"); + + if(mReq == NULL) + { + //Connect to service provider + mReq = mAppmgr.create(service, interface, operation, true); + mReq->setEmbedded(true); + mReq->setSynchronous(true); + } + + if(mReq == NULL) + { + qDebug("QtSamplePhotos::launchPhotoEditor request not Created"); + return; + } + + //Get the file path for the item selected + QString imagePath = (model->data(model->index(model->data(model->index(0,0),GlxFocusIndexRole).value(),0),GlxUriRole)).value(); + + QList args; + args << imagePath; + args << EEditorHighwayFreeCrop; + mReq->setArguments(args); + + // Send the request + bool res = mReq->send(); + if (!res) + { + // Request failed. + qDebug("QtSamplePhotos::launchPhotoEditor request cannot be send"); + } + + }