# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286145161 -10800 # Node ID 6bfad47013df2d6f5c02d890b85d777cbaaea88b # Parent 3d09643def13eba1c294ee4b0303ef24b4024052 Revision: 201037 Kit: 201039 diff -r 3d09643def13 -r 6bfad47013df .gitignore --- a/.gitignore Fri Sep 17 08:34:25 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -.obj -*.moc -Makefile* -*.so.* -*.so -*.so.debug -*.o -*~ -.cd.rc -*.swp -core -moc_*.cpp -*.Debug -*.Release -*.pdb -*.idb -*.ib_pdb_index -*.bak -*.make.examples -*.cache - -#Carbide project files -*.project -plugin_commonU.def - -#Visual Studio files -*.sln -*.vcproj - -#QtCreator project files -*.pro.user diff -r 3d09643def13 -r 6bfad47013df package_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_definition.xml Mon Oct 04 01:32:41 2010 +0300 @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 3d09643def13 -r 6bfad47013df package_map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_map.xml Mon Oct 04 01:32:41 2010 +0300 @@ -0,0 +1,1 @@ + diff -r 3d09643def13 -r 6bfad47013df qthighway/examples/notifications/notifications.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qthighway/examples/notifications/notifications.pro Mon Oct 04 01:32:41 2010 +0300 @@ -0,0 +1,32 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, version 2.1 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, +# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". +# +# Description: +# + +XQSERVICE_ROOT=../../.. +include(../../xqservicebase.pri) + +TEMPLATE=subdirs + +CONFIG += ordered + +SUBDIRS= \ + client \ + service \ + notificationreceiver + diff -r 3d09643def13 -r 6bfad47013df qthighway/examples/notifications/sis/qthighway_notifications_ex.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qthighway/examples/notifications/sis/qthighway_notifications_ex.pkg Mon Oct 04 01:32:41 2010 +0300 @@ -0,0 +1,47 @@ +; +; Copyright (c) 2010 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: System Tone Service - UDEB build +; +;File: systemtoneservice.pkg + +;Languages +&EN + +;Header +; SIS header: name, uid, version +#{"SystemToneServiceEx"},(0xE9e86548),1,0,0, TYPE=SA, RU + +;Series 60 v5.0 +[0x1028315F], 0,0,0, {"Series60ProductID"} + +;Localised Vendor name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +;Files To Copy... +; Executable and default resource files +"/epoc32/release/armv5/urel/hbserviceprovider.exe" - "!:\sys\bin\hbserviceprovider.exe" +"/epoc32/data/z/private/10003a3f/import/apps/hbserviceprovider_reg.rsc" - "!:/private/10003a3f/import/apps/hbserviceprovider_reg.rsc" +"/epoc32/data/z/resource/apps/hbserviceprovider.rsc" - "!:/resource/apps/hbserviceprovider.rsc" + +"/epoc32/release/armv5/urel/notreceiver.exe" - "!:\sys\bin\notreceiver.exe" +"/epoc32/data/z/resource/apps/notreceiver.rsc" - "!:\resource\apps\notreceiver.rsc" +"/epoc32/data/z/private/10003a3f/import/apps/notreceiver_reg.rsc" - "!:\private\10003a3f\import\apps\notreceiver_reg.rsc" + +"/epoc32/release/armv5/urel/serviceclient.exe" - "!:\sys\bin\serviceclient.exe" +"/epoc32/data/z/resource/apps/serviceclient.rsc" - "!:\resource\apps\serviceclient.rsc" +"/epoc32/data/z/private/10003a3f/import/apps/serviceclient_reg.rsc" - "!:\private\10003a3f\import\apps\serviceclient_reg.rsc" + diff -r 3d09643def13 -r 6bfad47013df qthighway/tsrc/at_xqapplicationmanager/drmfiles/SD_jpg_sun.dcf diff -r 3d09643def13 -r 6bfad47013df qthighway/xqservice/src/xqaiwuridriver.cpp --- a/qthighway/xqservice/src/xqaiwuridriver.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qthighway/xqservice/src/xqaiwuridriver.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -68,6 +68,7 @@ bool XQAiwUriDriver::send(QVariant& retValue) { + Q_UNUSED(retValue); XQSERVICE_DEBUG_PRINT("XQAiwUriDriver::send %s", qPrintable(mUri.toString())); mErrorCode = XQService::ENoError; @@ -196,7 +197,7 @@ // // Use Qt service framework errors as is (they are in different range than XQ errors) // - QLatin1String xml("Z:/resource/activity/activityserviceplugin.xml"); + QLatin1String xml("Z:/resource/activity/afservice.xml"); mErrorCode = QServiceManager::NoError; QtMobility::QServiceManager serviceManager; @@ -204,7 +205,7 @@ bool b = serviceManager.addService(xml); mErrorCode = serviceManager.error(); - XQSERVICE_DEBUG_PRINT("\taddService=%d", mErrorCode); + XQSERVICE_DEBUG_PRINT("\taddService:xml=%s,status=%d", qPrintable(QString(xml)),mErrorCode); switch (mErrorCode) { case QServiceManager::NoError: diff -r 3d09643def13 -r 6bfad47013df qthighway/xqservice/src/xqaiwutils.cpp --- a/qthighway/xqservice/src/xqaiwutils.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qthighway/xqservice/src/xqaiwutils.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -395,11 +395,11 @@ CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); cmdLine->SetExecutableNameL( aInfo.iFullName ); RProcess newApp; + CleanupClosePushL(newApp); User::LeaveIfError(newApp.Create(aInfo.iFullName, cmdArgs)); cmdLine->SetProcessEnvironmentL(newApp); newApp.Resume(); - newApp.Close(); // Close the handle (not the app) - CleanupStack::PopAndDestroy(2); // cmdLine, wsSession + CleanupStack::PopAndDestroy(3); // newApp, cmdLine, wsSession } XQSERVICE_DEBUG_PRINT("application started"); diff -r 3d09643def13 -r 6bfad47013df qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbianserver.cpp --- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbianserver.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbianserver.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -129,6 +129,7 @@ delete stateNotifyKey; RProcess currentProcess; + CleanupClosePushL(currentProcess); const TSecureId secureId = currentProcess.SecureId(); stateNotifyKey = new XQPublishAndSubscribeSettingsKey(secureId.iId, id); @@ -139,6 +140,7 @@ } else { settingsManager.writeItemValue(*stateNotifyKey, static_cast(XQApplicationManager::ServiceStarted)); } + CleanupStack::PopAndDestroy(¤tProcess); } // Complete the server rendezvous that th client started XQSERVICE_DEBUG_PRINT("CApaSymbianServer::Rendezvouz"); diff -r 3d09643def13 -r 6bfad47013df qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbiansession.cpp --- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbiansession.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbiansession.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -238,12 +238,14 @@ client->setVendorId(aMessage.VendorId().iId); RThread clientThread; aMessage.ClientL(clientThread); + CleanupClosePushL(clientThread); RProcess clientProc; + CleanupClosePushL(clientProc); User::LeaveIfError( clientThread.Process(clientProc) ); client->setName(QString::fromUtf16(clientProc.Name().Ptr(), clientProc.Name().Length())); client->setCapabilities(ClientCapabilities(aMessage)); - clientThread.Close(); // close handle + CleanupStack::PopAndDestroy(2, &clientThread); // Set the picked sharable file if any if (file != 0) diff -r 3d09643def13 -r 6bfad47013df qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_symbiansession.cpp --- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_symbiansession.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_symbiansession.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -224,12 +224,14 @@ client->setVendorId(aMessage.VendorId().iId); RThread clientThread; aMessage.ClientL(clientThread); + CleanupClosePushL(clientThread); RProcess clientProc; + CleanupClosePushL(clientProc); clientThread.Process(clientProc); client->setName(QString::fromUtf16(clientProc.Name().Ptr(), clientProc.Name().Length())); client->setCapabilities(ClientCapabilities(aMessage)); - clientThread.Close(); + CleanupStack::PopAndDestroy(2, &clientThread); // Set the picked sharable file if any if (file != 0) diff -r 3d09643def13 -r 6bfad47013df qthighway/xqserviceutil/src/processinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qthighway/xqserviceutil/src/processinfo.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation, version 2.1 of the License. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License +* along with this program. If not, +* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". +* +* Description: +* +*/ + +#include "processinfo.h" + +#include "xqservicelog.h" + +#include + +#define TIMER_DELAY 3000000 // 3000000 microseconds == 3s + +// static data initialization + +ProcessInfoDestroyer *ProcessInfoDestroyer::instance = 0; +CProcessInfo::ProcessInfoMap CProcessInfo::iProcessInfoMap; + +// ProcessInfoMap implementation + +CProcessInfo::ProcessInfoMap::~ProcessInfoMap() +{ + CProcessInfo::Destroy(); + ProcessInfoDestroyer::disable(); +} + +// CProcessInfo implementation + +CProcessInfo::CProcessInfo(const TUid& appUid): + CActive(CActive::EPriorityStandard), + iAppUid(appUid) +{ + XQSERVICE_DEBUG_PRINT("CProcessInfo::CProcessInfo"); + + CActiveScheduler::Add(this); +} + +CProcessInfo::~CProcessInfo() +{ + XQSERVICE_DEBUG_PRINT("CProcessInfo::~CProcessInfo"); + + // Cancel asynch request, normally it should be done in DoCancel() + // but we dont wont to cancel request when we cancel active object + User::CancelMiscNotifier(iStatus); + + Cancel(); +} + +void CProcessInfo::Destroy() +{ + foreach (CProcessInfo* info, iProcessInfoMap.map.values()) + delete info; + iProcessInfoMap.map.clear(); +} + +void CProcessInfo::AddProcessL(const TUid& appUid, RProcess& appProcess) +{ + XQSERVICE_DEBUG_PRINT("CProcessInfo::AddProcessL"); + + CProcessInfo* self = new(ELeave) CProcessInfo(appUid); + CleanupStack::PushL(self); + self->ConstructL(appProcess); + CleanupStack::Pop(self); +} + +bool CProcessInfo::EnsureProcessCanStartL(const TUid& appUid) +{ + XQSERVICE_DEBUG_PRINT("CProcessInfo::EnsureProcessCanStartL"); + + bool ret = true; + + CProcessInfo* previousProcess = iProcessInfoMap.map[appUid.iUid]; + if (previousProcess) { + // Timer is for ensure that wait will end. + // There is possibility that destroying process notification could be lost. + RTimer securityTimer; + securityTimer.CreateLocal(); + CleanupClosePushL(securityTimer); + + TRequestStatus timerStatus; + securityTimer.After(timerStatus, TIMER_DELAY); + User::WaitForRequest(previousProcess->iStatus, timerStatus); + + if (previousProcess->iStatus == KRequestPending) + ret = false; + + CleanupStack::PopAndDestroy(); + delete previousProcess; + iProcessInfoMap.map.remove(appUid.iUid); + } + return ret; +} + +void CProcessInfo::RunL() +{ + XQSERVICE_DEBUG_PRINT("CProcessInfo::RunL"); + + iProcessInfoMap.map.remove(iAppUid.iUid); + delete this; +} + +void CProcessInfo::ConstructL(RProcess& appProcess) +{ + XQSERVICE_DEBUG_PRINT("CProcessInfo::ConstructL"); + + SetActive(); + + EnsureProcessCanStartL(iAppUid); + iProcessInfoMap.map.insert(iAppUid.iUid, this); + appProcess.NotifyDestruction(iStatus); + + ProcessInfoDestroyer::enable(); +} + +void CProcessInfo::DoCancel() +{ + XQSERVICE_DEBUG_PRINT("CProcessInfo::DoCancel"); + + // Cancel asynch request, normally it should be done in DoCancel() + // but we dont wont to cancel request when we cancel active object. + // Cancel asynch request is in ~CProcessInfo(). +} + +// ProcessInfoDestroyer implementation + +void ProcessInfoDestroyer::enable() +{ + if (!instance) + instance = new ProcessInfoDestroyer; +} + +void ProcessInfoDestroyer::disable() +{ + if (instance) { + delete instance; + instance = 0; + } +} + +ProcessInfoDestroyer::ProcessInfoDestroyer() +{ + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(destroy())); +} + +void ProcessInfoDestroyer::destroy() +{ + CProcessInfo::Destroy(); +} + diff -r 3d09643def13 -r 6bfad47013df qthighway/xqserviceutil/src/processinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qthighway/xqserviceutil/src/processinfo.h Mon Oct 04 01:32:41 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation, version 2.1 of the License. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License +* along with this program. If not, +* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". +* +* Description: +* +*/ + +#ifndef PROCESSINFO_H_ +#define PROCESSINFO_H_ + +#include +#include + +class CProcessInfo : public CActive +{ +public: + static void AddProcessL(const TUid& appUid, RProcess& appProcess); + static bool EnsureProcessCanStartL(const TUid& appUid); + static void Destroy(); + +protected: + CProcessInfo(const TUid& appUid); + ~CProcessInfo(); + void ConstructL(RProcess& appProcess); + void DoCancel(); + void RunL(); + +protected: + class ProcessInfoMap + { + public: + ~ProcessInfoMap(); + QHash map; + }; + + static ProcessInfoMap iProcessInfoMap; + const TUid iAppUid; +}; + +class ProcessInfoDestroyer : public QObject +{ + Q_OBJECT +public: + static void enable(); + static void disable(); + +public slots: + void destroy(); + +private: + ProcessInfoDestroyer(); + + static ProcessInfoDestroyer *instance; +}; + +#endif /* PROCESSINFO_H_ */ diff -r 3d09643def13 -r 6bfad47013df qthighway/xqserviceutil/src/xqservicemanager.cpp --- a/qthighway/xqserviceutil/src/xqservicemanager.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qthighway/xqserviceutil/src/xqservicemanager.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -44,128 +44,8 @@ #include "xqservicemetadata/xqservicemetadata_p.h" #include #include "xqconversions.h" - - -#define TIMER_DELAY 3000000 // 3000000 microseconds == 3s - -class CProcessInfo : public CActive - { - public: - static void AddProcessL(const TUid& appUid, RProcess& appProcess); - static bool EnsureProcessCanStartL(const TUid& appUid); - - protected: - CProcessInfo(const TUid& appUid); - ~CProcessInfo(); - void ConstructL(RProcess& appProcess); - void DoCancel(); - void RunL(); - - protected: - class ProcessInfoMap - { - public: - ~ProcessInfoMap() - { - foreach (CProcessInfo* info, map.values()) - delete info; - } - QHash map; - }; - - static ProcessInfoMap iProcessInfoMap; - const TUid iAppUid; - }; - - - -CProcessInfo::ProcessInfoMap CProcessInfo::iProcessInfoMap; - -CProcessInfo::CProcessInfo(const TUid& appUid): - CActive(CActive::EPriorityStandard), - iAppUid(appUid) -{ - XQSERVICE_DEBUG_PRINT("CProcessInfo::CProcessInfo"); - - CActiveScheduler::Add(this); -} - -CProcessInfo::~CProcessInfo() -{ - XQSERVICE_DEBUG_PRINT("CProcessInfo::~CProcessInfo"); - - // Cancel asynch request, normally it should be done in DoCancel() - // but we dont wont to cancel request when we cancel active object - User::CancelMiscNotifier(iStatus); - - Cancel(); -} +#include "processinfo.h" -void CProcessInfo::AddProcessL(const TUid& appUid, RProcess& appProcess) -{ - XQSERVICE_DEBUG_PRINT("CProcessInfo::AddProcessL"); - - CProcessInfo* self = new(ELeave) CProcessInfo(appUid); - CleanupStack::PushL(self); - self->ConstructL(appProcess); - CleanupStack::Pop(self); -} - -bool CProcessInfo::EnsureProcessCanStartL(const TUid& appUid) -{ - XQSERVICE_DEBUG_PRINT("CProcessInfo::EnsureProcessCanStartL"); - - bool ret = true; - - CProcessInfo* previousProcess = iProcessInfoMap.map[appUid.iUid]; - if (previousProcess) { - // Timer is for ensure that wait will end. - // Maybe there is possibility that destroing process notification could be lost. - RTimer securityTimer; - securityTimer.CreateLocal(); - CleanupClosePushL(securityTimer); - - TRequestStatus timerStatus; - securityTimer.After(timerStatus, TIMER_DELAY); - User::WaitForRequest(previousProcess->iStatus, timerStatus); - - if (previousProcess->iStatus == KRequestPending) - ret = false; - - CleanupStack::PopAndDestroy(); - delete previousProcess; - iProcessInfoMap.map.remove(appUid.iUid); - } - return ret; -} - -void CProcessInfo::RunL() -{ - XQSERVICE_DEBUG_PRINT("CProcessInfo::RunL"); - - iProcessInfoMap.map.remove(iAppUid.iUid); - delete this; -} - -void CProcessInfo::ConstructL(RProcess& appProcess) -{ - XQSERVICE_DEBUG_PRINT("CProcessInfo::ConstructL"); - - SetActive(); - - EnsureProcessCanStartL(iAppUid); - iProcessInfoMap.map.insert(iAppUid.iUid, this); - appProcess.NotifyDestruction(iStatus); -} - -void CProcessInfo::DoCancel() -{ - XQSERVICE_DEBUG_PRINT("CProcessInfo::DoCancel"); - - // Cancel asynch request, normally it should be done in DoCancel() - // but we dont wont to cancel request when we cancel active object. - // Cancel asynch request is in ~CProcessInfo(). -} /*! \class XQServiceManagerPrivate @@ -475,6 +355,8 @@ // just use the Secure ID as server differentiator //cmdLine->SetServerRequiredL( uid.iUid ); RProcess client; + CleanupClosePushL(client); + cmdLine->SetServerRequiredL(client.Id().Id()); if (embed) { CCoeEnv* env= CCoeEnv::Static(); @@ -500,6 +382,8 @@ if(!CProcessInfo::EnsureProcessCanStartL(uid)) User::Leave(KErrAlreadyExists); } + CleanupStack::PopAndDestroy(&client); + TRequestStatus requestStatusForRendezvous; // start application with command line parameters diff -r 3d09643def13 -r 6bfad47013df qthighway/xqserviceutil/src/xqserviceutil.cpp --- a/qthighway/xqserviceutil/src/xqserviceutil.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qthighway/xqserviceutil/src/xqserviceutil.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -32,6 +32,11 @@ #include #include +namespace +{ + const TInt KWinPosForeground = 0; + const TInt KWinPosBackground = -1; +} // ======== LOCAL FUNCTIONS ======== static bool isKeySet(const QString &key) @@ -115,24 +120,10 @@ { XQSERVICE_DEBUG_PRINT("XQServiceUtil::toBackground"); XQSERVICE_DEBUG_PRINT("value: %d", value); - RWsSession ws; - int sid = RProcess().SecureId().iId; // Assumes UID3 == SID !!! - XQSERVICE_DEBUG_PRINT("sid: %d", sid); - if (ws.Connect() == KErrNone) { - XQSERVICE_DEBUG_PRINT("Connected to window server"); - TApaTaskList tasklist(ws); - TApaTask task = tasklist.FindApp(TUid::Uid(sid)); - XQSERVICE_DEBUG_PRINT("task.Exists(): %x", task.Exists()); - if (task.Exists()) { - if (value) { - task.SendToBackground(); - } - else { - task.BringToForeground(); - } - } - - ws.Close(); + + if (CEikonEnv::Static()) { + CEikonEnv::Static()->RootWin().SetOrdinalPosition(value ? KWinPosBackground : KWinPosForeground); + CEikonEnv::Static()->RootWin().EnableReceiptOfFocus(!value); } } diff -r 3d09643def13 -r 6bfad47013df qthighway/xqserviceutil/src/xqserviceutil.pri --- a/qthighway/xqserviceutil/src/xqserviceutil.pri Fri Sep 17 08:34:25 2010 +0300 +++ b/qthighway/xqserviceutil/src/xqserviceutil.pri Mon Oct 04 01:32:41 2010 +0300 @@ -19,15 +19,17 @@ # HEADERS += \ - src/xqserviceutil.h \ - src/xqservicemanager.h \ + src/xqserviceutil.h \ + src/xqservicemanager.h \ src/xqsharablefile.h \ src/xqrequestinfo.h \ - src/xqrequestutil.h + src/xqrequestutil.h \ + src/processinfo.h SOURCES += \ - src/xqserviceutil.cpp \ - src/xqservicemanager.cpp \ + src/xqserviceutil.cpp \ + src/xqservicemanager.cpp \ src/xqsharablefile.cpp \ src/xqrequestinfo.cpp \ - src/xqrequestutil.cpp + src/xqrequestutil.cpp \ + src/processinfo.cpp diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/examples/keycaptureex/keycaptureex.pro --- a/qtmobileextensions/examples/keycaptureex/keycaptureex.pro Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/examples/keycaptureex/keycaptureex.pro Mon Oct 04 01:32:41 2010 +0300 @@ -26,6 +26,7 @@ SOURCES = \ main.cpp \ mapping.cpp \ + mybutton.cpp \ keycapturetestapp.cpp \ capturerequest.cpp @@ -52,7 +53,7 @@ } # enable for debug traces -#DEFINES += ENABLETRACE +DEFINES += ENABLETRACE #DEFINES += TRACE_FILE symbian: { diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/examples/keycaptureex/keycapturetestapp.cpp --- a/qtmobileextensions/examples/keycaptureex/keycapturetestapp.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/examples/keycaptureex/keycapturetestapp.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -48,6 +48,7 @@ #include "mapping.h" #include "capturerequest.h" +#include "mybutton.h" KeyCaptureTestApp::KeyCaptureTestApp( QWidget *parent) : QMainWindow(parent) { @@ -104,12 +105,17 @@ toggleRemoteCallHandlingEx = remoteMenu->addAction(QString("Call Handl. Ex Remote")); toggleRemoteCallHandlingEx->setCheckable(true); - + + toggleRemoteSideKeys = remoteMenu->addAction(QString("Side Keys Events")); + toggleRemoteSideKeys->setCheckable(true); + toggleRemoteSideKeys->setEnabled(false); // not implemented yet + toggleRemoteExtEvents = remoteMenu->addAction(QString("Extended Remote Events")); toggleRemoteExtEvents->setCheckable(true); connect(toggleRemoteBasic, SIGNAL(toggled(bool)), this, SLOT(enableRemBasic(bool))); connect(toggleRemoteCallHandlingEx, SIGNAL(toggled(bool)), this, SLOT(enableRemCallHandlingEx(bool))); + connect(toggleRemoteSideKeys, SIGNAL(toggled(bool)), this, SLOT(enableRemoteSideKeys(bool))); connect(toggleRemoteExtEvents, SIGNAL(toggled(bool)), this, SLOT(enableRemoteExtEvents(bool))); connect(remoteAllOn, SIGNAL(triggered(bool)), this, SLOT(remoteAll(bool))); @@ -129,6 +135,8 @@ font.setPixelSize(10); mTextArea->setFont(font); + layout->addWidget(new MyButton(mTextArea)); + layout->addWidget(mTextArea); window->setLayout(layout); @@ -206,83 +214,93 @@ void KeyCaptureTestApp::addTextLine(QString aText) { + TX_ENTRY TX_LOG_ARGS( QString("aText=%1").arg(aText)); if ( !aText.endsWith("\n")) aText = aText + "\n"; QString msg = mTextArea->toPlainText(); msg = aText + msg; mTextArea->setPlainText(msg); + TX_EXIT } bool KeyCaptureTestApp::event(QEvent *ev) { - processEvent(ev); - return QMainWindow::event(ev); + TX_ENTRY +// processEvent(QString("[E]"), ev); + bool ret = QMainWindow::event(ev); + TX_EXIT_ARGS("ret=" << ret); + return ret; } bool KeyCaptureTestApp::eventFilter(QObject *o, QEvent *ev) { - processEvent(ev); - return QMainWindow::eventFilter(o, ev); + TX_ENTRY +// processEvent(QString("[F]"), ev); + bool ret=QMainWindow::eventFilter(o, ev); + TX_EXIT_ARGS("ret=" << ret); + return ret; } -void KeyCaptureTestApp::processEvent(QEvent *ev) +void KeyCaptureTestApp::processEvent(const QString &prefix, QEvent *ev) { + TX_ENTRY_ARGS(reinterpret_cast(ev)); if (ev){ if (ev->type() == QEvent::KeyPress){ QKeyEvent *keyEvent = static_cast(ev); QString keyName = mappingPtr->name(static_cast(keyEvent->key())); - addTextLine(QString("KeyPress:%1\n").arg(keyName)); + addTextLine(prefix + QString("KeyPress:%1\n").arg(keyName)); } else if (ev->type() == QEvent::KeyRelease){ QKeyEvent *keyEvent = static_cast(ev); QString keyName = mappingPtr->name(static_cast(keyEvent->key())); - addTextLine(QString("KeyRelease:%1\n").arg(keyName)); + addTextLine(prefix + QString("KeyRelease:%1\n").arg(keyName)); } else if (ev->type() == XQKeyCapture::remoteEventType_KeyPress()){ QKeyEvent *keyEvent = static_cast(ev); - + QString keyName = mappingPtr->name(static_cast(keyEvent->key())); + + addTextLine(prefix + QString("KeyPress:%1 (native:%2)\n").arg(keyName).arg(static_cast(keyEvent->nativeVirtualKey()))); + } else if (ev->type() == XQKeyCapture::remoteEventType_KeyRelease()){ + QKeyEvent *keyEvent = static_cast(ev); QString keyName = mappingPtr->name(static_cast(keyEvent->key())); - addTextLine(QString("KeyPress:%1\n").arg(keyName)); - addTextLine(QString("Native virtual key:%1\n").arg((int)keyEvent->nativeVirtualKey())); - } else if (ev->type() == XQKeyCapture::remoteEventType_KeyRelease()){ - QKeyEvent *keyEvent = static_cast(ev); - - QString keyName = mappingPtr->name(static_cast(keyEvent->key())); - - addTextLine(QString("KeyRelease:%1\n").arg(keyName)); - addTextLine(QString("Native virtual key:%1\n").arg((int)keyEvent->nativeVirtualKey())); + addTextLine(prefix + QString("KeyRelease:%1 (native:%2)\n").arg(keyName).arg(static_cast(keyEvent->nativeVirtualKey()))); } } + TX_EXIT_ARGS(reinterpret_cast(ev)); } void KeyCaptureTestApp::enableRemBasic(bool enable) { if (enable) { addTextLine("Remote Basic enabled"); - QFlags flags = XQKeyCapture::CaptureNone; - if (toggleRemoteExtEvents->isChecked()) - flags = XQKeyCapture::CaptureEnableRemoteExtEvents; - if (toggleRemoteCallHandlingEx->isChecked()) - flags |= XQKeyCapture::CaptureCallHandlingExt; - mKeyCapture->captureRemoteKeys(flags |= XQKeyCapture::CaptureBasic); + QFlags flags = getFlags() | XQKeyCapture::CaptureBasic; + mKeyCapture->captureRemoteKeys(flags); } else { addTextLine("Remote Basic disabled"); mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureBasic); } } +void KeyCaptureTestApp::enableRemoteSideKeys(bool enable) +{ + if (enable) { + addTextLine("Side Keys enabled"); + QFlags flags = getFlags() | XQKeyCapture::CaptureSideKeys; + mKeyCapture->captureRemoteKeys(flags); + } else { + addTextLine("Side Keys disabled"); + mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureSideKeys); + } +} + void KeyCaptureTestApp::enableRemCallHandlingEx(bool enable) { if (enable) { addTextLine("Remote Call Handling Ext. enabled"); - QFlags flags = XQKeyCapture::CaptureNone; - if (toggleRemoteExtEvents->isChecked()) - flags = XQKeyCapture::CaptureEnableRemoteExtEvents; - if (toggleRemoteBasic->isChecked()) - flags |= XQKeyCapture::CaptureBasic; - mKeyCapture->captureRemoteKeys(flags | XQKeyCapture::CaptureCallHandlingExt); + QFlags flags = getFlags() | XQKeyCapture::CaptureCallHandlingExt; + mKeyCapture->captureRemoteKeys(flags); } else { addTextLine("Remote Call Handling Ext. disabled"); mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureCallHandlingExt); @@ -293,12 +311,8 @@ { if (enable) { addTextLine("Remote Events Ext. enabled"); - QFlags flags = XQKeyCapture::CaptureNone; - if (toggleRemoteCallHandlingEx->isChecked()) - flags = XQKeyCapture::CaptureCallHandlingExt; - if (toggleRemoteBasic->isChecked()) - flags |= XQKeyCapture::CaptureBasic; - mKeyCapture->captureRemoteKeys(flags | XQKeyCapture::CaptureEnableRemoteExtEvents); + QFlags flags = getFlags() | XQKeyCapture::CaptureEnableRemoteExtEvents; + mKeyCapture->captureRemoteKeys(flags); } else { addTextLine("Remote Events Ext. disabled"); mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureEnableRemoteExtEvents); @@ -313,7 +327,7 @@ toggleRemoteExtEvents->setChecked(true); addTextLine("Remote: enable all"); mKeyCapture->captureRemoteKeys(XQKeyCapture::CaptureCallHandlingExt | XQKeyCapture::CaptureBasic | - XQKeyCapture::CaptureEnableRemoteExtEvents); + XQKeyCapture::CaptureSideKeys | XQKeyCapture::CaptureEnableRemoteExtEvents); } void KeyCaptureTestApp::remoteNone(bool enable) @@ -324,5 +338,23 @@ toggleRemoteExtEvents->setChecked(false); addTextLine("Remote: disable all"); mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureCallHandlingExt | XQKeyCapture::CaptureBasic | - XQKeyCapture::CaptureEnableRemoteExtEvents); + XQKeyCapture::CaptureSideKeys | XQKeyCapture::CaptureEnableRemoteExtEvents); } + +QFlags KeyCaptureTestApp::getFlags() +{ + QFlags flags = XQKeyCapture::CaptureNone + // remote call handling extension + | (toggleRemoteCallHandlingEx->isChecked() + ? XQKeyCapture::CaptureCallHandlingExt : XQKeyCapture::CaptureNone) + // basic remcon accesory events + | (toggleRemoteBasic->isChecked() + ? XQKeyCapture::CaptureBasic : XQKeyCapture::CaptureNone) + // side keys api + | (toggleRemoteSideKeys->isChecked() + ? XQKeyCapture::CaptureSideKeys : XQKeyCapture::CaptureNone) + // generate extevents + | (toggleRemoteExtEvents->isChecked() + ? XQKeyCapture::CaptureEnableRemoteExtEvents : XQKeyCapture::CaptureNone); + return flags; +} diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/examples/keycaptureex/keycapturetestapp.h --- a/qtmobileextensions/examples/keycaptureex/keycapturetestapp.h Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/examples/keycaptureex/keycapturetestapp.h Mon Oct 04 01:32:41 2010 +0300 @@ -50,6 +50,7 @@ void enableRemBasic(bool); void enableRemCallHandlingEx(bool); + void enableRemoteSideKeys(bool); void enableRemoteExtEvents(bool); void remoteAll(bool enable); @@ -57,7 +58,9 @@ private: void procesAction(CaptureRequest request); - void processEvent(QEvent *event); + void processEvent(const QString &prefix, QEvent *event); + + QFlags getFlags(); private: QPlainTextEdit *mTextArea; @@ -65,6 +68,7 @@ QAction *toggleRemoteBasic; QAction *toggleRemoteCallHandlingEx; + QAction *toggleRemoteSideKeys; QAction *toggleRemoteExtEvents; QAction *remoteAllOn; diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/examples/keycaptureex/mybutton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtmobileextensions/examples/keycaptureex/mybutton.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -0,0 +1,1 @@ + diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/examples/keycaptureex/mybutton.h --- a/qtmobileextensions/examples/keycaptureex/mybutton.h Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/examples/keycaptureex/mybutton.h Mon Oct 04 01:32:41 2010 +0300 @@ -28,25 +28,30 @@ #include #include -class MyKeyButton : public QPushButton +class MyButton : public QPushButton { Q_OBJECT public: - MyKeyButton(QPlainTextEdit *logger, QWidget *parent = 0) - : - QPushButton(QString("dummy"), parent) + + MyButton(QPlainTextEdit *logger, QWidget *parent = 0) : QPushButton(QString("focus here"), parent) { justLogger = logger; keyLabels.insert(Qt::Key_VolumeUp, "Volume Up"); - keyLabels.insert(Qt::Key_VolumeDown, "Volume Down"); + keyLabels.insert(Qt::Key_VolumeDown, "Volume Down"); + keyLabels.insert(Qt::Key_Hangup, "Hangup"); + keyLabels.insert(Qt::Key_Play, "Play"); + keyLabels.insert(Qt::Key_MediaNext, "Media Next"); + keyLabels.insert(Qt::Key_MediaPrevious, "Media Previous"); + keyLabels.insert(Qt::Key_Forward, "Forward"); + keyLabels.insert(Qt::Key_Back, "Back"); } - ~MyKeyButton() + ~MyButton() { } - bool event(QEvent *event) + /*bool event(QEvent *event) { if (justLogger) { if (event->type() != QEvent::KeyPress) { @@ -61,6 +66,27 @@ } } return QPushButton::event(event); + }*/ + + void keyPressEvent(QKeyEvent *e) + { + QString keyName = mapNaturalName(static_cast(e->key())); + addTextLine(QString("P> %1").arg(keyName)); + } + + void keyReleaseEvent(QKeyEvent *e) + { + QString keyName = mapNaturalName(static_cast(e->key())); + addTextLine(QString("R> %1").arg(keyName)); + } + + void addTextLine(QString aText) + { + if ( !aText.endsWith("\n")) + aText = aText + "\n"; + QString msg = justLogger->toPlainText(); + msg = aText + msg; + justLogger->setPlainText(msg); } private: diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/examples/keycaptureex/txlogger.h --- a/qtmobileextensions/examples/keycaptureex/txlogger.h Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/examples/keycaptureex/txlogger.h Mon Oct 04 01:32:41 2010 +0300 @@ -30,7 +30,6 @@ #define XQCONNECT_ASSERT(a, b, c, d) if (!(QObject::connect((a),(b), (c), (d)))) { qFatal("Connection failed: connect(%s, %s, %s, %s)", #a, #b, #c, #d); } -// stolen from qt-music :) #ifdef ENABLETRACE #include #include diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/bwins/xqkeycaptureu.def --- a/qtmobileextensions/src/bwins/xqkeycaptureu.def Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/bwins/xqkeycaptureu.def Mon Oct 04 01:32:41 2010 +0300 @@ -1,32 +1,32 @@ EXPORTS - ?errorId@XqKeyCapture@@QBEHXZ @ 1 NONAME ; int XqKeyCapture::errorId(void) const - ?captureLongKey@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 2 NONAME ; bool XqKeyCapture::captureLongKey(enum Qt::Key, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) - ?captureKeyUpAndDowns@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 3 NONAME ; bool XqKeyCapture::captureKeyUpAndDowns(enum Qt::Key, class QFlags, class QFlags) - ??0XqKeyCapture@@QAE@XZ @ 4 NONAME ; XqKeyCapture::XqKeyCapture(void) - ?cancelCaptureKeyUpAndDowns@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 5 NONAME ; bool XqKeyCapture::cancelCaptureKeyUpAndDowns(enum Qt::Key, class QFlags, class QFlags) - ?cancelCaptureLongKey@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 6 NONAME ; bool XqKeyCapture::cancelCaptureLongKey(enum Qt::Key, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) - ?cancelCaptureKey@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 7 NONAME ; bool XqKeyCapture::cancelCaptureKey(enum Qt::Key, class QFlags, class QFlags) - ?errorString@XqKeyCapture@@QBE?AVQString@@XZ @ 8 NONAME ; class QString XqKeyCapture::errorString(void) const - ?captureKey@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 9 NONAME ; bool XqKeyCapture::captureKey(enum Qt::Key, class QFlags, class QFlags) - ??1XqKeyCapture@@QAE@XZ @ 10 NONAME ; XqKeyCapture::~XqKeyCapture(void) - ?captureKeyUpAndDowns@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 11 NONAME ; bool XqKeyCapture::captureKeyUpAndDowns(unsigned int, class QFlags, class QFlags) - ?captureKey@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 12 NONAME ; bool XqKeyCapture::captureKey(unsigned int, class QFlags, class QFlags) - ?cancelCaptureKeyUpAndDowns@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 13 NONAME ; bool XqKeyCapture::cancelCaptureKeyUpAndDowns(unsigned int, class QFlags, class QFlags) - ?captureLongKey@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0W4LongFlags@1@@Z @ 14 NONAME ; bool XqKeyCapture::captureLongKey(unsigned int, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) - ?cancelCaptureKey@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 15 NONAME ; bool XqKeyCapture::cancelCaptureKey(unsigned int, class QFlags, class QFlags) - ?cancelCaptureLongKey@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0W4LongFlags@1@@Z @ 16 NONAME ; bool XqKeyCapture::cancelCaptureLongKey(unsigned int, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) - ?captureKey@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 17 NONAME ; bool XqKeyCapture::captureKey(class QList, class QFlags, class QFlags) - ?cancelCaptureKeyUpAndDowns@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 18 NONAME ; bool XqKeyCapture::cancelCaptureKeyUpAndDowns(class QList, class QFlags, class QFlags) - ?cancelCaptureLongKey@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 19 NONAME ; bool XqKeyCapture::cancelCaptureLongKey(class QList, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) - ?captureLongKey@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 20 NONAME ; bool XqKeyCapture::captureLongKey(class QList, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) - ?captureKeyUpAndDowns@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 21 NONAME ; bool XqKeyCapture::captureKeyUpAndDowns(class QList, class QFlags, class QFlags) - ?captureKeyUpAndDowns@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 22 NONAME ; bool XqKeyCapture::captureKeyUpAndDowns(class QList, class QFlags, class QFlags) - ?cancelCaptureKey@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 23 NONAME ; bool XqKeyCapture::cancelCaptureKey(class QList, class QFlags, class QFlags) - ?captureLongKey@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 24 NONAME ; bool XqKeyCapture::captureLongKey(class QList, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) - ?cancelCaptureKey@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 25 NONAME ; bool XqKeyCapture::cancelCaptureKey(class QList, class QFlags, class QFlags) - ?cancelCaptureLongKey@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 26 NONAME ; bool XqKeyCapture::cancelCaptureLongKey(class QList, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) - ?cancelCaptureKeyUpAndDowns@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 27 NONAME ; bool XqKeyCapture::cancelCaptureKeyUpAndDowns(class QList, class QFlags, class QFlags) - ?captureKey@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 28 NONAME ; bool XqKeyCapture::captureKey(class QList, class QFlags, class QFlags) + ?errorId@XqKeyCapture@@QBEHXZ @ 1 NONAME ABSENT ; int XqKeyCapture::errorId(void) const + ?captureLongKey@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 2 NONAME ABSENT ; bool XqKeyCapture::captureLongKey(enum Qt::Key, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) + ?captureKeyUpAndDowns@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 3 NONAME ABSENT ; bool XqKeyCapture::captureKeyUpAndDowns(enum Qt::Key, class QFlags, class QFlags) + ??0XqKeyCapture@@QAE@XZ @ 4 NONAME ABSENT ; XqKeyCapture::XqKeyCapture(void) + ?cancelCaptureKeyUpAndDowns@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 5 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureKeyUpAndDowns(enum Qt::Key, class QFlags, class QFlags) + ?cancelCaptureLongKey@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 6 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureLongKey(enum Qt::Key, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) + ?cancelCaptureKey@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 7 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureKey(enum Qt::Key, class QFlags, class QFlags) + ?errorString@XqKeyCapture@@QBE?AVQString@@XZ @ 8 NONAME ABSENT ; class QString XqKeyCapture::errorString(void) const + ?captureKey@XqKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 9 NONAME ABSENT ; bool XqKeyCapture::captureKey(enum Qt::Key, class QFlags, class QFlags) + ??1XqKeyCapture@@QAE@XZ @ 10 NONAME ABSENT ; XqKeyCapture::~XqKeyCapture(void) + ?captureKeyUpAndDowns@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 11 NONAME ABSENT ; bool XqKeyCapture::captureKeyUpAndDowns(unsigned int, class QFlags, class QFlags) + ?captureKey@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 12 NONAME ABSENT ; bool XqKeyCapture::captureKey(unsigned int, class QFlags, class QFlags) + ?cancelCaptureKeyUpAndDowns@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 13 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureKeyUpAndDowns(unsigned int, class QFlags, class QFlags) + ?captureLongKey@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0W4LongFlags@1@@Z @ 14 NONAME ABSENT ; bool XqKeyCapture::captureLongKey(unsigned int, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) + ?cancelCaptureKey@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 15 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureKey(unsigned int, class QFlags, class QFlags) + ?cancelCaptureLongKey@XqKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0W4LongFlags@1@@Z @ 16 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureLongKey(unsigned int, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) + ?captureKey@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 17 NONAME ABSENT ; bool XqKeyCapture::captureKey(class QList, class QFlags, class QFlags) + ?cancelCaptureKeyUpAndDowns@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 18 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureKeyUpAndDowns(class QList, class QFlags, class QFlags) + ?cancelCaptureLongKey@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 19 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureLongKey(class QList, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) + ?captureLongKey@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 20 NONAME ABSENT ; bool XqKeyCapture::captureLongKey(class QList, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) + ?captureKeyUpAndDowns@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 21 NONAME ABSENT ; bool XqKeyCapture::captureKeyUpAndDowns(class QList, class QFlags, class QFlags) + ?captureKeyUpAndDowns@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 22 NONAME ABSENT ; bool XqKeyCapture::captureKeyUpAndDowns(class QList, class QFlags, class QFlags) + ?cancelCaptureKey@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 23 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureKey(class QList, class QFlags, class QFlags) + ?captureLongKey@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 24 NONAME ABSENT ; bool XqKeyCapture::captureLongKey(class QList, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) + ?cancelCaptureKey@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 25 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureKey(class QList, class QFlags, class QFlags) + ?cancelCaptureLongKey@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 26 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureLongKey(class QList, class QFlags, class QFlags, enum XqKeyCapture::LongFlags) + ?cancelCaptureKeyUpAndDowns@XqKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 27 NONAME ABSENT ; bool XqKeyCapture::cancelCaptureKeyUpAndDowns(class QList, class QFlags, class QFlags) + ?captureKey@XqKeyCapture@@QAE_NV?$QList@I@@V?$QFlags@W4KeyboardModifier@Qt@@@@1@Z @ 28 NONAME ABSENT ; bool XqKeyCapture::captureKey(class QList, class QFlags, class QFlags) ?captureLongKey@XQKeyCapture@@QAE_NW4Key@Qt@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 29 NONAME ; bool XQKeyCapture::captureLongKey(enum Qt::Key, class QFlags, class QFlags, enum XQKeyCapture::LongFlags) ?captureLongKey@XQKeyCapture@@QAE_NV?$QList@W4Key@Qt@@@@V?$QFlags@W4KeyboardModifier@Qt@@@@1W4LongFlags@1@@Z @ 30 NONAME ; bool XQKeyCapture::captureLongKey(class QList, class QFlags, class QFlags, enum XQKeyCapture::LongFlags) ?cancelCaptureKey@XQKeyCapture@@QAE_NIV?$QFlags@W4KeyboardModifier@Qt@@@@0@Z @ 31 NONAME ; bool XQKeyCapture::cancelCaptureKey(unsigned int, class QFlags, class QFlags) diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/eabi/xqkeycaptureu.def --- a/qtmobileextensions/src/eabi/xqkeycaptureu.def Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/eabi/xqkeycaptureu.def Mon Oct 04 01:32:41 2010 +0300 @@ -1,34 +1,34 @@ EXPORTS - _ZN12XqKeyCapture10captureKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 1 NONAME - _ZN12XqKeyCapture14captureLongKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_NS_9LongFlagsE @ 2 NONAME - _ZN12XqKeyCapture16cancelCaptureKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 3 NONAME - _ZN12XqKeyCapture20cancelCaptureLongKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_NS_9LongFlagsE @ 4 NONAME - _ZN12XqKeyCapture20captureKeyUpAndDownsEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 5 NONAME - _ZN12XqKeyCapture26cancelCaptureKeyUpAndDownsEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 6 NONAME - _ZN12XqKeyCaptureC1Ev @ 7 NONAME - _ZN12XqKeyCaptureC2Ev @ 8 NONAME - _ZN12XqKeyCaptureD1Ev @ 9 NONAME - _ZN12XqKeyCaptureD2Ev @ 10 NONAME - _ZNK12XqKeyCapture11errorStringEv @ 11 NONAME - _ZNK12XqKeyCapture7errorIdEv @ 12 NONAME - _ZN12XqKeyCapture10captureKeyEj6QFlagsIN2Qt16KeyboardModifierEES3_ @ 13 NONAME - _ZN12XqKeyCapture14captureLongKeyEj6QFlagsIN2Qt16KeyboardModifierEES3_NS_9LongFlagsE @ 14 NONAME - _ZN12XqKeyCapture16cancelCaptureKeyEj6QFlagsIN2Qt16KeyboardModifierEES3_ @ 15 NONAME - _ZN12XqKeyCapture20cancelCaptureLongKeyEj6QFlagsIN2Qt16KeyboardModifierEES3_NS_9LongFlagsE @ 16 NONAME - _ZN12XqKeyCapture20captureKeyUpAndDownsEj6QFlagsIN2Qt16KeyboardModifierEES3_ @ 17 NONAME - _ZN12XqKeyCapture26cancelCaptureKeyUpAndDownsEj6QFlagsIN2Qt16KeyboardModifierEES3_ @ 18 NONAME - _ZN12XqKeyCapture10captureKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 19 NONAME - _ZN12XqKeyCapture10captureKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 20 NONAME - _ZN12XqKeyCapture14captureLongKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_NS_9LongFlagsE @ 21 NONAME - _ZN12XqKeyCapture14captureLongKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_NS_9LongFlagsE @ 22 NONAME - _ZN12XqKeyCapture16cancelCaptureKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 23 NONAME - _ZN12XqKeyCapture16cancelCaptureKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 24 NONAME - _ZN12XqKeyCapture20cancelCaptureLongKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_NS_9LongFlagsE @ 25 NONAME - _ZN12XqKeyCapture20cancelCaptureLongKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_NS_9LongFlagsE @ 26 NONAME - _ZN12XqKeyCapture20captureKeyUpAndDownsE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 27 NONAME - _ZN12XqKeyCapture20captureKeyUpAndDownsE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 28 NONAME - _ZN12XqKeyCapture26cancelCaptureKeyUpAndDownsE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 29 NONAME - _ZN12XqKeyCapture26cancelCaptureKeyUpAndDownsE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 30 NONAME + _ZN12XqKeyCapture10captureKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 1 NONAME ABSENT + _ZN12XqKeyCapture14captureLongKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_NS_9LongFlagsE @ 2 NONAME ABSENT + _ZN12XqKeyCapture16cancelCaptureKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 3 NONAME ABSENT + _ZN12XqKeyCapture20cancelCaptureLongKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_NS_9LongFlagsE @ 4 NONAME ABSENT + _ZN12XqKeyCapture20captureKeyUpAndDownsEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 5 NONAME ABSENT + _ZN12XqKeyCapture26cancelCaptureKeyUpAndDownsEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 6 NONAME ABSENT + _ZN12XqKeyCaptureC1Ev @ 7 NONAME ABSENT + _ZN12XqKeyCaptureC2Ev @ 8 NONAME ABSENT + _ZN12XqKeyCaptureD1Ev @ 9 NONAME ABSENT + _ZN12XqKeyCaptureD2Ev @ 10 NONAME ABSENT + _ZNK12XqKeyCapture11errorStringEv @ 11 NONAME ABSENT + _ZNK12XqKeyCapture7errorIdEv @ 12 NONAME ABSENT + _ZN12XqKeyCapture10captureKeyEj6QFlagsIN2Qt16KeyboardModifierEES3_ @ 13 NONAME ABSENT + _ZN12XqKeyCapture14captureLongKeyEj6QFlagsIN2Qt16KeyboardModifierEES3_NS_9LongFlagsE @ 14 NONAME ABSENT + _ZN12XqKeyCapture16cancelCaptureKeyEj6QFlagsIN2Qt16KeyboardModifierEES3_ @ 15 NONAME ABSENT + _ZN12XqKeyCapture20cancelCaptureLongKeyEj6QFlagsIN2Qt16KeyboardModifierEES3_NS_9LongFlagsE @ 16 NONAME ABSENT + _ZN12XqKeyCapture20captureKeyUpAndDownsEj6QFlagsIN2Qt16KeyboardModifierEES3_ @ 17 NONAME ABSENT + _ZN12XqKeyCapture26cancelCaptureKeyUpAndDownsEj6QFlagsIN2Qt16KeyboardModifierEES3_ @ 18 NONAME ABSENT + _ZN12XqKeyCapture10captureKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 19 NONAME ABSENT + _ZN12XqKeyCapture10captureKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 20 NONAME ABSENT + _ZN12XqKeyCapture14captureLongKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_NS_9LongFlagsE @ 21 NONAME ABSENT + _ZN12XqKeyCapture14captureLongKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_NS_9LongFlagsE @ 22 NONAME ABSENT + _ZN12XqKeyCapture16cancelCaptureKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 23 NONAME ABSENT + _ZN12XqKeyCapture16cancelCaptureKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 24 NONAME ABSENT + _ZN12XqKeyCapture20cancelCaptureLongKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_NS_9LongFlagsE @ 25 NONAME ABSENT + _ZN12XqKeyCapture20cancelCaptureLongKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_NS_9LongFlagsE @ 26 NONAME ABSENT + _ZN12XqKeyCapture20captureKeyUpAndDownsE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 27 NONAME ABSENT + _ZN12XqKeyCapture20captureKeyUpAndDownsE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 28 NONAME ABSENT + _ZN12XqKeyCapture26cancelCaptureKeyUpAndDownsE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 29 NONAME ABSENT + _ZN12XqKeyCapture26cancelCaptureKeyUpAndDownsE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 30 NONAME ABSENT _ZN12XQKeyCapture10captureKeyE5QListIN2Qt3KeyEE6QFlagsINS1_16KeyboardModifierEES6_ @ 31 NONAME _ZN12XQKeyCapture10captureKeyE5QListIjE6QFlagsIN2Qt16KeyboardModifierEES5_ @ 32 NONAME _ZN12XQKeyCapture10captureKeyEN2Qt3KeyE6QFlagsINS0_16KeyboardModifierEES4_ @ 33 NONAME diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/keycapture/capturerequest_s60.cpp --- a/qtmobileextensions/src/keycapture/capturerequest_s60.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/keycapture/capturerequest_s60.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -35,7 +35,7 @@ #else MyTestWindowGroup* aGroup #endif - ): + ): mKey(aKey), mModifiersMask(aModifiersMask), mModifier(aModifier), @@ -88,18 +88,14 @@ bool additionalAction = false; TUint additionalKey = 0; switch(mKey){ - case EKeyLeftShift: - additionalAction = true; - additionalKey = (mRequestType == CaptureRequestTypeUpAndDown) ? EStdKeyRightShift : EKeyRightShift; - break; - case EKeyLeftCtrl: - additionalAction = true; - additionalKey = (mRequestType == CaptureRequestTypeUpAndDown) ? EStdKeyRightCtrl : EKeyRightCtrl; - break; - case EKeyLeftFunc: - additionalAction = true; - additionalKey = (mRequestType == CaptureRequestTypeUpAndDown) ? EStdKeyRightFunc : EKeyRightFunc; - break; + case EKeyLeftShift: + additionalAction = true; + additionalKey = (mRequestType == CaptureRequestTypeUpAndDown) ? EStdKeyRightShift : EKeyRightShift; + break; + case EKeyLeftCtrl: + additionalAction = true; + additionalKey = (mRequestType == CaptureRequestTypeUpAndDown) ? EStdKeyRightCtrl : EKeyRightCtrl; + break; } if (additionalAction && additionalKey != 0) { @@ -110,8 +106,8 @@ translatedModifierMask(), translatedModifier()); break; case CaptureRequestTypeLong: - mAdditionalRequestHandle = mGroup->CaptureLongKey(additionalKey, - additionalKey, translatedModifierMask(), translatedModifier(), 0, longKeyFlags); + mAdditionalRequestHandle = mGroup->CaptureLongKey(additionalKey, additionalKey, + translatedModifierMask(), translatedModifier(), 0, longKeyFlags); break; case CaptureRequestTypeUpAndDown: mAdditionalRequestHandle = mGroup->CaptureKeyUpAndDowns(additionalKey, diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/keycapture/keycapture_s60_p.h --- a/qtmobileextensions/src/keycapture/keycapture_s60_p.h Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/keycapture/keycapture_s60_p.h Mon Oct 04 01:32:41 2010 +0300 @@ -84,7 +84,6 @@ TargetWrapper *tgWrapper; friend class XQKeyCapture; - friend class XqKeyCapture; }; #endif /* KEYCAPTUREPRIVATE_S60_H */ diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/keycapture/targetwrapper.cpp --- a/qtmobileextensions/src/keycapture/targetwrapper.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/keycapture/targetwrapper.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -65,6 +65,7 @@ void TargetWrapper::reset() { + TX_ENTRY try { cleanup(); @@ -93,19 +94,20 @@ handlerEx = 0; qDebug() << "TargetWrapper::init - exception: " << e.what(); throw; - } + } + TX_EXIT } Qt::Key TargetWrapper::mapKey(TRemConCoreApiOperationId aOperationId) { + TX_ENTRY Qt::Key key = keyMapping.value(aOperationId); - if (key != Qt::Key()) - return key; - else { - return Qt::Key_unknown; + if (key == Qt::Key()) { + key = Qt::Key_unknown; } - + TX_EXIT + return key; } /* @@ -113,16 +115,19 @@ */ void TargetWrapper::cleanup() { + TX_ENTRY delete handler; handler = 0; delete handlerEx; handlerEx = 0; delete selector; selector = 0; + TX_EXIT } void TargetWrapper::MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct) { + TX_ENTRY if (target) { Qt::Key key = mapKey(aOperationId); switch (aButtonAct) { @@ -140,6 +145,7 @@ sendKey(QEvent::KeyRelease, key, Qt::NoModifier, aOperationId); break; default: + TX_EXIT return; } } else { @@ -151,10 +157,12 @@ } else { qWarning() << "handler in MrccatoCommand was not initialized"; } + TX_EXIT } void TargetWrapper::AnswerCall() { + TX_ENTRY if (targetEx) { sendKey(QEvent::KeyPress, Qt::Key_Call, Qt::NoModifier); sendKey(QEvent::KeyRelease, Qt::Key_Call, Qt::NoModifier); @@ -166,10 +174,12 @@ } else { qWarning() << "handlerEx in AnswerCall was not initialized"; } + TX_EXIT } void TargetWrapper::EndCall() { + TX_ENTRY if (targetEx) { sendKey(QEvent::KeyPress, Qt::Key_Hangup, Qt::NoModifier); sendKey(QEvent::KeyRelease, Qt::Key_Hangup, Qt::NoModifier); @@ -181,10 +191,12 @@ } else { qWarning() << "handlerEx in EndCall was not initialized"; } + TX_EXIT } void TargetWrapper::AnswerEndCall() { + TX_ENTRY if (targetEx) { sendKey(QEvent::KeyPress, Qt::Key_Hangup, Qt::NoModifier); //TODO: Qt::Key_ToggleCallHangup sendKey(QEvent::KeyRelease, Qt::Key_Hangup, Qt::NoModifier); @@ -196,40 +208,54 @@ } else { qWarning() << "handlerEx in AnswerEndCall was not initialized"; } + TX_EXIT } void TargetWrapper::VoiceDial( const TBool aActivate ) { + TX_ENTRY Q_UNUSED(aActivate) + TX_EXIT } void TargetWrapper::LastNumberRedial() { + TX_ENTRY + TX_EXIT } void TargetWrapper::DialCall( const TDesC8& aTelNumber ) { + TX_ENTRY Q_UNUSED(aTelNumber) + TX_EXIT } void TargetWrapper::MultipartyCalling( const TDesC8& aData ) { + TX_ENTRY Q_UNUSED(aData) + TX_EXIT } void TargetWrapper::GenerateDTMF( const TChar aChar ) { + TX_ENTRY Q_UNUSED(aChar) + TX_EXIT } void TargetWrapper::SpeedDial( const TInt aIndex ) { + TX_ENTRY Q_UNUSED(aIndex) + TX_EXIT } void TargetWrapper::sendKey(QEvent::Type eventType, Qt::Key key, Qt::KeyboardModifiers modFlags, TRemConCoreApiOperationId aOperationId) { + TX_ENTRY QWidget *widget = getTargetWidget(); if (widget) { QKeyEvent *event = NULL; @@ -245,15 +271,19 @@ event = new QKeyEvent(eventType, key, modFlags); } - if (event){ + if (event) { + TX_LOG_ARGS("Sending event: " << event->key() << ", " << event->modifiers() << "[" << event->nativeScanCode() << ", " << event->nativeVirtualKey() << ", " << event->nativeModifiers() << "]"); QApplication::sendEvent(widget, event); + TX_LOG_ARGS("Event sent: " << event->key()); delete event; } } + TX_EXIT } QWidget *TargetWrapper::getTargetWidget() { + TX_ENTRY QWidget *widget; widget = QWidget::keyboardGrabber(); if (!widget) { @@ -267,6 +297,7 @@ } } } + TX_EXIT return widget; } @@ -274,6 +305,7 @@ void TargetWrapper::initMapping() { + TX_ENTRY keyMapping.insert(ERemConCoreApiSelect, Qt::Key_Select); keyMapping.insert(ERemConCoreApiUp, Qt::Key_Up); keyMapping.insert(ERemConCoreApiDown, Qt::Key_Down); @@ -337,4 +369,5 @@ keyMapping.insert(ERemConCoreApiF4, Qt::Key_F4); keyMapping.insert(ERemConCoreApiF5, Qt::Key_F5); keyMapping.insert(ENop, Qt::Key_unknown); + TX_EXIT } diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/keycapture/targetwrapper.h --- a/qtmobileextensions/src/keycapture/targetwrapper.h Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/keycapture/targetwrapper.h Mon Oct 04 01:32:41 2010 +0300 @@ -36,7 +36,7 @@ #include -#include +#include class QPlainTextEdit; class QAction; diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/keycapture/tsrc/test_xqkeycapture.cpp --- a/qtmobileextensions/src/keycapture/tsrc/test_xqkeycapture.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/keycapture/tsrc/test_xqkeycapture.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -34,6 +34,7 @@ const int KAllFlagsOn = XQKeyCapture::CaptureBasic | XQKeyCapture::CaptureCallHandlingExt | + XQKeyCapture::CaptureSideKeys | XQKeyCapture::CaptureEnableRemoteExtEvents; const Qt::Key KNotSpecifiedKey = Qt::Key_F35; @@ -59,11 +60,11 @@ void testCaptureKeyList_data(); void testCaptureKeyList(); - void testCaptureKey_S60_data(); - void testCaptureKey_S60(); + void testCaptureKey_S60_data(); + void testCaptureKey_S60(); void testCaptureKeyList_S60_data(); - void testCaptureKeyList_S60(); + void testCaptureKeyList_S60(); void testCaptureKeyUpAndDowns_data(); void testCaptureKeyUpAndDowns(); @@ -155,13 +156,13 @@ void testErrorString(); void testErrorId(); - - void testKeyMapperFile(); + + void testKeyMapperFile(); private: - QString clearString(const QString& line); - QString clearString(const QString& line, const QString& prefix, const QString& comment); - void setProperKeys(bool extended); + QString clearString(const QString& line); + QString clearString(const QString& line, const QString& prefix, const QString& comment); + void setProperKeys(bool extended); private: XQKeyCapture* keyCapture; @@ -333,15 +334,24 @@ << true << static_cast(EKeyRightCtrl); - QTest::newRow("meta_key") << static_cast(Qt::Key_Super_R) + QTest::newRow("meta_keyR") << static_cast(Qt::Key_Super_R) << static_cast(Qt::NoModifier) << static_cast(Qt::NoModifier) << static_cast(EKeyRightFunc) << static_cast(0) << static_cast(0) << static_cast(12) - << true - << static_cast(EKeyRightFunc); + << false + << static_cast(0); + QTest::newRow("meta_keyL") << static_cast(Qt::Key_Super_L) + << static_cast(Qt::NoModifier) + << static_cast(Qt::NoModifier) + << static_cast(EKeyLeftFunc) + << static_cast(0) + << static_cast(0) + << static_cast(12) + << false + << static_cast(0); } void TestXQKeyCapture::testCaptureKey() @@ -481,19 +491,27 @@ << static_cast(0) << static_cast(0) << static_cast(12) - << true - << static_cast(EKeyRightFunc); + << false + << static_cast(0); - QTest::newRow("meta_key") << static_cast(EKeyLeftCtrl) + QTest::newRow("meta_key") << static_cast(EKeyRightFunc) << static_cast(Qt::NoModifier) << static_cast(Qt::NoModifier) - << static_cast(EKeyLeftCtrl) + << static_cast(EKeyRightFunc) << static_cast(0) << static_cast(0) << static_cast(12) - << true - << static_cast(EKeyLeftFunc); - + << false + << static_cast(0); + QTest::newRow("meta_keyL") << static_cast(EKeyLeftFunc) + << static_cast(Qt::NoModifier) + << static_cast(Qt::NoModifier) + << static_cast(EKeyLeftFunc) + << static_cast(0) + << static_cast(0) + << static_cast(12) + << false + << static_cast(0); } @@ -526,6 +544,7 @@ additionalResults << additionalSymbianKey << symbianMask << symbianModifier; MyTestWindowGroup::Instance()->setRequestNumber(reqNum); + keyCapture->captureKey(static_cast(s60Key), Qt::KeyboardModifier(qtMask), Qt::KeyboardModifier(qtModifier)); } @@ -1627,15 +1646,17 @@ QTest::addColumn("flags"); // there are 4 flags: - // XQKeyCapture::CaptureNone = 0x0 - // XQKeyCapture::CaptureBasic = 0x1 - // XQKeyCapture::CaptureCallHandlingExt = 0x2 - // XQKeyCapture::CaptureEnableRemoteExtEvents = 0x4 + // CaptureNone = 0x0, + // CaptureBasic = 0x1, + // CaptureCallHandlingExt = 0x2, + // CaptureSideKeys = 0x4, // for future use + // CaptureEnableRemoteExtEvents = 0x4000 // so we should iterate through all combinations: for(unsigned int i(0); i <= KAllFlagsOn; ++i) { QString desc("flag:0x" + QString::number(i,16)); QTest::newRow(desc.toAscii()) << i ; - } + } + } void TestXQKeyCapture::testCaptureRemoteKeys() @@ -1984,10 +2005,11 @@ for(int i = 0; i < numOfArgs; i++) { - if(additionalResult) - QVERIFY(paramList[i] == additionalResults[i]); - else - QVERIFY(paramList[i] == results[i]); + if(additionalResult) { + QVERIFY2(paramList[i] == additionalResults[i],QString("Unequal [1]: %1 != %2").arg(paramList[i]).arg(additionalResults[i]).toLatin1().data()); + } else { + QVERIFY2(paramList[i] == results[i], QString("Unequal [2]: %1 != %2").arg(paramList[i]).arg(results[i]).toLatin1().data()); + } } } if(willBeAdditionalRequest){ @@ -2050,8 +2072,10 @@ //main //////////////////////////////////////////////////////////////// +#define _XQKEYCAPTURE_UNITTEST_LOG_TO_C_ + #ifdef _XQKEYCAPTURE_UNITTEST_LOG_TO_C_ - main(int argc, char* argv[]) +int main(int argc, char* argv[]) { QApplication app(argc, argv); TestXQKeyCapture tc; diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/keycapture/txlogger.h --- a/qtmobileextensions/src/keycapture/txlogger.h Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/keycapture/txlogger.h Mon Oct 04 01:32:41 2010 +0300 @@ -61,17 +61,18 @@ #define TX_MAIN(a, b) _TX_INIT \ int __tx__main(int, char**); int main(int (a), char **(b)) { _TX_INSTALL return __tx__main(a, b); } int __tx__main(int (a), char **(b)) +#define TX_PREFIX "[KeyCapture]" #define TX_UNUSED(name); -#define TX_STATIC_ENTRY qDebug() << __PRETTY_FUNCTION__ << "entry"; -#define TX_STATIC_ENTRY_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "entry," << args; -#define TX_STATIC_EXIT qDebug() << __PRETTY_FUNCTION__ << "exit"; -#define TX_STATIC_EXIT_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "exit," << args; -#define TX_ENTRY qDebug() << __PRETTY_FUNCTION__ << "this" << (void *)this << "entry"; -#define TX_ENTRY_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "this" << (void *)this << "entry," << args; -#define TX_EXIT qDebug() << __PRETTY_FUNCTION__ << "exit"; -#define TX_EXIT_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << "exit," << args; -#define TX_LOG qDebug() << __PRETTY_FUNCTION__ << "this" << (void *)this; -#define TX_LOG_ARGS(args) qDebug() << __PRETTY_FUNCTION__ << args; +#define TX_STATIC_ENTRY qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "entry"; +#define TX_STATIC_ENTRY_ARGS(args) qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "entry," << args; +#define TX_STATIC_EXIT qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "exit"; +#define TX_STATIC_EXIT_ARGS(args) qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "exit," << args; +#define TX_ENTRY qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "this" << (void *)this << "entry"; +#define TX_ENTRY_ARGS(args) qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "this" << (void *)this << "entry," << args; +#define TX_EXIT qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "exit"; +#define TX_EXIT_ARGS(args) qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "exit," << args; +#define TX_LOG qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << "this" << (void *)this; +#define TX_LOG_ARGS(args) qDebug() << TX_PREFIX << __PRETTY_FUNCTION__ << args; #else #define TX_MAIN(a,b) int main(int (a), char **(b)) #define TX_UNUSED(name) Q_UNUSED(name); diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/keycapture/xqkeycapture.cpp --- a/qtmobileextensions/src/keycapture/xqkeycapture.cpp Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/keycapture/xqkeycapture.cpp Mon Oct 04 01:32:41 2010 +0300 @@ -296,7 +296,7 @@ Qt::Key key; bool result = true; foreach (key, list) { - bool result = result & captureKey(key, aModifiersMask, aModifier); + result = result & captureKey(key, aModifiersMask, aModifier); } return result; } @@ -315,7 +315,7 @@ TUint key; bool result = true; foreach (key, list) { - bool result = result & captureKey(key, aModifiersMask, aModifier); + result = result & captureKey(key, aModifiersMask, aModifier); } return result; } @@ -335,7 +335,7 @@ Qt::Key key; bool result = true; foreach (key, list) { - bool result = result & captureLongKey(key, aModifiersMask, aModifier, aLongType); + result = result & captureLongKey(key, aModifiersMask, aModifier, aLongType); } return result; } @@ -355,7 +355,7 @@ TUint key; bool result = true; foreach (key, list) { - bool result = result & captureLongKey(key, aModifiersMask, aModifier, aLongType); + result = result & captureLongKey(key, aModifiersMask, aModifier, aLongType); } return result; } @@ -374,7 +374,7 @@ Qt::Key key; bool result = true; foreach (key, list) { - bool result = result & captureKeyUpAndDowns(key, aModifiersMask, aModifier); + result = result & captureKeyUpAndDowns(key, aModifiersMask, aModifier); } return result; } @@ -393,7 +393,7 @@ TUint key; bool result = true; foreach (key, list) { - bool result = result & captureKeyUpAndDowns(key, aModifiersMask, aModifier); + result = result & captureKeyUpAndDowns(key, aModifiersMask, aModifier); } return result; } @@ -412,7 +412,7 @@ Qt::Key key; bool result = true; foreach (key, list) { - bool result = result & cancelCaptureKey(key, aModifiersMask, aModifier); + result = result & cancelCaptureKey(key, aModifiersMask, aModifier); } return result; } @@ -431,7 +431,7 @@ TUint key; bool result = true; foreach (key, list) { - bool result = result & cancelCaptureKey(key, aModifiersMask, aModifier); + result = result & cancelCaptureKey(key, aModifiersMask, aModifier); } return result; } @@ -451,7 +451,7 @@ Qt::Key key; bool result = true; foreach (key, list) { - bool result = result & cancelCaptureLongKey(key, aModifiersMask, aModifier, aLongType); + result = result & cancelCaptureLongKey(key, aModifiersMask, aModifier, aLongType); } return result; } @@ -471,7 +471,7 @@ TUint key; bool result = true; foreach (key, list) { - bool result = result & cancelCaptureLongKey(key, aModifiersMask, aModifier, aLongType); + result = result & cancelCaptureLongKey(key, aModifiersMask, aModifier, aLongType); } return result; } @@ -490,7 +490,7 @@ Qt::Key key; bool result = true; foreach (key, list) { - bool result = result & cancelCaptureKeyUpAndDowns(key, aModifiersMask, aModifier); + result = result & cancelCaptureKeyUpAndDowns(key, aModifiersMask, aModifier); } return result; } @@ -509,455 +509,9 @@ TUint key; bool result = true; foreach (key, list) { - bool result = result & cancelCaptureKeyUpAndDowns(key, aModifiersMask, aModifier); + result = result & cancelCaptureKeyUpAndDowns(key, aModifiersMask, aModifier); } return result; } -/*! - Constructor. -*/ -XqKeyCapture::XqKeyCapture() : - d(new KeyCapturePrivate()) -{ - -} - -/*! - Destructor. -*/ -XqKeyCapture::~XqKeyCapture() -{ - delete d; -} - -/*! - Selects a given key for capturing key pressing. Requires a Qt key code. - \param aKey A Qt key. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -/*! - Selects a given key for capturing key pressing. Requires a Qt key code. - \param aKey A Qt key. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureKey(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier) -{ - return d->doCapture(d->mMapper->mapQtToS60Key(aKey), aModifiersMask, aModifier, - CaptureRequest::CaptureRequestTypeNormal); -} - -/*! - Selects a given key for capturing key pressing. Requires a S60 key code (TKeyCode). - \param aKey A S60 key code (TKeyCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureKey(TUint aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier) -{ - return d->doCapture(aKey, aModifiersMask, aModifier, - CaptureRequest::CaptureRequestTypeNormal); -} - -/*! - Selects a given key for capturing long pressing. Requires a Qt key code. - \param aKey A Qt key. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureLongKey(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier, - XqKeyCapture::LongFlags aLongType) -{ - return d->doCapture(d->mMapper->mapQtToS60Key(aKey), aModifiersMask, aModifier, - CaptureRequest::CaptureRequestTypeLong, (XQKeyCapture::LongFlags)aLongType); -} - -/*! - Selects a given key for capturing long pressing. Requires a S60 key code (TKeyCode). - \param aKey A S60 key code (TKeyCode). - \param aModifiersMap - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureLongKey(TUint aKey, - Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier, - XqKeyCapture::LongFlags aLongType) -{ - return d->doCapture(aKey, aModifiersMap, aModifier, - CaptureRequest::CaptureRequestTypeLong, (XQKeyCapture::LongFlags)aLongType); -} - -/*! - Selects a given key for capturing pressing up and down. Requires a Qt key code. - \param aKey A Qt key. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureKeyUpAndDowns(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier) -{ - return d->doCapture(d->mMapper->mapQtToS60ScanCodes(aKey), aModifiersMask, - aModifier, CaptureRequest::CaptureRequestTypeUpAndDown); -} - -/*! - Selects a given key for capturing pressing up and down. Requires a S60 key scan code (TStdScanCode). - \param aKey A S60 key scan code (TStdScanCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureKeyUpAndDowns(TUint aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier) -{ - return d->doCapture(aKey, aModifiersMask, - aModifier, CaptureRequest::CaptureRequestTypeUpAndDown); -} - -/*! - Deselects a given key from key capturing. Requires a Qt key code. - \param aKey A Qt key. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureKey(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier) -{ - return d->doCancelCapture(d->mMapper->mapQtToS60Key(aKey), - aModifiersMask, aModifier, - CaptureRequest::CaptureRequestTypeNormal); -} - -/*! - Deselects a given key from key capturing. Requires a S60 key code (TKeyCode). - \param aKey A S60 key code (TKeyCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureKey(TUint aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier) -{ - return d->doCancelCapture(aKey, aModifiersMask, aModifier, - CaptureRequest::CaptureRequestTypeNormal); -} - -/*! - Deselects a given key from capturing long pressing. Requires a Qt key code. - \param aKey A Qt key. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureLongKey(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier, - XqKeyCapture::LongFlags aLongType) -{ - return d->doCancelCapture(d->mMapper->mapQtToS60Key(aKey), aModifiersMask, - aModifier, CaptureRequest::CaptureRequestTypeLong, (XQKeyCapture::LongFlags)aLongType); -} - -/*! - Deselects a given key from capturing long pressing. Requires a S60 key code (TKeyCode). - \param aKey A S60 key code (TKeyCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureLongKey(TUint aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier, - XqKeyCapture::LongFlags aLongType) -{ - return d->doCancelCapture(aKey, aModifiersMask, aModifier, - CaptureRequest::CaptureRequestTypeLong, (XQKeyCapture::LongFlags)aLongType); -} - -/*! - Deselects a given key from capturing pressing up and down. Requires a Qt key code. - \param aKey A Qt key. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureKeyUpAndDowns(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier) -{ - return d->doCancelCapture(d->mMapper->mapQtToS60ScanCodes(aKey), - aModifiersMask, aModifier, - CaptureRequest::CaptureRequestTypeUpAndDown); -} - -/*! - Deselects a given key from capturing pressing up and down. Requires a S60 key scan code (TStdScanCode). - \param aKey A S60 key scan code (TStdScanCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureKeyUpAndDowns(TUint aKey, - Qt::KeyboardModifiers aModifiersMask, Qt::KeyboardModifiers aModifier) -{ - return d->doCancelCapture(aKey, aModifiersMask, aModifier, - CaptureRequest::CaptureRequestTypeUpAndDown); -} - -/*! - Returns latest error string. - \retval Latest error string. - */ -QString XqKeyCapture::errorString() const -{ - return d->errorString(); -} - -/*! - Returns latest error id. - \retval Latest error id. - */ -int XqKeyCapture::errorId() const -{ - return d->errorId(); -} - -/*! - Selects a given keys for capturing key pressing. Requires a Qt key code. - \param list A Qt keys list. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureKey(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier) -{ - Qt::Key key; - bool result = true; - foreach (key, list) { - bool result = result & captureKey(key, aModifiersMask, aModifier); - } - return result; -} - -/*! - Selects a given keys for capturing key pressing. Requires a S60 key code (TKeyCode). - \param list A S60 list of keys (TKeyCode codes). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureKey(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier) -{ - TUint key; - bool result = true; - foreach (key, list) { - bool result = result & captureKey(key, aModifiersMask, aModifier); - } - return result; -} - -/*! - Selects a given keys for capturing long pressing. Requires a Qt key code. - \param aKey A Qt list of keys. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureLongKey(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier, - XqKeyCapture::LongFlags aLongType) -{ - Qt::Key key; - bool result = true; - foreach (key, list) { - bool result = result & captureLongKey(key, aModifiersMask, aModifier, aLongType); - } - return result; -} - -/*! - Selects a given keys for capturing long pressing. Requires a S60 key code (TKeyCode). - \param list A S60 list of keys (TKeyCode codes). - \param aModifiersMap - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ - bool XqKeyCapture::captureLongKey(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier, - XqKeyCapture::LongFlags aLongType) -{ - TUint key; - bool result = true; - foreach (key, list) { - bool result = result & captureLongKey(key, aModifiersMask, aModifier, aLongType); - } - return result; -} - -/*! - Selects a given keys for capturing pressing up and down. Requires a Qt key code. - \param list A Qt list of keys. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureKeyUpAndDowns(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier) -{ - Qt::Key key; - bool result = true; - foreach (key, list) { - bool result = result & captureKeyUpAndDowns(key, aModifiersMask, aModifier); - } - return result; -} - -/*! - Selects a given keys for capturing pressing up and down. Requires a S60 key scan code (TStdScanCode). - \param list A list of S60 key scan codes (TStdScanCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. - */ -bool XqKeyCapture::captureKeyUpAndDowns(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier) -{ - TUint key; - bool result = true; - foreach (key, list) { - bool result = result & captureKeyUpAndDowns(key, aModifiersMask, aModifier); - } - return result; -} - -/*! - Deselects a given list of keys from key capturing. Requires a Qt key code. - \param list A Qt list of keys. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureKey(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier) -{ - Qt::Key key; - bool result = true; - foreach (key, list) { - bool result = result & cancelCaptureKey(key, aModifiersMask, aModifier); - } - return result; -} - -/*! - Deselects a given list of keys from key capturing. Requires a S60 key code (TKeyCode). - \param list A S60 list of key codes (TKeyCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureKey(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier) -{ - TUint key; - bool result = true; - foreach (key, list) { - bool result = result & cancelCaptureKey(key, aModifiersMask, aModifier); - } - return result; -} - -/*! - Deselects a given list of keys from capturing long pressing. Requires a Qt key code. - \param list A list of Qt keys. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureLongKey(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier, - XqKeyCapture::LongFlags aLongType) -{ - Qt::Key key; - bool result = true; - foreach (key, list) { - bool result = result & cancelCaptureLongKey(key, aModifiersMask, aModifier, aLongType); - } - return result; -} - -/*! - Deselects a given key from capturing long pressing. Requires a S60 key code (TKeyCode). - \paramlist A list of S60 key codes (TKeyCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureLongKey(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier, - XqKeyCapture::LongFlags aLongType) -{ - TUint key; - bool result = true; - foreach (key, list) { - bool result = result & cancelCaptureLongKey(key, aModifiersMask, aModifier, aLongType); - } - return result; -} - -/*! - Deselects a list of given keys from capturing pressing up and down. Requires a Qt key codes. - \param list A list of Qt keys. - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ -bool XqKeyCapture::cancelCaptureKeyUpAndDowns(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier) -{ - Qt::Key key; - bool result = true; - foreach (key, list) { - bool result = result & cancelCaptureKeyUpAndDowns(key, aModifiersMask, aModifier); - } - return result; -} - -/*! - Deselects a given list of keys from capturing pressing up and down. Requires a S60 key scan code (TStdScanCode). - \param aKey A S60 key scan code (TStdScanCode). - \param aModifiersMask - \param aModifier - \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. - */ - bool XqKeyCapture::cancelCaptureKeyUpAndDowns(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask, - Qt::KeyboardModifiers aModifier) -{ - TUint key; - bool result = true; - foreach (key, list) { - bool result = result & cancelCaptureKeyUpAndDowns(key, aModifiersMask, aModifier); - } - return result; -} +// end of file diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/keycapture/xqkeycapture.h --- a/qtmobileextensions/src/keycapture/xqkeycapture.h Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/keycapture/xqkeycapture.h Mon Oct 04 01:32:41 2010 +0300 @@ -57,7 +57,8 @@ CaptureNone = 0x0, CaptureBasic = 0x1, CaptureCallHandlingExt = 0x2, - CaptureEnableRemoteExtEvents = 0x4 + CaptureSideKeys = 0x4, // for future use + CaptureEnableRemoteExtEvents = 0x4000 }; Q_DECLARE_FLAGS(CapturingFlags, CapturingFlag) @@ -188,139 +189,6 @@ }; -/* -@deprecated -*/ - -class XQKEYCAPTURE_EXPORT XqKeyCapture { - -public: - enum LongFlags { - LongShortEventImmediately = ELongCaptureShortEventImmediately, - LongRepeatEvents = ELongCaptureRepeatEvents, - LongNormal = ELongCaptureNormal, - LongWaitShort = ELongCaptureWaitShort, - LongWaitNotApplicable = 0 - }; - -public: - XqKeyCapture(); - - ~XqKeyCapture(); - - bool captureKey(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool captureKey(TUint aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool captureLongKey(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier, - XqKeyCapture::LongFlags aLongType = XqKeyCapture::LongNormal); - - bool captureLongKey(TUint aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier, - XqKeyCapture::LongFlags aLongType = XqKeyCapture::LongNormal); - - bool captureKeyUpAndDowns(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool captureKeyUpAndDowns(TUint aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool captureKey(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool captureKey(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool captureLongKey(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier, - XqKeyCapture::LongFlags aLongType = XqKeyCapture::LongNormal); - - bool captureLongKey(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier, - XqKeyCapture::LongFlags aLongType = XqKeyCapture::LongNormal); - - bool captureKeyUpAndDowns(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool captureKeyUpAndDowns(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool cancelCaptureKey(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool cancelCaptureKey(TUint aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool cancelCaptureLongKey(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier, - XqKeyCapture::LongFlags aLongType = XqKeyCapture::LongNormal); - - bool cancelCaptureLongKey(TUint aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier, - XqKeyCapture::LongFlags aLongType = XqKeyCapture::LongNormal); - - bool cancelCaptureKeyUpAndDowns(Qt::Key aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool cancelCaptureKeyUpAndDowns(TUint aKey, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool cancelCaptureKey(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool cancelCaptureKey(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool cancelCaptureLongKey(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier, - XqKeyCapture::LongFlags aLongType = XqKeyCapture::LongNormal); - - bool cancelCaptureLongKey(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier, - XqKeyCapture::LongFlags aLongType = XqKeyCapture::LongNormal); - - bool cancelCaptureKeyUpAndDowns(XQKeyCaptureKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - bool cancelCaptureKeyUpAndDowns(XQKeyCaptureNativeKeyList list, - Qt::KeyboardModifiers aModifiersMask = Qt::NoModifier, - Qt::KeyboardModifiers aModifier = Qt::NoModifier); - - QString errorString() const; - - int errorId() const; - -private: - KeyCapturePrivate* d; - -}; - Q_DECLARE_OPERATORS_FOR_FLAGS(XQKeyCapture::CapturingFlags) #endif /* XQKEYCAPTURE_H */ diff -r 3d09643def13 -r 6bfad47013df qtmobileextensions/src/systemtoneservice/systemtoneservice.pro --- a/qtmobileextensions/src/systemtoneservice/systemtoneservice.pro Fri Sep 17 08:34:25 2010 +0300 +++ b/qtmobileextensions/src/systemtoneservice/systemtoneservice.pro Mon Oct 04 01:32:41 2010 +0300 @@ -23,12 +23,10 @@ symbian:defFilePath=.. symbian:TARGET.UID3=0x2002EA83 +symbian:TARGET.EPOCALLOWDLLDATA=1 TARGET.CAPABILITY = CAP_GENERAL_DLL DEFINES += __STS_QT_LIB_BUILD__ include(systemtoneservice.pri) -symbian { -MMP_RULES += EPOCALLOWDLLDATA -}