Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Opening Symbian Video editor from Qt

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: teemup (10 May 2011)
Last edited: hamishwillee (30 May 2013)



Here in this article we will learn how to launch Video Editor in Symbian^3 Device. We will open the Default Video Editor with a specific video file. This solution will work if a Video editor is present in the device. Any Video editor that is registered as a service will work.You can give a image file instead of the video file and it will still open in the Video editor. If you change KVideoType to be image/jpeg it will open the image editor instead.

If you plan to release the application on some other platform, it is suggested to use #ifdef Q_OS_SYMBIAN .. #endif around the Symbian specific parts (but not in the .pro file).

.PRO file

First step is to include necessary libary in the .pro file's symbian{} section.

symbian {
LIBS += -lservicehandler

Header file

In the header file of the class you plan to launch the request from:

#include <AiwServiceHandler.h>

Inside the class add this member variable:

     CAiwServiceHandler* iAiwServiceHandler;

Source file

In the constructor initialize the member variable and tell it that we will be interested in KAiwCmdEdit-services.

// ...
//Your other code here
iAiwServiceHandler = CAiwServiceHandler::NewL();
RCriteriaArray interest;
//We are interested on all "KAiCmdEdit" types
_LIT8(KAllTypes, "*");
CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC(KAiwCmdEdit, KAiwCmdEdit, KAllTypes);
TUid base;
base.iUid = KAiwClassBase;

And remember to reset and delete the variable in the destructor.

if ( iAiwServiceHandler )
delete iAiwServiceHandler;

Then add a method to do the request.

void MyClass::openVideoEditorWithFile(QString file)
CAiwGenericParamList& inputParams = iAiwServiceHandler->InParamListL();
TFileName filename(file.utf16());
TAiwGenericParam param(EGenericParamFile);
TAiwVariant param2Variant;
_LIT( KVideoType, "video/*" );
TAiwGenericParam param2(EGenericParamMIMEType, param2Variant);
iAiwServiceHandler->ExecuteServiceCmdL(KAiwCmdEdit, inputParams, iAiwServiceHandler->OutParamListL());

Fixing the build error

You might get a build error concerning AiwCommon.h To fix it, do one change in it.

IMPORT_C TAiwVariant& TAiwVariant::operator=(const TAiwVariant& aValue);
IMPORT_C TAiwVariant& operator=(const TAiwVariant& aValue);

Download Source Code

The full source code presented in this article is available here

This page was last modified on 30 May 2013, at 06:28.
72 page views in the last 30 days.