--- a/qthighway/examples/serviceapp/serviceapp.pro Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/examples/serviceapp/serviceapp.pro Thu Sep 02 21:20:48 2010 +0300
@@ -31,7 +31,7 @@
symbian: TARGET.CAPABILITY = CAP_APPLICATION
-LIBS+=-lxqservice -lxqserviceutil -lflogger
+LIBS+=-lxqservice -lxqserviceutil -lflogger -lefsrv
SERVICE.FILE = service_conf.xml
SERVICE.OPTIONS = embeddable
--- a/qthighway/inc/xqserviceclientinfo.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/inc/xqserviceclientinfo.h Thu Sep 02 21:20:48 2010 +0300
@@ -28,50 +28,61 @@
namespace QtService {
+/*!
+ \class ClientInfo
+ \brief Container class for client information in ipc requests.
+*/
// FORWARD DECLARATIONS
class ClientInfo: public QObject
{
public:
/*!
- * Sets the client's name
- * @param aName - Client's name
- */
+ Sets the client's name.
+ \param aName Client's name.
+ */
inline void setName(const QString &aName) { iName = aName; }
/*!
- * Gets the client's name
- */
+ Gets the client's name.
+ \return Client's name as QString.
+ */
inline QString name() { return iName; }
/*!
- * Sets the client's process Id
- */
+ Sets the client's process ID.
+ \param aProcessId Id of the process.
+ */
inline void setProcessId(const qint64 aProcessId) { iProcessId = aProcessId; }
/*!
- * Gets the client's process ID
- */
+ Gets the client's process ID.
+ \return Process ID.
+ */
inline qint64 processId() { return iProcessId; }
/*!
- * Sets the client's vendor ID
- */
+ Sets the client's vendor ID.
+ \param aVendorId Vendor ID.
+ */
inline void setVendorId(const qint64 aVendorId) { iVendorId = aVendorId; }
/*!
- * Get's the client's vendor ID
- */
+ Gets the client's vendor ID.
+ \return Vendor ID.
+ */
inline const qint64 vendorId() { return iVendorId; }
/*!
- * Sets the client's capabilities
- */
+ Sets the client's capabilities.
+ \param capabilities Capabilities to be set.
+ */
inline void setCapabilities(const quint32 capabilities) { iCapabilities = capabilities; }
/*!
- * Get's the client's capabilities
- */
+ Gets the client's capabilities.
+ \return Client capabilities.
+ */
inline const quint32 capabilities() { return iCapabilities; }
--- a/qthighway/inc/xqserviceglobal.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/inc/xqserviceglobal.h Thu Sep 02 21:20:48 2010 +0300
@@ -75,32 +75,32 @@
{
ENoError=0,
EConnectionError = QtService::IPC_ERR_START_VALUE , /*!< Error in IPC Connection */
- EConnectionClosed, /*!< IPC Connection is closed */
- EServerNotFound, /*!< Can not find server */
- EIPCError, /*!< Known IPC error */
- EUnknownError, /*!< Unknown IPC error */
- ERequestPending, /*!< Already pending request */
- EMessageNotFound, /*!< Message slot not found */
- EArgumentError /*!< Argument error */
+ EConnectionClosed, /*!< IPC Connection is closed */
+ EServerNotFound, /*!< Can not find server */
+ EIPCError, /*!< Known IPC error */
+ EUnknownError, /*!< Unknown IPC error */
+ ERequestPending, /*!< Already pending request */
+ EMessageNotFound, /*!< Message slot not found */
+ EArgumentError /*!< Argument error */
};
enum ServiceMetadataErrors
{
- EMetaNoService = QtService::METADATA_ERR_START_VALUE, /* Can not find service root node in XML file*/
- EMetaNoServiceName, /* Can not find service name in XML file */
- EMetaNoServiceFilepath, /* Can not find service filepath in XML file */
- EMetaNoServiceInterface, /* No interface for the service in XML file*/
- EMetaNoInterfaceVersion, /* Can not find interface version in XML file */
- EMetaNoInterfaceName, /* Can not find interface name in XML file*/
- EMetaUnableToOpenFile, /* Error opening XML file*/
- EMetaInvalidXmlFile, /* Not a valid XML file*/
- EMetaParseService, /* Error parsing service node */
- EMetaParseInterface, /* Error parsing interface node */
- EMetaDuplicatedInterface, /* The same interface is defined twice */
+ EMetaNoService = QtService::METADATA_ERR_START_VALUE, /*!< Can not find service root node in XML file */
+ EMetaNoServiceName, /*!< Can not find service name in XML file */
+ EMetaNoServiceFilepath, /*!< Can not find service filepath in XML file */
+ EMetaNoServiceInterface, /*!< No interface for the service in XML file */
+ EMetaNoInterfaceVersion, /*!< Can not find interface version in XML file */
+ EMetaNoInterfaceName, /*!< Can not find interface name in XML file */
+ EMetaUnableToOpenFile, /*!< Error opening XML file */
+ EMetaInvalidXmlFile, /*!< Not a valid XML file */
+ EMetaParseService, /*!< Error parsing service node */
+ EMetaParseInterface, /*!< Error parsing interface node */
+ EMetaDuplicatedInterface, /*!< The same interface is defined twice */
EMetaInvalidVersion,
- EMetaDuplicatedTag, /* The tag appears twice */
- EMetaInvalidCustomTag, /* The customproperty tag is not corectly formatted or otherwise incorrect*/
- EMetaDuplicatedCustomKey /* The customproperty appears twice*/
+ EMetaDuplicatedTag, /*!< The tag appears twice */
+ EMetaInvalidCustomTag, /*!< The customproperty tag is not corectly formatted or otherwise incorrect */
+ EMetaDuplicatedCustomKey /*!< The customproperty appears twice */
};
enum ServiceManagerErrors
--- a/qthighway/tsrc/at_xqapplicationmanager/at_xqapplicationmanager.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/tsrc/at_xqapplicationmanager/at_xqapplicationmanager.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -48,6 +48,8 @@
void Test_XQApplicationManager::init()
{
+ testSharableFile = new XQSharableFile();
+ QVERIFY2(testSharableFile->open(testFileStr), mLog.join(endOfLine).toAscii());
mAppManager = new XQApplicationManager();
QVERIFY2(mAppManager != NULL, mLog.join(endOfLine).toAscii());
QVERIFY2(mAppManager->lastError() == XQService::ENoError, mLog.join(endOfLine).toAscii());
@@ -57,6 +59,10 @@
{
mLog << "[QTH] [Test_XQApplicationManager] drm_file";
+#ifdef __WINS__
+ QSKIP("Checking drm attributes does not work correctly on emulator", SkipAll);
+#endif
+
QStringList logmem = mLog;
foreach (QString fileStr, testData.files.keys()) {
@@ -97,6 +103,10 @@
{
mLog << "[QTH] [Test_XQApplicationManager] drm_sharablefile";
+#ifdef __WINS__
+ QSKIP("Checking drm attributes does not work correctly on emulator", SkipAll);
+#endif
+
QStringList logmem = mLog;
foreach (QString fileStr, testData.files.keys()) {
@@ -253,6 +263,8 @@
{
mLog << "[QTH] [Test_XQApplicationManager] list_file";
+ QSKIP("Currently function list(const QFile& file) returns maximum one interface", SkipAll);
+
QList<XQAiwInterfaceDescriptor> list = mAppManager->list(testFile);
foreach (InterfaceData* interfaceData, testData.interfaces.values(IFileView)) {
@@ -279,10 +291,9 @@
{
mLog << "[QTH] [Test_XQApplicationManager] list_sharablefile";
- XQSharableFile testSharableFile;
- testSharableFile.open(testFileStr);
+ QSKIP("Currently function list(const XQSharableFile& file) returns maximum one interface", SkipAll);
- QList<XQAiwInterfaceDescriptor> list = mAppManager->list(testSharableFile);
+ QList<XQAiwInterfaceDescriptor> list = mAppManager->list(*testSharableFile);
foreach (InterfaceData* interfaceData, testData.interfaces.values(IFileView)) {
bool equal = false;
@@ -302,8 +313,6 @@
QVERIFY2(mAppManager->lastError() == XQService::ENoError, mLog.join(endOfLine).toAscii());
- testSharableFile.close();
-
mLog << "[QTH] [Test_XQApplicationManager] list_sharablefile end";
}
@@ -548,25 +557,20 @@
{
mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile";
- XQSharableFile testSharableFile;
- QVERIFY2(testSharableFile.open(testFileStr), mLog.join(endOfLine).toAscii());
-
{
- XQAiwRequest* request = mAppManager->create(testSharableFile, true);
- testRequest(request, QString(), QString(), true, true, &testSharableFile);
+ XQAiwRequest* request = mAppManager->create(*testSharableFile, true);
+ testRequest(request, QString(), QString(), true, true, testSharableFile);
delete request;
}
{
- XQAiwRequest* request = mAppManager->create(testSharableFile, false);
- testRequest(request, QString(), testFileStr, false, true, &testSharableFile);
+ XQAiwRequest* request = mAppManager->create(*testSharableFile, false);
+ testRequest(request, QString(), testFileStr, false, true, testSharableFile);
delete request;
}
QVERIFY2(mAppManager->lastError() == XQService::ENoError, mLog.join(endOfLine).toAscii());
- testSharableFile.close();
-
mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile end";
}
@@ -574,23 +578,21 @@
{
mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile_implementation";
- XQSharableFile testSharableFile;
- testSharableFile.open(testFileStr);
- QList<XQAiwInterfaceDescriptor> list = mAppManager->list(testSharableFile);
+ QList<XQAiwInterfaceDescriptor> list = mAppManager->list(*testSharableFile);
QVERIFY2(list.count() > 0, mLog.join(endOfLine).toAscii());
foreach (XQAiwInterfaceDescriptor interfaceDesc, list) {
foreach (InterfaceData* interfaceData, testData.interfaces.values(IFileView)) {
if (interfaceData->compare(interfaceDesc, mLog)) {
{
- XQAiwRequest* request = mAppManager->create(testSharableFile, interfaceDesc, true);
- testRequest(request, QString(), testFileStr, true, true, &testSharableFile);
+ XQAiwRequest* request = mAppManager->create(*testSharableFile, interfaceDesc, true);
+ testRequest(request, QString(), testFileStr, true, true, testSharableFile);
delete request;
}
{
- XQAiwRequest* request = mAppManager->create(testSharableFile, interfaceDesc, false);
- testRequest(request, QString(), testFileStr, false, true, &testSharableFile);
+ XQAiwRequest* request = mAppManager->create(*testSharableFile, interfaceDesc, false);
+ testRequest(request, QString(), testFileStr, false, true, testSharableFile);
delete request;
}
}
@@ -606,8 +608,6 @@
QVERIFY2(mAppManager->lastError() == XQService::ENoError, mLog.join(endOfLine).toAscii());
- testSharableFile.close();
-
mLog << "[QTH] [Test_XQApplicationManager] create_sharablefile_implementation end";
}
@@ -629,6 +629,9 @@
delete mAppManager;
mAppManager = NULL;
mLog.clear();
+ testSharableFile->close();
+ delete testSharableFile;
+ testSharableFile = NULL;
}
void Test_XQApplicationManager::testRequest(XQAiwRequest* request, const QString &operation,
--- a/qthighway/tsrc/at_xqapplicationmanager/at_xqapplicationmanager.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/tsrc/at_xqapplicationmanager/at_xqapplicationmanager.h Thu Sep 02 21:20:48 2010 +0300
@@ -52,7 +52,6 @@
void create_file_implementation();
void create_sharablefile();
void create_sharablefile_implementation();
-
void cleanup();
@@ -69,6 +68,7 @@
XQApplicationManager *mAppManager;
QVariant returnValue;
bool mServiceAnswered;
+ XQSharableFile* testSharableFile;
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qthighway/tsrc/at_xqapplicationmanager/at_xqapplicationmanager.pro Thu Sep 02 21:20:48 2010 +0300
@@ -0,0 +1,43 @@
+#
+# 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:
+#
+
+TEMPLATE = app
+
+QT += testlib
+CONFIG += qtestlib
+
+HEADERS += at_xqapplicationmanager.h \
+ ../inc/testdata.h
+SOURCES += at_xqapplicationmanager.cpp
+
+#DEFINES += QT_NO_DEBUG_STREAM
+
+# capability
+TARGET.CAPABILITY = ALL -TCB
+
+drmfiles.sources += drmfiles/test.txt
+drmfiles.sources += drmfiles/111-test1.odf
+drmfiles.sources += drmfiles/one.jpg
+drmfiles.sources += drmfiles/RoAcqoffer-111-aac-i15m.ort
+drmfiles.sources += drmfiles/SD_Celebration_SP.dcf
+drmfiles.sources += drmfiles/SD_jpg_sun.dcf
+drmfiles.sources += drmfiles/STC1_128_44_16_2_CBR.wma
+
+drmfiles.path = c:/data/Others/
+
+DEPLOYMENT += drmfiles
+
+LIBS+= -lxqservice -lxqserviceutil
\ No newline at end of file
--- a/qthighway/tsrc/inc/testdata.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/tsrc/inc/testdata.h Thu Sep 02 21:20:48 2010 +0300
@@ -315,7 +315,7 @@
FileDrm drm;
drm[XQApplicationManager::IsProtected] = QVariant(1);
drm[XQApplicationManager::IsForwardable] = QVariant(1);
- drm[XQApplicationManager::Description] = QVariant();
+ drm[XQApplicationManager::Description] = QVariant(QString(""));
drm[XQApplicationManager::MimeType] = QVariant(QString("audio/x-ms-wma"));
files[QString(drive + ":\\data\\Others\\STC1_128_44_16_2_CBR.wma")] = drm;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qthighway/tsrc/test_services/service_1/service_1.pro Thu Sep 02 21:20:48 2010 +0300
@@ -0,0 +1,45 @@
+#
+# 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:
+#
+
+TEMPLATE = app
+TARGET = service_1
+
+symbian:TARGET.UID3 = 0xE42DF0E6
+
+CONFIG += service
+
+include(../src/test_services.pri)
+
+SOURCES += main.cpp
+
+HEADERS += ../../inc/testdata.h
+
+SERVICE.FILE = service_conf.xml
+SERVICE.OPTIONS = embeddable
+
+RSS_RULES += \
+ "datatype_list = " \
+ " {" \
+ " DATATYPE" \
+ " {" \
+ " priority = EDataTypePriorityNormal;" \
+ " type = \"text/plain\";" \
+ " }" \
+ " };" \
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/qthighway/tsrc/test_services/service_2/service_2.pro Thu Sep 02 21:20:48 2010 +0300
@@ -0,0 +1,45 @@
+#
+# 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:
+#
+
+TEMPLATE = app
+TARGET = service_2
+
+symbian:TARGET.UID3 = 0xED698FE0
+
+CONFIG += service
+
+include(../src/test_services.pri)
+
+SOURCES += main.cpp
+
+HEADERS += ../../inc/testdata.h
+
+SERVICE.FILE = service_conf.xml
+SERVICE.OPTIONS = embeddable
+
+RSS_RULES += \
+ "datatype_list = " \
+ " {" \
+ " DATATYPE" \
+ " {" \
+ " priority = EDataTypePriorityNormal;" \
+ " type = \"text/plain\";" \
+ " }" \
+ " };" \
\ No newline at end of file
--- a/qthighway/xqservice/src/xqaiwdecl.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqaiwdecl.h Thu Sep 02 21:20:48 2010 +0300
@@ -36,35 +36,85 @@
//
/*!
- File viewing interface and related operations
+ \file xqaiwdecl.h
+*/
+
+/*!
+ \def XQI_FILE_VIEW
+ File viewing interface.
+ \sa XQOP_FILE_VIEW, XQOP_FILE_VIEW_SHARABLE for related operations.
*/
+/*!
+ \def XQOP_FILE_VIEW
+ File viewing interface related operation.
+ \sa XQI_FILE_VIEW for interface definition.
+*/
+/*!
+ \def XQOP_FILE_VIEW_SHARABLE
+ File viewing interface and related operation.
+ \sa XQI_FILE_VIEW interface definition.
+*/
+
#define XQI_FILE_VIEW QLatin1String("com.nokia.symbian.IFileView")
#define XQOP_FILE_VIEW QLatin1String("view(QString)")
#define XQOP_FILE_VIEW_SHARABLE QLatin1String("view(XQSharableFile)")
/*!
- URI viewing interface and related operations
+ \def XQI_URI_VIEW
+ URI viewing interface.
+ \sa XQOP_URI_VIEW for related operation.
+*/
+/*!
+ \def XQOP_URI_VIEW
+ URI viewing interface related operations.
+ \sa XQI_URI_VIEW for interface definition.
*/
#define XQI_URI_VIEW QLatin1String("com.nokia.symbian.IUriView")
#define XQOP_URI_VIEW QLatin1String("view(QString)")
/*!
- File sharing interface and related operations
+ \def XQI_FILE_SHARE
+ File sharing interface.
+ \sa XQOP_FILE_SHARE for related operations.
+*/
+/*!
+ \def XQOP_FILE_SHARE
+ File sharing interface related operation.
+ \sa XQI_FILE_SHARE for interface definition.
*/
#define XQI_FILE_SHARE QLatin1String("com.nokia.symbian.IFileShare")
#define XQOP_FILE_SHARE QLatin1String("send(QVariant)")
/*!
- The scheme of the activity URI
+ \def XQURI_SCHEME_ACTIVITY
+ The scheme of the activity URI.
*/
#define XQURI_SCHEME_ACTIVITY QLatin1String("appto")
/*!
- Activity key name in query part of the activity URI
+ \def XQURI_KEY_ACTIVITY_NAME
+ Activity key name in query part of the activity URI.
*/
#define XQURI_KEY_ACTIVITY_NAME QLatin1String("activityname")
/*!
- Miscellaneous needed URI schemes
+ \def XQURI_SCHEME_HTTP
+ Miscellaneous needed URI scheme.
+ \sa XQURI_SCHEME_HTTPS, XQURI_SCHEME_MAILTO, XQURI_SCHEME_FILE for other URI schemes.
+*/
+/*!
+ \def XQURI_SCHEME_HTTPS
+ Miscellaneous needed URI scheme.
+ \sa XQURI_SCHEME_HTTP, XQURI_SCHEME_MAILTO, XQURI_SCHEME_FILE for other URI schemes.
+*/
+/*!
+ \def XQURI_SCHEME_MAILTO
+ Miscellaneous needed URI scheme.
+ \sa XQURI_SCHEME_HTTP, XQURI_SCHEME_HTTPS, XQURI_SCHEME_FILE for other URI schemes.
+*/
+/*!
+ \def XQURI_SCHEME_FILE
+ Miscellaneous needed URI scheme.
+ \sa XQURI_SCHEME_HTTP, XQURI_SCHEME_HTTPS, XQURI_SCHEME_MAILTO for other URI schemes.
*/
#define XQURI_SCHEME_HTTP QLatin1String("http")
#define XQURI_SCHEME_HTTPS QLatin1String("https")
@@ -73,42 +123,48 @@
/*!
- Service XML custom property, which contains the name of text resource file that
- contains the CUSTOM_PROP_AIW_TEXT.
- \see XQAiwRequest::createAction()
+ \def XQCUSTOM_PROP_AIW_TEXT_FILE
+ Service XML custom property, which contains the name of text resource file that
+ contains the CUSTOM_PROP_AIW_TEXT.
+ \sa XQAiwRequest::createAction()
*/
#define XQCUSTOM_PROP_AIW_TEXT_FILE QLatin1String("aiw_action_text_file")
/*!
- Service XML custom property, that contains the Text Id within the
- CUSTOM_PROP_AIW_TEXT_FILE. The localized text is attached to
- to QAction returned by the XQAiwRequest::createAction()
+ \def XQCUSTOM_PROP_AIW_TEXT
+ Service XML custom property, that contains the Text Id within the
+ CUSTOM_PROP_AIW_TEXT_FILE. The localized text is attached to
+ QAction returned by the XQAiwRequest::createAction().
*/
#define XQCUSTOM_PROP_AIW_TEXT QLatin1String("aiw_action_text")
/*!
- Service XML custom property, that contains the name of the icon to be attached
- to QAction returned by the XQAiwRequest::createAction()
+ \def XQCUSTOM_PROP_AIW_ICON
+ Service XML custom property, that contains the name of the icon to be attached
+ to QAction returned by the XQAiwRequest::createAction().
*/
#define XQCUSTOM_PROP_AIW_ICON QLatin1String("aiw_action_icon")
/*!
- Service XML custom property, that contains schemes the XQI_URI_VIEW can handle
+ \def XQCUSTOM_PROP_SCHEMES
+ Service XML custom property, that contains schemes the XQI_URI_VIEW can handle.
*/
#define XQCUSTOM_PROP_SCHEMES QLatin1String("schemes")
/*!
- Service XML custom property, which contains the name of text key that
- contains the service status
- \see XQApplicationMgr::isEnabled()
+ \def XQCUSTOM_PROP_AIW_SERVICE_STATUS
+ Service XML custom property, which contains the name of text key that
+ contains the service status.
+ \sa XQApplicationManager::status()
*/
#define XQCUSTOM_PROP_AIW_SERVICE_STATUS QLatin1String("aiw_status")
/*!
- A key name for XQRequestInfo object to pass a window title
- to be shown in service application instead of the default title.
- Service application is responsible to handle the key value.
- \see XQApplicationMgr::XQRequestInfo::setInfo()
+ \def XQINFO_KEY_WINDOW_TITLE
+ A key name for XQRequestInfo object to pass a window title
+ to be shown in service application instead of the default title.
+ Service application is responsible to handle the key value.
+ \sa XQRequestInfo::setInfo()
*/
#define XQINFO_KEY_WINDOW_TITLE QLatin1String("WindowTitle")
@@ -119,31 +175,77 @@
//
/*!
- Image fetching interface and related operations
+ \def XQI_IMAGE_FETCH
+ Image fetching interface.
+ \sa XQOP_IMAGE_FETCH for related operations.
+*/
+/*!
+ \def XQOP_IMAGE_FETCH
+ Image fetching interface related operation.
+ \sa XQI_IMAGE_FETCH interface definition.
*/
#define XQI_IMAGE_FETCH QLatin1String("com.nokia.symbian.IImageFetch")
#define XQOP_IMAGE_FETCH QLatin1String("fetch()")
/*!
- Music fetching interface and related operations
+ \def XQI_MUSIC_FETCH
+ Music fetching interface.
+ \sa XQOP_MUSIC_FETCH for related operations.
+*/
+/*!
+ \def XQOP_MUSIC_FETCH
+ Music fetching interface related operation.
+ \sa XQI_MUSIC_FETCH for interface definition.
*/
#define XQI_MUSIC_FETCH QLatin1String("com.nokia.symbian.IMusicFetch")
#define XQOP_MUSIC_FETCH QLatin1String("fetch()")
/*!
- Tones fetching interface and related operations
+ \def XQI_TONE_FETCH
+ Tones fetching interface.
+ \sa XQOP_TONE_FETCH for related operations.
+*/
+/*!
+ \def XQOP_TONE_FETCH
+ Tones fetching interface related operation.
+ \sa XQI_TONE_FETCH for interface definition.
*/
#define XQI_TONE_FETCH QLatin1String("com.nokia.symbian.IToneFetch")
#define XQOP_TONE_FETCH QLatin1String("fetch()")
/*!
- Video fetching interface and related operations
+ \def XQI_VIDEO_FETCH
+ Video fetching interface.
+ \sa XQOP_VIDEO_FETCH for related operations.
+*/
+/*!
+ \def XQOP_VIDEO_FETCH
+ Video fetching interface related operation.
+ \sa XQI_VIDEO_FETCH for interface definition.
*/
#define XQI_VIDEO_FETCH QLatin1String("com.nokia.symbian.IVideoFetch")
#define XQOP_VIDEO_FETCH QLatin1String("fetch()")
/*!
- Video collection browser interface and related operations
+ \enum XQService::VideoBrowseSortKey
+ Video collection browser sort parameter.
+ \sa XQOP_VIDEO_BROWSE for operation definition.
+*/
+/*!
+ \var XQService::VideoBrowseSortKey XQService::SortUndefined
+ Sort type undefined.
+*/
+/*!
+ \var XQService::VideoBrowseSortKey XQService::SortDateTime
+ Sort by date/time.
+*/
+/*!
+ \var XQService::VideoBrowseSortKey XQService::SortTitle
+ Sort by title.
+*/
+/*!
+ \var XQService::VideoBrowseSortKey XQService::SortSize
+ Sort by size.
*/
namespace XQService
{
@@ -155,11 +257,40 @@
SortSize = 3
};
}
+
+/*!
+ \def XQI_VIDEO_BROWSE
+ Video collection browser interface.
+ \sa XQOP_VIDEO_BROWSE for related operations.
+*/
+/*!
+ \def XQOP_VIDEO_BROWSE
+ Video collection browser interface related operation.
+ \sa XQI_VIDEO_BROWSE for interface definition.
+*/
#define XQI_VIDEO_BROWSE QLatin1String("com.nokia.symbian.IVideoBrowse")
#define XQOP_VIDEO_BROWSE QLatin1String("browseVideos(int, int)")
/*!
- Video player interface and related operations
+ \def XQI_VIDEO_PLAY
+ Video player interface.
+ \sa XQOP_VIDEO_PLAY, XQOP_VIDEO_PLAY_PD, XQOP_VIDEO_CLOSE
+ for related operations.
+*/
+/*!
+ \def XQOP_VIDEO_PLAY
+ Video player interface related operation.
+ \sa XQI_VIDEO_PLAY for interface definition.
+*/
+/*!
+ \def XQOP_VIDEO_PLAY_PD
+ Video player interface related operation.
+ \sa XQI_VIDEO_PLAY for interface definition.
+*/
+/*!
+ \def XQOP_VIDEO_CLOSE
+ Video player interface related operation.
+ \sa XQI_VIDEO_PLAY for interface definition.
*/
#define XQI_VIDEO_PLAY QLatin1String("com.nokia.symbian.IVideoView")
#define XQOP_VIDEO_PLAY QLatin1String("playMedia(QString)")
@@ -167,15 +298,47 @@
#define XQOP_VIDEO_CLOSE QLatin1String("closePlayer()")
/*!
- Camera capture interface and related operations
- Operation: capture(int mode, QVariantMap parameters)
- mode: image = 0, video = 1
- parameters:
- CameraIndex: int: primary = 0, secondary = 1
- Quality: int: 0 = default, 1 = lowest, 2 = highest
- AllowModeSwitch: bool
- AllowCamera_switch: bool
- allow_quality_change: bool
+ \def XQI_CAMERA_CAPTURE
+ Camera capture interface.
+ \sa XQOP_CAMERA_CAPTURE for related operations.
+*/
+/*!
+ \def XQOP_CAMERA_CAPTURE
+ Camera capture interface related operation.
+ \sa XQI_CAMERA_CAPTURE for interface definition, \n
+ XQCAMERA_INDEX, XQCAMERA_QUALITY, XQCAMERA_MODE_SWITCH,
+ XQCAMERA_INDEX_SWITCH, XQCAMERA_QUALITY_CHANGE for operation
+ parameters
+*/
+/*!
+ \def XQCAMERA_INDEX
+ XQOP_CAMERA_CAPTURE operation parameter.\n \b Values (int):
+ - 0 = primary
+ - 1 = secondary
+ \sa XQOP_CAMERA_CAPTURE for operation definition.
+*/
+/*!
+ \def XQCAMERA_QUALITY
+ XQOP_CAMERA_CAPTURE operation parameter.\n \b Values (int):
+ - 0 = default
+ - 1 = lowest
+ - 2 = highest
+ \sa XQOP_CAMERA_CAPTURE for operation definition.
+*/
+/*!
+ \def XQCAMERA_MODE_SWITCH
+ XQOP_CAMERA_CAPTURE operation parameter.\n \b Values (bool)
+ \sa XQOP_CAMERA_CAPTURE for operation definition.
+*/
+/*!
+ \def XQCAMERA_INDEX_SWITCH
+ XQOP_CAMERA_CAPTURE operation parameter.\n \b Values (bool)
+ \sa XQOP_CAMERA_CAPTURE for operation definition.
+*/
+/*!
+ \def XQCAMERA_QUALITY_CHANGE
+ XQOP_CAMERA_CAPTURE operation parameter.\n \b Values (bool)
+ \sa XQOP_CAMERA_CAPTURE for operation definition.
*/
#define XQI_CAMERA_CAPTURE QLatin1String("com.nokia.symbian.ICameraCapture")
#define XQOP_CAMERA_CAPTURE QLatin1String("capture(int,QVariantMap)")
@@ -192,12 +355,25 @@
//
/*!
- Logs view interface and related operations constants
- Operation: XQOP_LOGS_SHOW (show(QVariantMap))
- parameters:
- XQLOGS_VIEW_INDEX: enum LogsViewIndex: 0 - all recent, 1 - received, 2 - called, 3 - missed
- XQLOGS_SHOW_DIALPAD: bool
- XQLOGS_DIALPAD_TEXT: QString
+ \enum XQService::LogsViewIndex
+ XQLOGS_VIEW_INDEX parameter values.
+ \sa XQOP_LOGS_SHOW for operation definition.
+*/
+/*!
+ \var XQService::LogsViewIndex XQService::LogsViewAll
+ All recent.
+*/
+/*!
+ \var XQService::LogsViewIndex XQService::LogsViewReceived
+ Received.
+*/
+/*!
+ \var XQService::LogsViewIndex XQService::LogsViewCalled
+ Called.
+*/
+/*!
+ \var XQService::LogsViewIndex XQService::LogsViewMissed
+ Missed.
*/
namespace XQService
{
@@ -209,6 +385,37 @@
LogsViewMissed
};
}
+
+/*!
+ \def XQI_LOGS_VIEW
+ Logs view interface.
+ \sa XQOP_LOGS_SHOW for related operations.
+*/
+/*!
+ \def XQOP_LOGS_SHOW
+ Logs view interface related operation.
+ \sa XQI_LOGS_VIEW for interface definition, \n
+ XQLOGS_VIEW_INDEX, XQLOGS_SHOW_DIALPAD, XQLOGS_DIALPAD_TEXT
+ for operation parameters.
+*/
+/*!
+ \def XQLOGS_VIEW_INDEX
+ XQOP_LOGS_SHOW operation parameter. \n
+ \b Values (XQService::LogsViewIndex)
+ \sa XQOP_LOGS_SHOW for operation definition.
+*/
+/*!
+ \def XQLOGS_SHOW_DIALPAD
+ XQOP_LOGS_SHOW operation parameter. \n
+ \b Values (bool)
+ \sa XQOP_LOGS_SHOW for operation definition.
+*/
+/*!
+ \def XQLOGS_DIALPAD_TEXT
+ XQOP_LOGS_SHOW operation parameter. \n
+ \b Values (QString)
+ \sa XQOP_LOGS_SHOW for operation definition.
+*/
#define XQI_LOGS_VIEW QLatin1String("com.nokia.symbian.ILogsView")
#define XQOP_LOGS_SHOW QLatin1String("show(QVariantMap)")
#define XQLOGS_VIEW_INDEX QLatin1String("ViewIndex")
@@ -221,169 +428,216 @@
//
/*!
- Contact editing interface.
+ \def XQI_CONTACTS_EDIT
+ Contacts related Application Interworking declaration.
+ \sa XQOP_CONTACTS_EDIT_CREATE_NEW, XQOP_CONTACTS_EDIT_CREATE_NEW_WITH_SUBTYPE, XQOP_CONTACTS_EDIT_CREATE_NEW_VCARD,
+ XQOP_CONTACTS_EDIT_EXISTING, XQOP_CONTACTS_EDIT_UPDATE_EXISTING, XQOP_CONTACTS_EDIT_UPDATE_EXISTING_WITH_SUBTYPE for related operations.
+*/
+/*!
+ \def XQOP_CONTACTS_EDIT_CREATE_NEW
+ Launches editor for creating a new contact with a given detail.
+ \param Parameter1 (QString) Indicates what type of contact field is supplied.
+ One of the following values (you need to include qcontactdetails.h):
+ - QContactPhoneNumber::DefinitionName
+ - QContactEmailAddress::DefinitionName
+ - QContactOnlineAccount::DefinitionName
+ \param Parameter2 (QString) The actual detail value, for eg. "123456"
+ \return One of these constants defined in cntservicescontact.h:
+ - KCntServicesReturnValueContactSaved
+ - KCntServicesReturnValueContactDeleted
+ - KCntServicesReturnValueContactNotModified
+ \sa XQI_CONTACTS_EDIT for interface definition
+*/
+/*!
+ \def XQOP_CONTACTS_EDIT_CREATE_NEW_WITH_SUBTYPE
+ Launches editor for creating a new contact with a given detail.
+ \param Parameter1 (QString) Indicates what type of contact field is supplied.
+ One of the following values (you need to include qcontactdetails.h):
+ - QContactPhoneNumber::DefinitionName
+ - QContactEmailAddress::DefinitionName
+ - QContactOnlineAccount::DefinitionName
+ \param Parameter2 (QString) The actual detail value, for eg. "123456"
+ \param Parameter3 (QString) sub type, for eg. QContactPhoneNumber::SubTypeMobile
+ \return One of these constants defined in cntservicescontact.h:
+ - KCntServicesReturnValueContactSaved
+ - KCntServicesReturnValueContactDeleted
+ - KCntServicesReturnValueContactNotModified
+ \sa XQI_CONTACTS_EDIT for interface definition
+*/
+/*!
+ \def XQOP_CONTACTS_EDIT_CREATE_NEW_VCARD
+ Launches editor for creating a new contact based on vCard indicated in arg.
+ The user is able to edit and save the contact.
+ \param Parameter1 (QString) vCard file name including the full path.
+ \return One of these constants defined in cntservicescontact.h:
+ - KCntServicesReturnValueContactSaved
+ - KCntServicesReturnValueContactDeleted
+ - KCntServicesReturnValueContactNotModified
+ \sa XQI_CONTACTS_EDIT for interface definition
+*/
+/*!
+ \def XQOP_CONTACTS_EDIT_EXISTING
+ Launch editor for existing contact that is specified with contact ID.
+ Only the default backend storage is supported.
+ \param Parameter1 (int) Contact ID.
+ \return One of these constants defined in cntservicescontact.h:
+ - KCntServicesReturnValueContactSaved
+ - KCntServicesReturnValueContactDeleted
+ - KCntServicesReturnValueContactNotModified
+ \sa XQI_CONTACTS_EDIT for interface definition
+*/
+/*!
+ \def XQOP_CONTACTS_EDIT_UPDATE_EXISTING
+ Launch editor for updating an existing contact with a given detail.
+ A contact fetch view is opened first, where the user can choose which contact
+ to update.
+ \param Parameter1 (QString) Indicates what type of contact field is supplied.
+ One of the following values (you need to include qcontactdetails.h):
+ - QContactPhoneNumber::DefinitionName
+ - QContactEmailAddress::DefinitionName
+ - QContactOnlineAccount::DefinitionName
+ \param Parameter2 (QString) The actual detail value, for eg. "123456"
+ \return One of these constants defined in cntservicescontact.h:
+ - KCntServicesReturnValueContactSaved
+ - KCntServicesReturnValueContactDeleted
+ - KCntServicesReturnValueContactNotModified
+ \sa XQI_CONTACTS_EDIT for interface definition
+*/
+/*!
+ \def XQOP_CONTACTS_EDIT_UPDATE_EXISTING_WITH_SUBTYPE
+ Launch editor for updating an existing contact with a given detail.
+ Becomes available in wk30.
+ A contact fetch view is opened first, where the user can choose which contact
+ to update.
+ \param Parameter1 (QString) Indicates what type of contact field is supplied.
+ One of the following values (you need to include qcontactdetails.h):
+ - QContactPhoneNumber::DefinitionName
+ - QContactEmailAddress::DefinitionName
+ - QContactOnlineAccount::DefinitionName
+ \param Parameter2 (QString) The actual detail value, for eg. "123456"
+ \param Parameter3 (QString) Sub type
+ \return One of these constants defined in cntservicescontact.h:
+ - KCntServicesReturnValueContactSaved
+ - KCntServicesReturnValueContactDeleted
+ - KCntServicesReturnValueContactNotModified
+ \sa XQI_CONTACTS_EDIT for interface definition
*/
#define XQI_CONTACTS_EDIT QLatin1String("com.nokia.symbian.IContactsEdit")
-
-/*!
- Launches editor for creating a new contact with a given detail.
- Parameter1: Indicates what type of contact field is supplied.
- One of the following values:
- QContactPhoneNumber::DefinitionName
- QContactEmailAddress::DefinitionName
- QContactOnlineAccount::DefinitionName
- (you need to include qcontactdetails.h)
- Parameter2: The actual detail value, for eg. "123456"
- \return One of these constants defined in cntservicescontact.h:
- KCntServicesReturnValueContactSaved
- KCntServicesReturnValueContactDeleted
- KCntServicesReturnValueContactNotModified
- */
#define XQOP_CONTACTS_EDIT_CREATE_NEW QLatin1String("editCreateNew(QString,QString)")
-
-/*!
- Launches editor for creating a new contact with a given detail.
- Becomes available in wk30.
- Parameter1: Indicates what type of contact field is supplied.
- One of the following values:
- QContactPhoneNumber::DefinitionName
- QContactEmailAddress::DefinitionName
- QContactOnlineAccount::DefinitionName
- (you need to include qcontactdetails.h)
- Parameter2: The actual detail value, for eg. "123456"
- Parameter3: sub type, for eg. QContactPhoneNumber::SubTypeMobile
- \return One of these constants defined in cntservicescontact.h:
- KCntServicesReturnValueContactSaved
- KCntServicesReturnValueContactDeleted
- KCntServicesReturnValueContactNotModified
- */
#define XQOP_CONTACTS_EDIT_CREATE_NEW_WITH_SUBTYPE QLatin1String("editCreateNew(QString,QString,QString)")
+#define XQOP_CONTACTS_EDIT_CREATE_NEW_VCARD QLatin1String("editCreateNewFromVCard(QString)")
+#define XQOP_CONTACTS_EDIT_EXISTING QLatin1String("editExisting(int)")
+#define XQOP_CONTACTS_EDIT_UPDATE_EXISTING QLatin1String("editUpdateExisting(QString,QString)")
+#define XQOP_CONTACTS_EDIT_UPDATE_EXISTING_WITH_SUBTYPE QLatin1String("editUpdateExisting(QString,QString,QString)")
/*!
- Launches editor for creating a new contact based on vCard indicated in arg.
- The user is able to edit and save the contact.
- Parameter1: vCard file name including the full path.
- \return One of these constants defined in cntservicescontact.h:
- KCntServicesReturnValueContactSaved
- KCntServicesReturnValueContactDeleted
- KCntServicesReturnValueContactNotModified
- */
-#define XQOP_CONTACTS_EDIT_CREATE_NEW_VCARD QLatin1String("editCreateNewFromVCard(QString)")
-
+ \def XQI_CONTACTS_FETCH
+ Contacts related Application Interworking declaration.
+ \sa XQOP_CONTACTS_FETCH_MULTIPLE, XQOP_CONTACTS_FETCH_SINGLE for related operations.
+*/
/*!
- Launch editor for existing contact that is specified with contact ID.
- Only the default backend storage is supported.
-Parameter1: Contact ID.
- \return One of these constants defined in cntservicescontact.h:
- KCntServicesReturnValueContactSaved
- KCntServicesReturnValueContactDeleted
- KCntServicesReturnValueContactNotModified
- */
-#define XQOP_CONTACTS_EDIT_EXISTING QLatin1String("editExisting(int)")
-
-/*!
- Launch editor for updating an existing contact with a given detail.
- A contact fetch view is opened first, where the user can choose which contact
- to update.
- Parameter1: Indicates what type of contact field is supplied.
- One of the following values:
- QContactPhoneNumber::DefinitionName
- QContactEmailAddress::DefinitionName
- QContactOnlineAccount::DefinitionName
- (you need to include qcontactdetails.h)
- Parameter2: The actual detail value, for eg. "123456"
- \return One of these constants defined in cntservicescontact.h:
- KCntServicesReturnValueContactSaved
- KCntServicesReturnValueContactDeleted
- KCntServicesReturnValueContactNotModified
- */
-#define XQOP_CONTACTS_EDIT_UPDATE_EXISTING QLatin1String("editUpdateExisting(QString,QString)")
+ \def XQOP_CONTACTS_FETCH_MULTIPLE
+ Fetch multiple contacts. cntservicescontact.h has some constant definitions
+ and a class for transforming the result.
+ \param Parameter1 (QString) Title string.
+ \param Parameter2 (QString) Action type string, from cntservicescontact.h
+ \return An object of type CntServicesContactList containing the contact ID.
+ \sa XQI_CONTACTS_FETCH for interface definition.
+*/
+ /*!
+ \def XQOP_CONTACTS_FETCH_SINGLE
+ Fetch single contact. cntservicescontact.h has some constant definitions
+ and a class for transforming the result.
+ \param Parameter1 (QString) Title string.
+ \param Parameter2 (QString) Action type string, from cntservicescontact.h
+ \return An object of type CntServicesContactList containing the contact ID.
+ \sa XQI_CONTACTS_FETCH for interface definition.
+*/
+#define XQI_CONTACTS_FETCH QLatin1String("com.nokia.symbian.IContactsFetch")
+#define XQOP_CONTACTS_FETCH_MULTIPLE QLatin1String("multiFetch(QString,QString)")
+#define XQOP_CONTACTS_FETCH_SINGLE QLatin1String("singleFetch(QString,QString)")
/*!
- Launch editor for updating an existing contact with a given detail.
- Becomes available in wk30.
- A contact fetch view is opened first, where the user can choose which contact
- to update.
- Parameter1: Indicates what type of contact field is supplied.
- One of the following values:
- QContactPhoneNumber::DefinitionName
- QContactEmailAddress::DefinitionName
- QContactOnlineAccount::DefinitionName
- (you need to include qcontactdetails.h)
- Parameter2: The actual detail value, for eg. "123456"
- \return One of these constants defined in cntservicescontact.h:
- KCntServicesReturnValueContactSaved
- KCntServicesReturnValueContactDeleted
- KCntServicesReturnValueContactNotModified
- */
-#define XQOP_CONTACTS_EDIT_UPDATE_EXISTING_WITH_SUBTYPE QLatin1String("editUpdateExisting(QString,QString,QString)")
-
+ \def XQI_CONTACTS_VIEW
+ Contacts related Application Interworking declaration.
+ \sa XQOP_CONTACTS_VIEW_CONTACT_CARD, XQOP_CONTACTS_VIEW_TEMP_CONTACT_CARD_WITH_DETAIL,
+ XQOP_CONTACTS_VIEW_GROUP for related operations.
+*/
/*!
- Contacts fetching interface.
- */
-#define XQI_CONTACTS_FETCH QLatin1String("com.nokia.symbian.IContactsFetch")
-
-/*!
- Fetch multiple contacts
- cntservicescontact.h has some constant definitions and a class for
- transforming the result.
- Parameter1: Title string.
- Parameter2: Action type string, from cntservicescontact.h
- \return An object of type CntServicesContactList containing the contact ID.
- */
-#define XQOP_CONTACTS_FETCH_MULTIPLE QLatin1String("multiFetch(QString,QString)")
-
+ \def XQOP_CONTACTS_VIEW_CONTACT_CARD
+ Opens contact card.
+ \param Parameter1 (int) Contact ID.
+ \sa XQI_CONTACTS_VIEW for interface definition.
+*/
/*!
- Fetch multiple contacts
- cntservicescontact.h has some constant definitions and a class for
- transforming the result.
- Parameter1: Title string.
- Parameter2: Action type string, from cntservicescontact.h
- \return An object of type CntServicesContactList containing the contact ID.
- */
-#define XQOP_CONTACTS_FETCH_SINGLE QLatin1String("singleFetch(QString,QString)")
-
-/*!
- Contacts viewing interface.
- */
-#define XQI_CONTACTS_VIEW QLatin1String("com.nokia.symbian.IContactsView")
-
-/*!
- Opens contact card.
- Parameter1: Contact ID.
- */
-#define XQOP_CONTACTS_VIEW_CONTACT_CARD QLatin1String("openContactCard(int)")
-
+ \def XQOP_CONTACTS_VIEW_TEMP_CONTACT_CARD_WITH_DETAIL
+ Open contact card for in-memory contact which is not saved yet.
+ In the UI there is an option to save the contact either by updating an
+ existing contact or by creating a new one.
+ \param Parameter1 (QString) Indicates what type of contact field is supplied.
+ One of the following values (you need to include qcontactdetails.h):
+ - QContactPhoneNumber::DefinitionName
+ - QContactEmailAddress::DefinitionName
+ - QContactOnlineAccount::DefinitionName
+ \param Parameter2 (QString) The actual detail value, for eg. "123456"
+ \sa XQI_CONTACTS_VIEW for interface definition.
+*/
/*!
- Open contact card for in-memory contact which is not saved yet.
- In the UI there is an option to save the contact either by updating an
- existing contact or by creating a new one.
-
- Parameter1: Indicates what type of contact field is supplied.
- One of the following values:
- QContactPhoneNumber::DefinitionName
- QContactEmailAddress::DefinitionName
- QContactOnlineAccount::DefinitionName
- (you need to include qcontactdetails.h)
- Parameter2: The actual detail value, for eg. "123456"
- */
+ \def XQOP_CONTACTS_VIEW_GROUP
+ Open the group members view.
+ On the flip side of the group members view, there is the "group action" view.
+ \param Parameter1 (int) The group ID (native ID).
+ Only groups in the main Qt Mobility backend are supported.
+ \sa XQI_CONTACTS_VIEW for interface definition.
+*/
+#define XQI_CONTACTS_VIEW QLatin1String("com.nokia.symbian.IContactsView")
+#define XQOP_CONTACTS_VIEW_CONTACT_CARD QLatin1String("openContactCard(int)")
#define XQOP_CONTACTS_VIEW_TEMP_CONTACT_CARD_WITH_DETAIL QLatin1String("openTemporaryContactCard(QString,QString)")
-
-/*!
- Open the group members view.
- On the flip side of the group members view, there is the "group action" view.
- Parameter: The group ID. (native ID)
- Only groups in the main Qt Mobility backend are supported.
-*/
#define XQOP_CONTACTS_VIEW_GROUP QLatin1String("openGroup(int)")
//
// Messaging related Application Interworking declarations
// ------------------------------------------------------
//
+
+/*!
+ \def XQI_MESSAGE_SEND
+ Messaging related Application Interworking declaration.
+ \sa XQOP_MESSAGE_SEND, XQOP_MESSAGE_SEND_WITH_ID, XQOP_MESSAGE_SEND_WITH_ALIAS for related operations.
+*/
+/*!
+ \def XQOP_MESSAGE_SEND
+ Messaging related Application Interworking interface related operation.
+ \sa XQI_MESSAGE_SEND for interface definition.
+*/
+/*!
+ \def XQOP_MESSAGE_SEND_WITH_ID
+ Messaging related Application Interworking interface related operation.
+ \sa XQI_MESSAGE_SEND for interface definition.
+*/
+/*!
+ \def XQOP_MESSAGE_SEND_WITH_ALIAS
+ Messaging related Application Interworking interface related operation.
+ \sa XQI_MESSAGE_SEND for interface definition.
+*/
#define XQI_MESSAGE_SEND QLatin1String("com.nokia.symbian.IMessageSend")
+#define XQOP_MESSAGE_SEND QLatin1String("send(QVariantMap,QString)")
+#define XQOP_MESSAGE_SEND_WITH_ID QLatin1String("send(QString,qint32,QString)")
+#define XQOP_MESSAGE_SEND_WITH_ALIAS QLatin1String("send(QString,QString,QString)")
+/*!
+ \def XQI_MESSAGE_VIEW
+ Messaging related Application Interworking declaration.
+ \sa XQOP_MESSAGE_VIEW for related operations.
+*/
+/*!
+ \def XQOP_MESSAGE_VIEW
+ Messaging related Application Interworking interface related operation.
+ \sa XQI_MESSAGE_VIEW for interface definition.
+*/
+#define XQI_MESSAGE_VIEW QLatin1String("com.nokia.symbian.IMessageView")
+#define XQOP_MESSAGE_VIEW QLatin1String("view(int)")
/*!
Incomplete list of interfaces.
--- a/qthighway/xqservice/src/xqaiwdeclplat.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqaiwdeclplat.h Thu Sep 02 21:20:48 2010 +0300
@@ -49,7 +49,7 @@
the WLAN Sniffer list view.
*/
#define XQI_WLAN_SNIFFER QLatin1String("com.nokia.symbian.IWlanSniffer")
-#define XQOP_WLAN_SNIFFER QLatin1String("listView(void)")
+#define XQOP_WLAN_SNIFFER QLatin1String("listView()")
/*!
WLAN Login interface and operations for
@@ -57,7 +57,7 @@
*/
#define XQI_WLAN_LOGIN QLatin1String("com.nokia.symbian.IWlanLogin")
#define XQOP1_WLAN_LOGIN QLatin1String("start(int,int,QUrl)")
-#define XQOP2_WLAN_LOGIN QLatin1String("stop(void)")
+#define XQOP2_WLAN_LOGIN QLatin1String("stop()")
/*!
Incomplete list of interfaces.
--- a/qthighway/xqservice/src/xqaiwrequest.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqaiwrequest.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -28,6 +28,132 @@
#include "xqaiwuridriver.h"
#include "xqaiwrequest.h"
+/*!
+ \class XQAiwRequest
+ \inpublicgroup QtBaseModule
+
+ \ingroup ipc
+ \brief Encapsulates the core functionality of the interworking requests
+
+ The XQAiwRequest class encapsulates the core functionality of the interworking requests and hides the implementation details.
+ This object is created by the XQApplicationManager::create factory method.
+
+ This class is a part of API to be used by the applications instead of using XQServiceRequest directly.
+
+ The Application Manager API offers centric place for applications UIs to handle application to application interworking use cases, like:
+ - Synchronous out-of-process service call from client to service provider, where service provider needs to complete the request before
+ control comes back to requesting client.
+ - Asynchronous out-of-process service call from client to service provider, where Service provider completes the request whenever suitable.
+ The control returns back requesting as soon the service provider has received the asynchronous call (can be applied to notifications as well).
+ - Embedded out-of-process service call. In this case window groups are chained and "Back" returns to client window.
+ - Any named Qt type in the Qt meta-object system can be used as a service call parameter or return value. Also own, custom meta-types are supported.
+ - Launched service provider application (.exe) if not already running when client makes service call to it.
+ - List and discover services dynamically.
+ - Apply UI related options upon service launch, like "launch as embedded", "launch to foreground" and "launch to backround".
+ - Opening files to be viewed by a file viewing interface.
+ - Opening URI to be viewed by a URI viewing interface. Includes also launching activity URIs (appto) as fire-and-forget manner.
+ - Miscellanous AIW support, like get service stasus or get DRM attributes.
+
+ See the "examples/appmgrclient" included in the QtHighway release for usage examples.
+
+ <b>Example usage:</b> \n
+ The usage pattern for all the XQAiwRequest variants implemented as service providers , interface, QUrl, QFile, is similar both embedded
+ and non-embedded usage.
+ \code
+ // Recommended way is to add XQApplicationManager as member variable to class
+ // Later on when caching of services
+ // You can use the class also as local variable.
+ class Client
+ {
+
+ public:
+ // Service access
+ bool accessService(void);
+
+ private slots:
+ void handleOk(const QVariant &result);
+ void handleError(int errorCode, const QString& errorMessage);
+ private:
+ XQApplicationManager mAiwMgr;
+ };
+
+
+ // In client.cpp
+ bool Client::accessService(void)
+ {
+ QString parameter1("+3581234567890");
+ int parameter2 = 3;
+
+ bool embedded=true; // or false
+
+ XQAiwRequest *request;
+ // Create request by interface name, the very first service implementation
+ // applied.
+ request = mAiwMgr.create("Interface", "functionName2(QString, int)", embedded);
+
+ // If dedicated service is wanted, apply this
+ // request = mAiwMgr.create("Service", "Interface",
+ // "functionName2(QString, int)", embedded);
+
+ if (request == NULL)
+ {
+ // Service not found
+ return false;
+ }
+
+ // Connect result handling signal
+ connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+ // Connect error handling signal or apply lastError function instead.
+ connect(request, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&)));
+
+ // Set function parameters
+ QList<QVariant> args;
+ args << parameter1;
+ args << parameter2;
+ request->setArguments(args);
+
+ // In this example, request embedded launch (window groups chained)
+ request->setEmbedded(true);
+
+ // Send the request
+ bool res = request.send();
+ if (!res)
+ {
+ // Request failed.
+ return false;
+ }
+
+ // If making multiple requests to same service, you can save the request as member variable
+ // In this example all done.
+ delete request;
+ return true;
+ }
+
+ void Client::handleOk(const QVariant& result)
+ {
+ // Handle result here or just save them.
+ // Result could be a service specific error code also.
+ //
+ }
+
+ void Client::handleError(int errorCode, const QString& errorMessage)
+ {
+ // Handle error
+ }
+ \endcode
+
+ \sa XQApplicationManager
+*/
+
+/*!
+ Constructs interworking request to service application by the given interface \a descriptor
+ which points to the dedicated implementation. The service application is not started during
+ creation of the request.
+ \param descriptor Points to the dedicated service implementation. Obtained via the XQApplicationManager::list function.
+ \param operation Service function to be called, equals \a message parameter in XQServiceRequest.
+ \param embedded True if window groups should be chained, false otherwise
+ \return Constructed interworking request to service application object.
+*/
XQAiwRequest::XQAiwRequest(const XQAiwInterfaceDescriptor& descriptor, const QString &operation, bool embedded)
: QObject(),
currentRequest(NULL),
@@ -52,6 +178,15 @@
}
}
+/*!
+ Constructs interworking request to service application by the given uri and the interface \a descriptor
+ which points to the dedicated implementation. The service application is not started during
+ creation of the request.
+ \param uri Uri for the given interworking request to service application.
+ \param descriptor Points to the dedicated service implementation. Obtained via the XQApplicationManager::list function.
+ \param operation Service function to be called, equals \a message parameter in XQServiceRequest.
+ \return Constructed interworking request to service application object.
+*/
XQAiwRequest::XQAiwRequest(
const QUrl &uri, const XQAiwInterfaceDescriptor& descriptor, const QString &operation)
: QObject(),
@@ -80,7 +215,15 @@
}
-
+/*!
+ Constructs interworking request to service application by the file and the interface \a descriptor
+ which points to the dedicated implementation. The service application is not started during
+ creation of the request.
+ \param file File for the given interworking request to service application.
+ \param descriptor Points to the dedicated service implementation. Obtained via the XQApplicationManager::list function.
+ \param operation Service function to be called, equals \a message parameter in XQServiceRequest.
+ \return Constructed interworking request to service application object.
+*/
XQAiwRequest::XQAiwRequest(
const QFile &file, const XQAiwInterfaceDescriptor& descriptor, const QString &operation)
: QObject(),
@@ -112,7 +255,15 @@
}
-
+/*!
+ Constructs interworking request to service application by the sharable file and the interface \a descriptor
+ which points to the dedicated implementation. The service application is not started during
+ creation of the request.
+ \param file Sharable file for the given interworking request to service application.
+ \param descriptor Points to the dedicated service implementation. Obtained via the XQApplicationManager::list function.
+ \param operation Service function to be called, equals \a message parameter in XQServiceRequest.
+ \return Constructed interworking request to service application object.
+*/
XQAiwRequest::XQAiwRequest(
const XQSharableFile &file, const XQAiwInterfaceDescriptor& descriptor, const QString &operation)
: QObject(),
@@ -143,7 +294,7 @@
}
-
+
XQAiwRequest::~XQAiwRequest()
{
XQSERVICE_DEBUG_PRINT("~XQAiwRequest::XQAiwRequest");
@@ -169,7 +320,7 @@
/*!
Create a QAction related to request from the registration data. Caller can
add the action to wanted UI widget. When the action is triggered the XQAiwRequest
- emits "triggered" signal for caller.
+ emits triggered() signal for caller.
The XQAiwRequest owns the action (caller shall not delete the action object).
\return QAction object, if there was action attached to request. Otherwise 0.
*/
@@ -193,8 +344,10 @@
/*!
Set arguments for the request. This shall be called before sending
add the action to wanted UI widget. For the attached action, the
- "triggered" signal emitted by the request is the last chance to
+ triggered() signal emitted by the request is the last chance to
add aguments.
+ \param arguments List of arguments that will be transferred to service provider function
+ to be called
*/
void XQAiwRequest::setArguments(const QList<QVariant> &arguments)
{
@@ -206,13 +359,17 @@
/*!
Returns the last error code occured.
IPC errors:
- EConnectionError = -5000, (Server might be busy)
- EConnectionClosed = -4999,
- EServerNotFound = -4998,
- EIPCError = -4997,
- EUnknownError = -4996,
- ERequestPending = -4995 (already pending request exists)
- EM = -4995 (already pending request exists)
+ - ENoError = 0
+ - EConnectionError = -5000, (Server might be busy)
+ - EConnectionClosed = -4999,
+ - EServerNotFound = -4998,
+ - EIPCError = -4997,
+ - EUnknownError = -4996,
+ - ERequestPending = -4995, (already pending request exists)
+ - EMessageNotFound = -4994,
+ - EArgumentError = -4993
+ \return Error code as integer value.
+ \sa xqserviceglobal.h for error codes
*/
int XQAiwRequest::lastError() const
@@ -226,6 +383,7 @@
Returns the last error as text for debugging purposes.
The content and details of the text may vary over API
development time evolution.
+ \return Error code as QString value.
*/
const QString& XQAiwRequest::lastErrorMessage() const
{
@@ -237,6 +395,7 @@
/*!
Returns the implementation descriptor of a service attached to request.
Caller can check meta-data information of the request.
+ \return Implementation descriptor attached to the request.
*/
const XQAiwInterfaceDescriptor &XQAiwRequest::descriptor() const
{
@@ -245,9 +404,11 @@
}
/*!
- Send request on-ward.
- The results are delivered via "requestOk" and "requestError" signals.
- \return true on success, false otherwise
+ Starts the service application if necessary and sends request on-ward.
+ The results are delivered via requestOk() and requestError() signals.
+ If the request is synchronous, the client application is blocked until
+ service provider completes the request.
+ \return True on success, false otherwise
*/
bool XQAiwRequest::send()
{
@@ -275,7 +436,7 @@
/*!
Convinience method for sending a synchronous request on-ward.
The returnValue delivered via the output parameter.
- \return true on success, false otherwise
+ \return True on success, false otherwise
*/
bool XQAiwRequest::send(QVariant &returnValue)
{
@@ -302,60 +463,111 @@
}
-
+/*!
+ Request service application to be launched in embedded mode.
+ \param embedded If set to true, service application will be launched
+ in embedded mode
+*/
void XQAiwRequest::setEmbedded(bool embedded)
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::setEmbedded=%d",embedded);
currentRequest->setEmbedded(embedded);
}
+
+/*!
+ Get the value of embedded option of the request.
+ \return True if request is set to launch service application in embedded
+ mode, false otherwise
+*/
bool XQAiwRequest::isEmbedded() const
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::isEmbedded");
return currentRequest->isEmbedded();
}
+/*!
+ Sets service operation. The XQApplicationManager::create() functions for
+ files and URLs set the default operation, but it can be overriden using
+ this function.
+ \param operation Operation to be set to the request.
+*/
void XQAiwRequest::setOperation(const QString &operation)
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::setOperation");
currentRequest->setOperation(operation);
}
+/*!
+ Returns operation attached to the request.
+ \return Operation attached to the request
+*/
const QString &XQAiwRequest::operation() const
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::operation");
return currentRequest->operation();
}
-
+/*!
+ Sets request as synchronous or asynchronous, based on the \a synchronous value.
+ \param synchronous If set to true, request will be synchronous.
+ If set to false, request will be asynchronous
+*/
void XQAiwRequest::setSynchronous(bool synchronous)
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::setSynchronous=%d", synchronous);
currentRequest->setSynchronous(synchronous);
}
+
+/*!
+ Returns the value of the synchronous option.
+ \return True if request is synchronous, false otherwise
+*/
bool XQAiwRequest::isSynchronous() const
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::isSynchronous");
return currentRequest->isSynchronous();
}
+/*!
+ Requests service application to be launched to background initially,
+ or if already running, to go to background.
+ \param background If set to true, service application will be launched
+ to background
+*/
void XQAiwRequest::setBackground(bool background )
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::setbackground=%d", background);
currentRequest->setBackground(background);
}
+/*!
+ Returns the value of the background option.
+ \return True if request is set to launch service
+ application to background
+*/
bool XQAiwRequest::isBackground() const
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::isBackground");
return currentRequest->isBackground();
}
+/*!
+ Used to set additional UI behavior type options to the request.
+ Embedded and background options are handled by their own functions.
+ This function should not be used to implement additional data
+ parameters for operations!
+ \param info UI bahavior type option to be set to the request.
+*/
void XQAiwRequest::setInfo(const XQRequestInfo &info)
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::setInfo");
return currentRequest->setInfo(info);
}
+/*!
+ Returns additional options attached to the request.
+ \return Additional options attached to the request.
+*/
XQRequestInfo XQAiwRequest::info() const
{
XQSERVICE_DEBUG_PRINT("XQAiwRequest::info");
--- a/qthighway/xqservice/src/xqaiwrequest.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqaiwrequest.h Thu Sep 02 21:20:48 2010 +0300
@@ -86,8 +86,32 @@
signals:
+/*!
+ Emitted when the QAction attached to request has been triggered.
+ Upon this signal is the latest time to call
+ setArguments(const QList<QVariant> &arguments) if not done earlier.
+*/
void triggered();
+
+/*!
+ This signal is emitted when interworking request has been successfully
+ executed (synchronous or asynchronous). That is, the service has returned
+ data back according to the slot spec. The return value may be real data
+ or indicate an service specific error.
+ \param result Result of the executed request
+*/
void requestOk(const QVariant& result);
+
+/*!
+ This signal is emitted when an error has happened in interworking request
+ handling. That is, e.g. the required slot could not be called or connection
+ to server is lost. If the service itself return service specific errors,
+ those should be returned as successfull return value of the slot
+ (requestOk(const QVariant& result)).
+ \param errorCode Error code as integer value
+ \param errorMessage Contains needed R&D specific data that will be added to support error debugging
+ \sa xqserviceglobal.h for error codes.
+*/
void requestError(int errorCode, const QString& errorMessage);
protected:
--- a/qthighway/xqservice/src/xqappmgr.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqappmgr.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -26,6 +26,139 @@
#include <QList>
#include "xqappmgr_p.h"
+/*!
+ \class XQApplicationManager
+ \inpublicgroup QtBaseModule
+
+ \ingroup ipc
+ \brief Factory class to list interface descriptors and create interworking objects (XQAiwRequest)
+
+ XQApplicationManager lists interface descriptors by interface and /or service name. It is also used to
+ create interworking objects (XQAiwRequest).
+
+ This class is a part of API to be used by the applications instead of using XQServiceRequest directly.
+
+ The Application Manager API offers centric place for applications UIs to handle application to application interworking use cases, like:
+ - Synchronous out-of-process service call from client to service provider, where service provider needs to complete the request before
+ control comes back to requesting client.
+ - Asynchronous out-of-process service call from client to service provider, where Service provider completes the request whenever suitable.
+ The control returns back requesting as soon the service provider has received the asynchronous call (can be applied to notifications as well).
+ - Embedded out-of-process service call. In this case window groups are chained and "Back" returns to client window.
+ - Any named Qt type in the Qt meta-object system can be used as a service call parameter or return value. Also own, custom meta-types are supported.
+ - Launched service provider application (.exe) if not already running when client makes service call to it.
+ - List and discover services dynamically.
+ - Apply UI related options upon service launch, like "launch as embedded", "launch to foreground" and "launch to backround".
+ - Opening files to be viewed by a file viewing interface.
+ - Opening URI to be viewed by a URI viewing interface. Includes also launching activity URIs (appto) as fire-and-forget manner.
+ - Miscellanous AIW support, like get service stasus or get DRM attributes.
+
+ <b>Example usage:</b> \n
+
+ The usage pattern for all the XQApplicationManager variants implemented as service providers , interface, QUrl, QFile, is similar both embedded
+ and non-embedded usage:
+ \code
+ // Recommended way is to add XQApplicationManager as member variable to class
+ // Later on when caching of services
+ // You can use the class also as local variable.
+ class Client
+ {
+
+ public:
+ // Service access
+ bool accessService(void);
+
+ private slots:
+ void handleOk(const QVariant &result);
+ void handleError(int errorCode, const QString& errorMessage);
+ private:
+ XQApplicationManager mAiwMgr;
+ };
+
+
+ // In client.cpp
+ bool Client::accessService(void)
+ {
+ QString parameter1("+3581234567890");
+ int parameter2 = 3;
+
+ bool embedded=true; // or false
+
+ XQAiwRequest *request;
+ // Create request by interface name, the very first service implementation
+ // applied.
+ request = mAiwMgr.create("Interface", "functionName2(QString, int)", embedded);
+
+ // If dedicated service is wanted, apply this
+ // request = mAiwMgr.create("Service", "Interface",
+ // "functionName2(QString, int)", embedded);
+
+ if (request == NULL)
+ {
+ // Service not found
+ return false;
+ }
+ // ... Perform further processing
+ }
+ \endcode
+
+ Access service by descriptor:
+ \code
+ QList<XQAiwInterfaceDescriptor> implementations = appmgr.list("Interface");
+
+ // Display service in UI and make selection possible.
+ foreach (XQAiwInterfaceDescriptor d, implementations)
+ {
+ qDebug() << "Service=" << d.serviceName();
+ qDebug() << "Interface=" << d.interfaceName();
+ qDebug("Implementation Id=%x",d.property(XQAiwInterfaceDescriptor::ImplementationId).toInt());
+ }
+
+
+ // Select correct implementation
+ XQAiwInterfaceDescriptor selectedImpl = doSelectService();
+
+ // The difference to the previous example is is how request is created
+ // via application mgr.
+
+ // ...See previous example
+ request = mAiwMgr.create(selectedImpl, embedded);
+ // ....See previous example
+ \endcode
+
+ The XQApplicationManager supports opening activity (see Terminology) URIs (appto scheme) as fire-and-forget mannner:
+ \code
+ QUrl url("appto://10207C62?activityname=MusicMainView");
+
+ // The difference to the previous example is is how request is created
+ // via application mgr.
+ request = mAiwMgr.create(url);
+ if (request == NULL)
+ {
+ // No handlers for the URI
+ return;
+ }
+
+ // Set function parameters
+ QList<QVariant> args;
+ args << uri.toSring();
+ request->setArguments(args);
+
+ // Send the request
+ bool res = request.send();
+ if (!res)
+ {
+ // Request failed.
+ int error = request->lastError();
+ // Handle error
+ }
+
+ // All done.
+ delete request;
+ \endcode
+
+ \sa XQAiwRequest
+*/
+
XQApplicationManager::XQApplicationManager()
{
XQSERVICE_DEBUG_PRINT("XQApplicationManager::XQApplicationManager");
@@ -49,7 +182,7 @@
\param operation The function signature to be called via the interface.
Can be set later via XQAiwRequest::setOperation.
Apply the xqaiwdecl.h file for common constants.
- \param embedded True if embedded (window groups chained) call, false otherwise
+ \param embedded True if embedded (window groups chained) call, false otherwise.
Can be set later via XQAiwRequest::setEmbedded.
\return The application interworking request instance, NULL if no service is available
\sa list(const QString &interface, const QString &operation)
@@ -94,11 +227,11 @@
the descriptor points to one implementation and thus selects correct
implementation.
- \param implementation Valid interface descriptor obtained by the "list" call.
+ \param implementation Valid interface descriptor obtained by the list() call.
\param operation The function signature to be called via the interface.
Can be set later via XQAiwRequest::setOperation.
Apply the xqaiwdecl.h file for common constants.
- \param embedded True if embedded call, false otherwise
+ \param embedded True if embedded call, false otherwise.
Can be set later via XQAiwRequest::setEmbedded.
\return The application interworking request instance, NULL if no service is available
\sa list()
@@ -140,7 +273,7 @@
\param interface Interface name as mentioned in the service registry file
\param operation The function signature to be called via the interface.
Can be set later via XQAiwRequest::setOperation.
- \param embedded True if embedded (window groups chained) call, false otherwise
+ \param embedded True if embedded (window groups chained) call, false otherwise.
Can be set later via XQAiwRequest::setEmbedded.
\return The application interworking request instance, NULL if no service is available
\sa XQApplicationManager::create( const QString &interface, const QString &operation, bool embedded)
@@ -200,7 +333,12 @@
}
/*!
- List implementation(s) descriptors by service and interface name.
+ List available implementations for the given \a service and \a interface names from the service registry.
+ The \a operation is reserved for future use.
+ \param service Service name as mentioned in the service registry file
+ \param interface Interface name as mentioned in the service registry file
+ \param operation The operation signature to be called. Reserved for future use.
+ \return List of found interface descriptors that matched to both the \a service and \a interface names, otherwise empty list.
\sa list(const QString &interface, const QString &operation)
*/
QList<XQAiwInterfaceDescriptor> XQApplicationManager::list(
@@ -211,8 +349,8 @@
}
/*!
- Creates AIW request to view the given URI (having a attached scheme)
- The interface name applied implicitly isthe XQI_URI_VIEW (from xqaiwdecl.h),
+ Creates AIW request to view the given URI (having a attached scheme).
+ The interface name applied implicitly is the XQI_URI_VIEW (from xqaiwdecl.h),
unless there is custom handling attached to URI scheme.
The first found service implementation is applied.
A service declares support for scheme(s) (CSV list) by adding the custom property key
@@ -236,8 +374,8 @@
}
/*!
- Creates AIW request to view the given URI by service implementation
- The interface name applied implicitly is XQI_URI_VIEW (from xqaiwdecl.h),
+ Creates AIW request to view the given URI by service implementation.
+ The interface name applied implicitly is the XQI_URI_VIEW (from xqaiwdecl.h),
unless there is custom handling attached to URI scheme.
A service declares support for scheme(s) (CSV list) by adding the custom property key
(see the constant XQCUSTOM_PROP_SCHEMES value) to the service XML.
@@ -275,6 +413,14 @@
return d->create(file, NULL, embedded);
}
+/*!
+ Same as basic create(const QFile &file, bool embedded), but applies the interface descriptor to select the dedicated implementation.
+ \param file The file to be viewed
+ \param implementation Valid interface descriptor obtained by the list(const QFile &file) call.
+ \param embedded True if embedded (window groups chained) call, false otherwise
+ \return The application interworking request instance, or NULL if no viewer found.
+ \sa xqaiwdecl.h for constants values
+*/
XQAiwRequest* XQApplicationManager::create(
const QFile &file, const XQAiwInterfaceDescriptor& implementation, bool embedded)
{
@@ -284,8 +430,11 @@
/*!
- List implementations that support handling the URI scheme of the given uri
- The interface name applied implicitly is declared by the constant XQI_URI_VIEW
+ List implementations that support handling the URI scheme of the given uri.
+ The interface name applied implicitly is declared by the constant XQI_URI_VIEW.
+ \param uri The URI scheme that should be matched to the interface
+ \return List of found interface descriptors that matched to the URI scheme, otherwise empty list.
+ \sa list(const QString &interface, const QString &operation)
*/
QList<XQAiwInterfaceDescriptor> XQApplicationManager::list(const QUrl &uri)
@@ -295,8 +444,11 @@
}
/*!
- List implementations that support handling the MIME type of of the given file
- The interface name applied implicitly is declared by the constant XQI_FILE_VIEW
+ List implementations that support handling the MIME type of the given file.
+ The interface name applied implicitly is declared by the constant XQI_FILE_VIEW.
+ \param file File which MIME type should be supported by the interface.
+ \return List of found interface descriptors for applications that can handle the file, otherwise empty list.
+ \sa list(const QString &interface, const QString &operation)
*/
QList<XQAiwInterfaceDescriptor> XQApplicationManager::list(const QFile &file)
{
@@ -305,8 +457,11 @@
}
/*!
- List implementations that support handling the MIME type of of the given sharable file
- The interface name applied implicitly is declared by the constant XQI_FILE_VIEW
+ List implementations that support handling the MIME type of of the given sharable file.
+ The interface name applied implicitly is declared by the constant XQI_FILE_VIEW.
+ \param file Sharable file which MIME type should be supported by the interface.
+ \return List of found interface descriptors for applications that can handle the file, otherwise empty list.
+ \sa list(const QString &interface, const QString &operation)
*/
QList<XQAiwInterfaceDescriptor> XQApplicationManager::list(const XQSharableFile &file)
{
@@ -318,6 +473,9 @@
Create AIW request for the given file and the MIME type attached to the sharable file
The interface name applied implicitly is declared by the constant XQI_FILE_VIEW
By default, the operation name declared by constant XQOP_FILE_VIEW_SHARABLE is used.
+ \param file The sharable file to be viewed
+ \param embedded True if embedded (window groups chained) call, false otherwise
+ \return The application interworking request instance, or NULL if no viewer found.
*/
XQAiwRequest* XQApplicationManager::create(const XQSharableFile &file, bool embedded)
{
@@ -325,6 +483,14 @@
return d->create(file, NULL, embedded);
}
+/*!
+ Same as basic create(const XQSharableFile &file, bool embedded), but applies the interface descriptor to select the dedicated implementation.
+ \param file The sharable file to be viewed
+ \param implementation Valid interface descriptor obtained by the list(const XQSharableFile &file) call.
+ \param embedded True if embedded (window groups chained) call, false otherwise
+ \return The application interworking request instance, or NULL if no viewer found.
+ \sa xqaiwdecl.h for constants values
+*/
XQAiwRequest* XQApplicationManager::create(
const XQSharableFile &file, const XQAiwInterfaceDescriptor& implementation, bool embedded)
{
@@ -332,32 +498,65 @@
return d->create(file, &implementation, embedded);
}
+/*!
+ Returns error code of the last performed operation.
+ \return Error code of the last operation, 0 if no error occured.
+*/
int XQApplicationManager::lastError() const
{
XQSERVICE_DEBUG_PRINT("XQApplicationManager::lastError");
return d->lastError();
}
-
+/*!
+ Tests whether given implementation is running. That is, the service provider has published
+ the full service name attached to the given interface descriptor.
+ \param implementation Interface that is tested for being run.
+ \return True if the implementation is running, false otherwise.
+*/
bool XQApplicationManager::isRunning(const XQAiwInterfaceDescriptor& implementation) const
{
XQSERVICE_DEBUG_PRINT("XQApplicationManager::isRunning");
return d->isRunning(implementation);
}
-
+/*!
+ Gets the values of the DRM related \a attributeNames, like "IsProtected",
+ "IsForwardable", "MimeType" for a given \a file.
+ \param file File for which DRM attributes are retrieved
+ \param attributeNames List of attributes that should be retrieved (check #DrmAttribute)
+ \param attributeValues On success fills this list whith values, where each value is QVariant of the integer or string type.
+ If attribute value does not exists or other error occurs when reading the attribute, the invalid QVariant
+ value is returned.
+ \return True on success, upon error returns false (e.g file does not exists or other general error).
+*/
bool XQApplicationManager::getDrmAttributes(const QFile &file, const QList<int> &attributeNames, QVariantList &attributeValues)
{
XQSERVICE_DEBUG_PRINT("XQApplicationManager::drmAttributes (file)");
return d->getDrmAttributes(file, attributeNames, attributeValues);
}
+/*!
+ Gets the values of the DRM related \a attributeNames, like "IsProtected",
+ "IsForwardable", "MimeType" for a given sharable file.
+ \param file Sharable file for which DRM attributes are retrieved
+ \param attributeNames List of attributes that should be retrieved (check #DrmAttribute)
+ \param attributeValues On success fills this list whith values, where each value is QVariant of the integer or string type.
+ If attribute value does not exists or other error occurs when reading the attribute, the invalid QVariant
+ value is returned.
+ \return True on success, upon error returns false (e.g file does not exists or other general error).
+*/
bool XQApplicationManager::getDrmAttributes(const XQSharableFile &file, const QList<int> &attributeNames, QVariantList &attributeValues)
{
XQSERVICE_DEBUG_PRINT("XQApplicationManager::drmAttributes (XQSharableFile)");
return d->getDrmAttributes(file, attributeNames, attributeValues);
}
+/*!
+ Checks the status of the given service interface.
+ \param implementation Interface which status is being checked.
+ \return Status of the service.
+*/
XQApplicationManager::ServiceStatus XQApplicationManager::status(const XQAiwInterfaceDescriptor& implementation)
{
XQSERVICE_DEBUG_PRINT("XQApplicationManager::status");
--- a/qthighway/xqservice/src/xqappmgr.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqappmgr.h Thu Sep 02 21:20:48 2010 +0300
@@ -41,26 +41,30 @@
public:
- // For the contentAttributes()
+ /*!
+ For the getDrmAttributes() function
+ */
enum DrmAttribute
{
DrmIntAttributeBase=0, // Base value for the DRM integer attributes
- IsProtected = DrmIntAttributeBase+0,
- IsForwardable = DrmIntAttributeBase+1,
+ IsProtected = DrmIntAttributeBase+0, /*!< */
+ IsForwardable = DrmIntAttributeBase+1, /*!< */
// For others DrmIntAttributeBase+N, see N from the caf/caftypes.h
- DrmStringAttributeBase = 100, // Base value for the DRM string attributes
- Description = DrmStringAttributeBase+0,
- MimeType = DrmStringAttributeBase+1
+ DrmStringAttributeBase = 100, // Base value for the DRM string attributes
+ Description = DrmStringAttributeBase+0, /*!< */
+ MimeType = DrmStringAttributeBase+1 /*!< */
// For others, DrmIntAttributeBase+N, see N from the caf/caftypes.h
};
- // For the serviceStatus() function
+ /*!
+ For the status() function
+ */
enum ServiceStatus
{
- Unknown=0, // Not known
- Enabled, // Service enabled
- Disabled // Service disabled, e.g. required config not OK,
+ Unknown=0, /*!< Not known */
+ Enabled, /*!< Service enabled */
+ Disabled /*!< Service disabled, e.g. required config not OK */
};
XQApplicationManager();
--- a/qthighway/xqservice/src/xqappmgr_p.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqappmgr_p.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -32,6 +32,11 @@
#include "xqaiwdecl.h"
#include "xqappmgr_p.h"
+/*!
+ \class XQApplicationManagerPrivate
+ \brief Private implementation of the XQApplicationManager
+*/
+
XQApplicationManagerPrivate::XQApplicationManagerPrivate():
serviceMgr(0),
aiwUtilities(0)
--- a/qthighway/xqservice/src/xqservicechannel.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqservicechannel.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -71,7 +71,9 @@
/*!
Constructs a XQService channel with the given \a parent, and registers it
with the server using the given \a channel name.
-
+ \param channel Channel name.
+ \param isServer
+ \param parent Parent of this object.
\sa isRegistered(), channel()
*/
--- a/qthighway/xqservice/src/xqserviceipcmarshal.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqserviceipcmarshal.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -22,7 +22,31 @@
#include "xqserviceipcmarshal.h"
/*!
- \macro Q_DECLARE_USER_METATYPE(TYPE)
+ \file xqserviceipcmarshal.h
+*/
+
+/*!
+ \def Q_DECLARE_USER_METATYPE_NO_OPERATORS(TYPE)
+
+ This macro declares \a TYPE as a user-defined type within the Qt
+ metatype system. It should be used in header files, just after
+ the declaration of TYPE. A corresponding invocation of
+ Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(TYPE) should appear in
+ a source file. This macro should be used instead of
+ Q_DECLARE_USER_METATYPE when no need to declare datastream operators.
+
+ This example declares the class MyClass that doesn't need to declare
+ datastream operators:
+
+ \code
+ Q_DECLARE_USER_METATYPE(MyClass)
+ \endcode
+
+ \sa Q_DECLARE_USER_METATYPE_ENUM(), Q_IMPLEMENT_USER_METATYPE(), Q_IMPLEMENT_USER_METATYPE_ENUM(), Q_REGISTER_USER_METATYPE()
+*/
+
+/*!
+ \def Q_DECLARE_USER_METATYPE(TYPE)
This macro declares \a TYPE as a user-defined type within the
Qt metatype system. It should be used in header files, just
@@ -39,7 +63,7 @@
*/
/*!
- \macro Q_DECLARE_USER_METATYPE_TYPEDEF(TAG,TYPE)
+ \def Q_DECLARE_USER_METATYPE_TYPEDEF(TAG,TYPE)
This macro declares \a TYPE as a user-defined type within the
Qt metatype system, but declares it as a typedef for a pre-existing
@@ -53,7 +77,7 @@
Q_IMPLEMENT_USER_METATYPE_TYPEDEF should appear in a source file.
This example declares the types \c{Foo} and \c{Bar} as typedef aliases.
-s
+
\code
typedef Foo Bar;
Q_DECLARE_USER_METATYPE(Foo)
@@ -64,7 +88,27 @@
*/
/*!
- \macro Q_DECLARE_USER_METATYPE_ENUM(TYPE)
+ \def Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(TYPE)
+
+ This macro implements the code necessary to register \a TYPE as a user-defined
+ type within the Qt metatype system.
+
+ This example implements the registration, logic for the class MyClass that
+ doesn't need to declare datastream operators:
+
+ \code
+ Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(MyClass)
+ \endcode
+
+ On most systems, this macro will arrange for registration to be performed at program
+ startup. On systems that don't support global constructors properly, it may be
+ necessary to manually call Q_REGISTER_USER_METATYPE().
+
+ \sa Q_IMPLEMENT_USER_METATYPE_ENUM(), Q_IMPLEMENT_USER_METATYPE(), Q_DECLARE_METATYPE(), Q_REGISTER_USER_METATYPE()
+*/
+
+/*!
+ \def Q_DECLARE_USER_METATYPE_ENUM(TYPE)
This macro declares \a TYPE as a user-defined enumerated type within
the Qt metatype system. It should be used in header files, just
@@ -84,7 +128,7 @@
*/
/*!
- \macro Q_IMPLEMENT_USER_METATYPE(TYPE)
+ \def Q_IMPLEMENT_USER_METATYPE(TYPE)
This macro implements the code necessary to register \a TYPE
as a user-defined type within the Qt metatype system.
@@ -104,7 +148,7 @@
*/
/*!
- \macro Q_IMPLEMENT_USER_METATYPE_TYPEDEF(TAG,TYPE)
+ \def Q_IMPLEMENT_USER_METATYPE_TYPEDEF(TAG,TYPE)
This macro implements the code necessary to register \a TYPE
as a user-defined typedef alias within the Qt metatype system.
@@ -129,7 +173,7 @@
*/
/*!
- \macro Q_IMPLEMENT_USER_METATYPE_ENUM(TYPE)
+ \def Q_IMPLEMENT_USER_METATYPE_ENUM(TYPE)
This macro implements the code necessary to register \a TYPE
as a user-defined type within the Qt metatype system. \a TYPE
@@ -153,7 +197,7 @@
*/
/*!
- \macro Q_REGISTER_USER_METATYPE(TYPE)
+ \def Q_REGISTER_USER_METATYPE(TYPE)
This macro can be called as a function to manually register \a TYPE
as a user-defined type within the Qt metatype system. It is only
--- a/qthighway/xqservice/src/xqserviceipcmarshal.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqserviceipcmarshal.h Thu Sep 02 21:20:48 2010 +0300
@@ -30,12 +30,19 @@
#include <qatomic.h>
#include <quuid.h>
+/// @cond
+/*!
+ Excluded from documentation.
+*/
+
template <typename T>
struct QMetaTypeRegister
{
static int registerType() { return 1; }
};
+/// @endcond
+
#ifdef Q_CC_GNU
# define _QATOMIC_ONCE() do {} while(0)
#else
--- a/qthighway/xqservice/src/xqserviceprovider.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqserviceprovider.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -30,53 +30,9 @@
#include <xqserviceutil.h>
/*!
- \class XQServiceProvider
- \inpublicgroup QtBaseModule
-
- \brief The XQServiceProvider class provides an interface to messages on a XQService service
- which simplifies remote slot invocations
-
- Service messages consist of a service name, a message name, and a list of parameter values.
- Qt extension extension dispatches service messages to the applications associated with the service
- name, on the application's \c{QPE/Application/appname} channel, where
- \c{appname} is the application's name.
-
- The use of XQServiceProvider will be demonstrated using the \c{Time}
- service. This has a single message called \c{editTime()} which asks
- the service to pop up a dialog allowing the user to edit the current time.
-
- \code
- class TimeService : public XQServiceProvider
- {
- Q_OBJECT
- public:
- TimeService( QObject *parent = 0 );
-
- public slots:
- void editTime(QTime time);
- };
-
- TimeService::TimeService( QObject *parent )
- : XQServiceProvider( "Time", parent )
- {
- publishAll();
- }
- \endcode
-
- The call to publishAll() causes all public slots within \c{TimeService}
- to be automatically registered as Service messages. This can be
- useful if the service has many message types.
-
- The client can send a request to the service using QtopiaServiceRequest:
-
- \code
- XQServiceRequest req( "Time", "editTime()" );
- req << QTime::currentTime();
- req.send();
- \endcode
-
+ \class ServiceAdaptorProxy
+ \brief Proxy class for converting signal and slot members into IPC message names
*/
-
class ServiceAdaptorProxy : public XQServiceAdaptor
{
Q_OBJECT
@@ -109,6 +65,12 @@
return XQServiceAdaptor::memberToMessage( member );
}
+/*!
+ \class XQServiceProvider_Private
+ \inpublicgroup QtBaseModule
+
+ \brief Private implementation of XQServiceProvider
+*/
class XQServiceProvider_Private
{
public:
@@ -140,9 +102,563 @@
delete m_adaptor;
}
+/*!
+ \class XQServiceProvider
+ \inpublicgroup QtBaseModule
+
+ \brief The XQServiceProvider class provides an interface to messages on a XQService service
+ which simplifies remote slot invocations
+
+ Service messages consist of a service name, a message name, and a list of parameter values.
+ Qt extension dispatches service messages to the applications associated with the service
+ name, on the application's \c{QPE/Application/appname} channel, where
+ \c{appname} is the application's name.
+
+ <b>Service registration</b> \n
+ Service provider need to register it's service into the system before they can be used by
+ the service client. Registration is done by creating a XML formatted service configuration
+ file and defining the service in the provider's .pro-file. QMake will notice service provider
+ from the .pro-file, with help of the service.prf file, and generate a make file that uses
+ a helper application xqsreg.exe. The helper application sqsreg.exe will generate an application
+ registration resource file ( _reg.rss) from the configuration-file and provider's definitions
+ that include the needed declarations for the services provided.
+
+ <b>Service Names Allocation</b> \n
+ The harmonize service and interface names the Symba specific names and guidelines can be found
+ from http://s60wiki.nokia.com/S60Wiki/QtFw_for_S60_coding_conventions/Service_name_registry#Service.
+
+ Before implementing a service you need to allocate the name according to the guidelines. Please
+ inform intended service clients (customers) and matti.parnanen@nokia.com.
+
+ <b>Service Configuration File</b> \n
+ All the service configuration are added to the run-time service registry to make them available
+ for service discovery and creating service requests.
+ \note Only one service element with multiple interface is supported!
+
+ To support services a new configuration was introduced to qmake and two new variables for
+ that configuration:
+
+ \code
+ CONFIG = service
+ service.file = <service configuration file path>
+ service.options = <embeddable> (optional, default not embeddable), <hidden> (optional, default not hidden)
+ \endcode
+
+ The fornat of the service configuration file is same as XML format used in Qt Service Framework.
+ Example configuration file:
+
+ \code
+ <?xml version="1.0" encoding="utf-8" ?>
+ <service>
+ <name>Music Fetcher</name>
+ <filepath>No path</filepath>
+ <description>Music Fetcher</description>
+ <interface>
+ <name><b>com.nokia.symbian.IMusicFetch</b></name>
+ <version>1.0</version>
+ <description>Interface for fetching music files</description>
+ </interface>
+ </service>
+ \endcode
+
+ \code
+ <ELEMENT service ( name, filepath, description?, interface+ ) >
+ <ELEMENT description ( #CDATA ) >
+ <ELEMENT filepath ( #PCDATA ) >
+ <ELEMENT interface ( '''name''', version, description?, capabilities?, customproperty* ) >
+ <ELEMENT capabilities ( #PCDATA ) >
+ <ELEMENT name ( #PCDATA ) >
+ <ELEMENT version ( #PCDATA ) >
+ <ELEMENT customproperty ( #CDATA ) >
+ <ATTLIST customproperty key NMTOKEN #REQUIRED >
+ \endcode
+
+ Also the old format described below is supported, With old format you can not have custom properties, which
+ for example are used for AIW purposes.
+ \code
+ <ELEMENT service ( description?, interface+ ) >
+ <ATTLIST service name #CDATA #REQUIRED >
+ <ATTLIST service filepath #CDATA #REQUIRED >
+ <ELEMENT description ( #CDATA ) >
+ <ELEMENT interface ( description? ) >
+ <ATTLIST interface '''name''' #CDATA #REQUIRED >
+ <ATTLIST interface version #CDATA #REQUIRED >
+ <ATTLIST interface capabilities #CDATA #REQUIRED >
+ \endcode
+
+ <b>Changing service or interface names</b> \n
+ Before you think about changing the name of the already released and used service implementation, read this
+ http://s60wiki.nokia.com/S60Wiki/QtFw_for_S60_coding_conventions/Service_name_registry#About_changing_service_or_interface_names
+ first.
+
+ The basic message is the service name, interface name and operation (message) slot signatures for the API. And for API changes you have to apply development time API deprecation process.
+
+ <b>Service Registration tools</b> \n
+ The needed utility files for service registration:
+ - xqsreg.exe should be in \epoc32\tools or some other directory that can be found from the path
+ - service.prf should be in \epoc32\tools\qt\mkspecs\features\symbian directory.
+
+ If necessary you can copy those files to target directories from qthighway/bin.
+
+ Sources for the xqsreg.exe can be found from the qthighway\xqsreg and it is also possible to compile it.
+ - cd \qthighway\xqsreg
+ - qmake -platform win32-mwc
+ - make
+
+ Usage: \n
+ How to create a simple synchronously working service provider?
+ \code
+ class YourService : public XQServiceProvider
+ {
+ Q_OBJECT
+
+ public:
+ YourService ( ServiceApp *parent = 0 );
+ ~YourService ();
+
+ public slots:
+ void functionName1();
+ int functionName2(const QString& number, int times);
+
+ private:
+ ServiceApp *mServiceApp;
+ };
+ \endcode
+
+ Implementation:
+ \code
+ YourService::YourService(ServiceApp* parent)
+ : XQServiceProvider(QLatin1String("yourservice.Interface"), parent), mServiceApp(parent)
+ {
+ publishAll();
+ }
+
+ YourService::~YourService() { }
+
+ void YourService::functionName1() { }
+
+ int YourService::functionName2(const QString& number, int times)
+ {
+ int returnValue = 1;
+ return returnValue;
+ }
+ \endcode
+
+ Additions to .pro-file:
+ \code
+ CONFIG += service
+ SERVICE.FILE = service_conf.xml
+ SERVICE.OPTIONS = embeddable
+ SERVICE.OPTIONS += hidden
+ \endcode
+
+ Service configuration file (service_conf.xml):
+ \code
+ <?xml version="1.0" encoding="utf-8" ?>
+ <service>
+ <name>yourservice</name>
+ <filepath>No path</filepath>
+ <description>Service description</description>
+ <interface>
+ <name>Interface</name>
+ <version>1.0</version>
+ <description>Interface description</description>
+ </interface>
+ </service>
+ \endcode
+
+ How to create a simple asynchronously working service provider?
+ Header:
+ \code
+ class YourService : public XQServiceProvider
+ {
+
+ Q_OBJECT
+
+ public:
+ YourService ( ServiceApp *parent = 0 );
+ ~YourService ();
+ void compleAsyncFunction();
+
+ public slots:
+ void functionName1();
+ int functionName2(const QString& number, int times);
+
+ private:
+ ServiceApp *mServiceApp;
+ int mAsyncRequestIndex;
+ QVariant mReturnValue;
+
+ };
+ \endcode
+
+ Implementation:
+ \code
+ YourService::YourService(ServiceApp* parent)
+ : XQServiceProvider(QLatin1String("yourservice.Interface"), parent), mServiceApp(parent)
+ {
+ publishAll();
+ }
+
+ YourService::~YourService() { }
+
+ void YourService::compleAsyncFunction()
+ {
+ completeRequest(mAsyncRequestIndex, mReturnValue);
+ }
+
+ void YourService::functionName1()
+ {
+ mAsyncRequestIndex = setCurrentRequestAsync();
+ mReturnValue.setValue(0);
+ }
+
+ int YourService::functionName2(const QString& number, int times)
+ {
+ mAsyncRequestIndex = setCurrentRequestAsync();
+ mReturnValue.setValue(1);
+ return mReturnValue.toInt();
+ }
+ \endcode
+
+ <b>Examples:</b> \n
+ The use of XQServiceProvider will be demonstrated using the \c{Time}
+ service. This has a single message called \c{editTime()} which asks
+ the service to pop up a dialog allowing the user to edit the current time.
+ \code
+ class TimeService : public XQServiceProvider
+ {
+ Q_OBJECT
+ public:
+ TimeService( QObject *parent = 0 );
+
+ public slots:
+ void editTime(QTime time);
+ };
+
+ TimeService::TimeService( QObject *parent )
+ : XQServiceProvider( "Time", parent )
+ {
+ publishAll();
+ }
+ \endcode
+
+ The call to publishAll() causes all public slots within \c{TimeService}
+ to be automatically registered as Service messages. This can be
+ useful if the service has many message types.
+
+ The client can send a request to the service using QtopiaServiceRequest:
+
+ \code
+ XQServiceRequest req( "Time", "editTime()" );
+ req << QTime::currentTime();
+ req.send();
+ \endcode
+
+ <b>URI viewer</b> \n
+ This is a simple example for implementing out-of-process scheme handlers.
+ - "http", "https" and are handled via standard QDesktopServices::openUrl() function.
+ This is fire-and-forget launch. The options are ignored and no control and signals available after the launch.
+ - "appto" is routed to Activity Manager for opening the attached activity.
+ This is fire-and-forget launch. The options are ignored and no control and signals available after the launch.
+ - The "file" scheme is handled as the QFile based create below.
+ So the com.nokia.symbian.IFileView interface is applied as for the QFile.
+
+ Service application needs to publish support for:
+ - The common interface "com.nokia.symbian.IUriView", and
+ - The scheme(s), like "testo" in the example below. The custom custom property "schemes" contains one or more schemes as comma separated list (CSV)
+ - The slot "view(QString)" to view the URI
+
+ \code
+ <?xml version="1.0" encoding="utf-8" ?>
+ <service>
+ <name>serviceapp</name>
+ <filepath>No path</filepath>
+ <description>Test service</description>
+ <interface>
+ <name>com.nokia.symbian.IUriView</name>
+ <version>1.0</version>
+ <description>Interface for showing URIs</description>
+ <customproperty key="schemes">testto</customproperty>
+ </interface>
+ </service>
+ \endcode
+
+ An service application that offers support for a scheme implements the common "UriService" with the pre-defined "view" slot:
+
+ \code
+ class UriService : public XQServiceProvider
+ {
+ Q_OBJECT
+ public:
+ UriService( ServiceApp *parent = 0 );
+ ~UriService();
+ bool asyncAnswer() {return mAsyncAnswer;}
+ void complete(bool ok);
+
+ public slots:
+ bool view(const QString& uri);
+
+ private slots:
+ void handleClientDisconnect();
+
+ private:
+ ServiceApp* mServiceApp;
+ bool mAsyncAnswer;
+ int mAsyncReqId;
+ bool mRetValue;
+ };
+ \endcode
+
+ Client application accesses the service via the URI:
+
+ \code
+ // Assume in example we have own scheme "testo" but this can be applied to
+ // "mailto", etc. standard schemes.
+ //
+ // (As mentioned in the documentation, some schemes are CURRENTLY handled specially,
+ // like "http" scheme uses QDesktopServices::openUrl).
+ //
+ QUrl url("testto://authority?param1=value1¶m1=value2");
+
+ // The difference to the previous example is is how request is created
+ // via application mgr.
+
+ request = mAiwMgr.create(url);
+ if (request == NULL)
+ {
+ // No handlers for the URI
+ return;
+ }
+
+ // Set function parameters
+ QList<QVariant> args;
+ args << uri.toSring();
+ request->setArguments(args);
+
+ // Send the request
+ bool res = request.send();
+ if (!res)
+ {
+ // Request failed.
+ int error = request->lastError();
+ // Handle error
+ }
+
+ // If making multiple requests to same service, you can save the request as member variable
+ // In this example all done.
+ delete request;
+ \endcode
+
+ <b>File viewer</b> \n
+ As for URis, a service application that support viewing a file with a dedicated MIME-type need to publish support for:
+ - The common interface "com.nokia.symbian.IFileView".
+ - The slot "view(QString)" to view the non-data-caged file by file name.
+ - The slot "view(XQSharable)" to view the data-caged file by sharable file handle.
+ - MIME type list (registered in the .pro file).
+ So there are multiple service applications implementing the same interface.
+
+ In service provider side you need the following entry in XML:
+
+ \code
+ <interface>
+ <name>com.nokia.symbian.IFileView</name>
+ <version>1.0</version>
+ <description>Interface for showing Files</description>
+ </interface>
+ \endcode
+
+ The file viewer application shall offer slots both for viewing filename (QString) and viewing sharable file (XQSharable):
+
+ \code
+ class FileService : public XQServiceProvider
+ {
+ Q_OBJECT
+ public:
+ FileService( ServiceApp *parent = 0 );
+ ~FileService();
+ bool asyncAnswer() {return mAsyncAnswer;}
+ void complete(bool ok);
+
+ public slots:
+ bool view(QString file);
+ bool view(XQSharableFile file);
+
+ private slots:
+ void handleClientDisconnect();
+
+ private:
+ ServiceApp* mServiceApp;
+ bool mAsyncAnswer;
+ int mAsyncReqId;
+ bool mRetValue;
+ };
+ \endcode
+
+ In the .pro file the service publishes the supported MIME types, e.g:
+
+ \code
+ RSS_RULES += \
+ "datatype_list = " \
+ " {" \
+ " DATATYPE" \
+ " {" \
+ " priority = EDataTypePriorityNormal;" \
+ " type = \"text/plain\";" \
+ " }" \
+ " };" \
+ \endcode
+
+ In the client side (see the "examples/appmgrclient" and "examples/serviceapp" included in the QtHighway release) access to
+ file:
+
+ \code
+ // Not data caged file
+ QFile file("C:\\data\\Others\\test.txt");
+
+ request = mAiwMgr.create(file);
+ if (request == NULL)
+ {
+ // No handlers for the URI
+ return;
+ }
+ // By default operation is "view(QString)"
+
+ // Set function parameters
+ QList<QVariant> args;
+ args << file.fileName();
+ request->setArguments(args);
+
+ // Send the request
+ bool res = request.send();
+ if (!res)
+ {
+ // Request failed.
+ int error = request->lastError();
+
+ // Handle error
+ }
+
+ // If making multiple requests to same service, you can save the request as member variable
+ // In this example all done.
+ delete request;
+ \endcode
+
+ <b>Sharable file viewer</b> \n
+ The same rules as for file name based view applies, but different argument type (XQSharableFile) used
+ in request. See the "examples/appmgrclient" and "examples/serviceapp" included in the QtHighway release.
+
+ \code
+ XQSharableFile sf;
+ // Open the file for sharing from own private directory
+ // If you have handle available, just set it by "setHandle()" function
+ if (!sf.open("c:\\private\\e0022e74\\test.txt"))
+ {
+ // Failed to open sharable file
+ return;
+ }
+
+ // Create request for the sharable file
+ XQAiwreqiuest req = mAiwMgr.create(sf);
+ if (!req)
+ {
+ // No viewer app found for the file
+ // As we opened the handle, we need to close it !
+ sf.close();
+ return;
+ }
+ // By default operation is "view(XQSharableFile)"
+
+ // Set function parameters
+ // Not only one sharable handle supported, otherwise upon send EArgumentError error occurs
+ QList<QVariant> args;
+ args << qVariantFromValue(sf);
+ req->setArguments(args);
+
+ // Send the request
+ bool res = request.send();
+ if (!res)
+ {
+ // Request failed.
+ int error = request->lastError();
+ // Handle error
+ }
+
+ // As we opened the handle, we need to close it !
+ sf.close();
+
+ // If making multiple requests to same service, you can save the request as member variable
+ // In this example all done.
+ delete request;
+ \endcode
+
+ <b> Create interface action </b> \n
+ One interface XML may offer one action to be displayed by client application.
+ See the "examples/appmgrclient" and "examples/hbserviceprovider" included in the QtHighway release.
+
+ \code
+ HbAction* ShareUiPrivate::fetchServiceAction(XQAiwInterfaceDescriptor interfaceDescriptor)
+ {
+ QDEBUG_WRITE("ShareUiPrivate::fetchServiceAction start");
+ // create the request for each descriptor.
+
+ XQAiwRequest* request = mAppManager.create(interfaceDescriptor,SELECT_OP,false);
+ QAction action = request->createAction());
+ if (!action)
+ return 0;
+
+ // if Orbit widgets do not support QAction
+ // Need to convert QAction to HbAction first
+ HbAction* hbAction = convertAction(action);
+ if(hbAction)
+ {
+ // Connect triggered signals to enable the request to emit triggered
+ connect(hbAction, SIGNAL(triggered()), action, SIGNAL(triggered()));
+
+ // connect the request's triggered action to the slot in app
+ connect(request, SIGNAL(triggered()), this, SLOT(onTriggered()));
+ }
+
+ return hbAction;
+ }
+ \endcode
+
+ In service provider side you need to have the following entries in XML to be converted to QAction by the create:
+
+ \code
+ <interface>
+ <name>Dialer></name>
+ <version=1.0</version>
+ <description>Dial interface</description>
+ <customproperty key="aiw_action_text_file">hbserviceprovider</customproperty>
+ <customproperty key="aiw_action_text">txt_aiw_action_text</customproperty>
+ </interface>
+ \endcode
+*/
+
+/*!
+ \fn void XQServiceProvider::returnValueDelivered()
+
+ This signal is emitted when asynchronous request has been completed and its
+ return value has been delivered to the service client.
+*/
+
+/*!
+ \fn void XQServiceProvider::clientDisconnected()
+
+ This signal is emitted if client accessing a service application terminates.
+ The counterpart in client side (when service application terminates) is
+ the error XQService::EConnectionClosed.
+*/
/*!
Construct a remote service object for \a service and attach it to \a parent.
+ \param service Defines the full service name that is implemented.
+ The full service name is:
+ - The name of the service from the service configuration file
+ - Character *.* (dot)
+ - The name of the interface from the service configuration file
+ \param parent Parent of this QObject
*/
XQServiceProvider::XQServiceProvider( const QString& service, QObject *parent )
: QObject( parent )
@@ -155,7 +671,7 @@
}
/*!
- Destroy this service handling object.
+ Destroys this service handling object.
*/
XQServiceProvider::~XQServiceProvider()
{
@@ -187,9 +703,15 @@
}
/*!
-* Sets current request to asynchronous mode so that provider can complete the
-* request later via the completeRequest() call.
-* \return Request ID which shall be used in the completeRequest() call.
+ Sets current request to asynchronous mode so that provider can complete the
+ request later via the completeRequest() call.
+ \return Request ID which shall be used in the completeRequest() call.
+ \note There can be several clients accessing the same service at the same time. Avoid saving
+ the index to XQServiceProvider instance as member variable as when another new request
+ comes in, it will have different index and you will potentially override the index of
+ the first request. You should ensure the completeRequest() gets the correct index e.g.
+ by attaching the index as user data to data object maintain a map of indexes based on
+ some key.
*/
int XQServiceProvider::setCurrentRequestAsync()
{
@@ -198,10 +720,24 @@
}
/*!
-* Completes the asynchronous request with the given value
-* \param index Request ID got from the setCurrentRequestAsync call.
-* \param retValue The value
-* \return true on success, false if index points to non-existing request.
+ \fn bool XQServiceProvider::completeRequest(int index, const T& retValue)
+
+ Completes asynchronous request.
+ \param index Defines the index of the asynchronous request to complete.
+ \param retValue defines the return value for the request.
+ \return true if request could be completed successfully, otherwise false.
+ \sa completeRequest()
+*/
+
+/*!
+ Completes the asynchronous request with the given value
+ \param index Request ID got from the setCurrentRequestAsync call.
+ \param retValue Returned value.
+ \return true on success, false if index points to non-existing request.
+ \note <b>You need to check the return value. </b>
+ If false it means connection to client has been lost and the complete will not ever succeed.
+ So if you have e.g. a code that quits application using the ReturnValueDelived signal only,
+ that signal will never be emitted as request can not be completed.
*/
bool XQServiceProvider::completeRequest(int index, const QVariant& retValue)
{
@@ -211,8 +747,8 @@
}
/*!
-* Return additional request information attached to request
-* \return Request info
+ Return additional request information attached to request
+ \return Request info.
*/
XQRequestInfo XQServiceProvider::requestInfo() const
{
--- a/qthighway/xqservice/src/xqservicerequest.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqservicerequest.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -30,6 +30,14 @@
#include <QStringList>
#include <xqservicemanager.h>
+/*!
+ \class XQServiceRequest_Private
+ \inpublicgroup QtBaseModule
+
+ \ingroup ipc
+ \brief Private implementation of the XQServiceRequest.
+*/
+
class XQServiceRequest_Private : public XQServiceRequestCompletedAsync
{
public:
@@ -101,9 +109,190 @@
}
/*!
- Construct a null service request.
- setService() and setMessage() must be called before send(), but the
- service may be written prior to the calls.
+ \class XQServiceRequest
+ \inpublicgroup QtBaseModule
+
+ \ingroup ipc
+ \brief Allows applications to request services from other applications.
+
+ The XQServiceRequest class allows applications to request services from other applications.
+ A XQServiceRequest encapsulates a service name and the message to be sent to that service.
+
+ \note One should be using XQApplicationManager and the related XQAiwRequest instead of XQServiceRequest.
+ The XQApplicationManager and related classes encapsulate basic, target-architecture approved
+ support for out-of-process Application Interworking, e.g. support for launching URLs
+ (including activity URLs), normal files, sharable files, etc. (whatever needed).
+
+ \b Examples: \n
+
+ How to create synchronous request without parameters and return value?
+ \note The full name (yourservice.Interface) need to be used (with dot (.) between service name and interface name).
+
+ \code
+ XQServiceRequest request("yourservice.<b>Interface</b>", "functionName1()");
+ bool res = request.send();
+ if (!res) {
+ int error = request.latestError();
+ }
+ \endcode
+
+ How to create synchronous request with several parameters and return value?
+
+ \code
+ QString parameter1("+3581234567890");
+ int parameter2 = 3;
+ XQServiceRequest request("yourservice.<b>Interface</b>", "functionName2(QString, int)");
+ request << parameter1;
+ request << parameter2;
+ int returnvalue;
+ bool res = request.send(returnvalue);
+ if (!res) {
+ int error = request.latestError();
+ }
+ \endcode
+
+ How to create asynchronous request without return value?
+
+ \code
+ QString parameter1("+3581234567890");
+ int parameter2 = 3;
+ XQServiceRequest request("yourservice.Interface", "functionName2(QString, int)", false);
+ request << parameter1;
+ request << parameter2;
+ bool res = request.send();
+ if (!res) {
+ int error = request.latestError();
+ }
+ \endcode
+
+ How to create asynchronous request with return value?
+
+ \code
+ QString parameter1("+3581234567890");
+ int parameter2 = 3;
+ XQServiceRequest request("yourservice.Interface", "functionName2(QString, int)", false);
+ request << parameter1;
+ request << parameter2;
+ connect(request, SIGNAL(requestCompleted(QVariant)), this, SLOT(requestCompleted(QVariant)));
+ bool res = request.send();
+ if (!res) {
+ int error = request.latestError();
+ }
+
+ ...
+
+ void requestCompleted(const QVariant& value)
+ {
+ int returnvalue = value.toInt();
+ }
+ \endcode
+
+ How to use declare custom type?
+
+ Header:
+ \code
+ class CustomType
+ {
+ public:
+ CustomType (){};
+ virtual ~CustomType(){};
+
+ QString mString1;
+ QString mString2;
+ QUuid mUid;
+
+ template <typename Stream> void serialize(Stream &stream) const;
+ template <typename Stream> void deserialize(Stream &stream);
+ };
+
+ Q_DECLARE_USER_METATYPE(CustomType)
+ \endcode
+
+ Implementation:
+ \code
+ template <typename Stream> void CustomType::serialize(Stream &s) const
+ {
+ s << mString1;
+ s << mString2;
+ s << mUid;
+ }
+
+ template <typename Stream> void CustomType::deserialize(Stream &s)
+ {
+ s >> mString1;
+ s >> mString2;
+ s >> mUid;
+ }
+
+ Q_IMPLEMENT_USER_METATYPE(CustomType)
+ \endcode
+
+ How to declare custom type that doesn't need data stream operators?
+
+ Header:
+ \code
+ typedef QList<CustomType> CustomTypeList;
+
+ Q_DECLARE_USER_METATYPE_NO_OPERATORS(CustomTypeList)
+ \endcode
+
+ Implementation:
+ \code
+ Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CustomTypeList)
+ \endcode
+*/
+
+/*!
+ \fn bool XQServiceRequest::send(T& retValue)
+
+ Sends the request. If the request is synchronous, then client is blocked
+ until service provider completes the request or request fails for some reason.
+ If the request is asynchronous, then client won't be blocked.
+ \param retValue Defines refence to a value service provider will return after service.
+ \return False if there was no application that could service the request, otherwise true.
+*/
+
+/*!
+ \fn XQServiceRequest &XQServiceRequest::operator<< (const T &var)
+
+ Adds \a var to the list of arguments for this service request.
+ \param var Defines the argument value to add to the list of arguments.
+*/
+
+/*!
+ \fn XQServiceRequest &XQServiceRequest::operator<< (const char *var)
+
+ Adds \a var to the list of arguments for this service request.
+ \param var Defines the argument value to add to the list of arguments.
+*/
+
+/*!
+ \fn void XQServiceRequest::requestCompleted(const QVariant& value)
+
+ This signal is emitted when service provider returns a return value asynchronously back to the client.
+ \param value Result of the request.
+*/
+
+/*!
+ \fn void XQServiceRequest::requestError(int err);
+
+ This signal is emitted when error has happened in request handling.
+ \param err Error code as integer value.
+ \sa XQService::ServiceIPCErrors
+*/
+
+/*!
+ \fn void XQServiceRequest::addVariantArg(const QVariant& var)
+
+ Adds the variant value to the list of arguments, so that the variant's
+ value is serialized in send() rather than the variant itself.
+ \param var Value to be added to the list of arguments.
+*/
+
+/*!
+ Construct a null service request.
+ setService() and setMessage() must be called before send(), but the
+ service may be written prior to the calls.
*/
XQServiceRequest::XQServiceRequest()
{
@@ -112,9 +301,17 @@
}
/*!
- Construct a service request that will send \a message to
- a \a service when send() is called. The service may be written
- prior to the calls.
+ Construct a service request that will send \a message to
+ a \a service when send() is called. The service may be written
+ prior to the calls.
+ \param service Defines the full service name to send message. The full name is:
+ - The name of the service in the service configuration file
+ - Character *.* (dot)
+ - The name of the interface from the service XML.
+ \param message Defines the message to send to the service provider i.e. it is
+ the signature of the service provider function to be called.
+ \param synchronous Defines should message be sent synchronously or asynchronously.
+ By default message is sent synchronously.
*/
XQServiceRequest::XQServiceRequest(const QString& service, const QString& message, const bool &synchronous)
{
@@ -124,8 +321,9 @@
}
/*!
- Copy constructor. Any data previously written to the \a orig
- service will be in the copy.
+ Copy constructor. Any data previously written to the \a orig
+ service will be in the copy.
+ \param orig XQServiceRequest from which data will be copied to this object.
*/
XQServiceRequest::XQServiceRequest(const XQServiceRequest& orig)
{
@@ -135,9 +333,12 @@
}
/*!
- Construct a service request by service descriptor which contains exact details of the service and interface.
- a \a service when send() is called. The service may be written
- prior to the calls.
+ Construct a service request by service descriptor which contains exact details of the service and interface.
+ The service may be written prior to the calls.
+ \param descriptor Defines details of the service and it's interface.
+ \param message Message to be sent when send() is called.
+ \param synchronous Defines should message be sent synchronously or asynchronously.
+ By default message is sent synchronously.
*/
XQServiceRequest::XQServiceRequest(const XQAiwInterfaceDescriptor &descriptor, const QString& message, const bool &synchronous)
{
@@ -149,9 +350,9 @@
}
/*!
- Assignment operator.
- Any data previously written to the \a orig
- service will be in the copy.
+ Assignment operator.
+ Any data previously written to the \a orig
+ service will be in the copy.
*/
XQServiceRequest& XQServiceRequest::operator=(const XQServiceRequest& orig)
{
@@ -168,8 +369,8 @@
}
/*!
- Destructs the service request. Unlike QtopiaIpcEnvelope, the
- request is not automatically sent.
+ Destroys the service request. Unlike QtopiaIpcEnvelope, the
+ request is not automatically sent.
*/
XQServiceRequest::~XQServiceRequest()
{
@@ -179,9 +380,9 @@
}
/*!
- Returns true if either the service() or message() is not set.
-
- \sa service(), message()
+ Checks if request is NULL.
+ \return True if either the service() or message() is not set.
+ \sa service(), message()
*/
bool XQServiceRequest::isNull() const
{
@@ -194,21 +395,35 @@
return ret;
}
+/*!
+ Checks if request is synchronous or asynchronous.
+ \return True if request is synchronous, false if request is asynchronous.
+ \sa setSynchronous()
+ */
bool XQServiceRequest::isSynchronous() const
{
XQSERVICE_DEBUG_PRINT("XQServiceRequest::isSynchronous");
return mData->mSynchronous;
}
+/*!
+ Sets request to be synchronous or asynchronous.
+ \param synchronous If set to true, request will be synchronous.
+ If set to false, request will be asynchronous.
+ \sa isSynchronous()
+ */
void XQServiceRequest::setSynchronous(const bool& synchronous)
{
XQSERVICE_DEBUG_PRINT("XQServiceRequest::setSynchronous");
mData->mSynchronous = synchronous;
}
/*!
- \fn QString XQServiceRequest::send()
- Sends the request. Returns false if there was no application that could
- service the request.
+ Sends the request. If the request is synchronous, then client is blocked
+ until service provider completes the request or request fails for some reason.
+ If the request is asynchronous, then client won't be blocked. If the request
+ is asynchronous and clients wants to receive a return value from the service
+ provider, then clients should connect to the requestCompleted() signal.
+ \return False if there was no application that could service the request, otherwise true.
*/
bool XQServiceRequest::send()
{
@@ -218,9 +433,11 @@
}
/*!
- \fn QString XQServiceRequest::send()
- Sends the request. Returns false if there was no application that could
- service the request.
+ Sends the request. If the request is synchronous, then client is blocked
+ until service provider completes the request or request fails for some reason.
+ If the request is asynchronous, then client won't be blocked.
+ \param retData Defines refence to a value service provider will return after service.
+ \return False if there was no application that could service the request, otherwise true.
*/
bool XQServiceRequest::send(QVariant& retData)
{
@@ -261,9 +478,11 @@
(const void *)&mData->mRequestUtil);
}
/*!
- Sets the \a service to which the request will be sent.
-
- \sa service()
+ Sets the full name of the service to which the request will be sent.
+ \param fullServiceName Full name of the service to send message to. See
+ XQServiceRequest(const QString& service, const QString& message, const bool &synchronous)
+ for the full name definition.
+ \sa service()
*/
void XQServiceRequest::setService(const QString& fullServiceName)
{
@@ -275,11 +494,9 @@
}
/*!
- \fn QString XQServiceRequest::service() const
-
- Returns the service to which this request will be sent.
-
- \sa setService()
+ Gets the service name to which this request will be sent.
+ \return Full service name to which request will be sent.
+ \sa setService()
*/
QString XQServiceRequest::service() const
{
@@ -290,7 +507,9 @@
/*!
Sets the \a message to be sent to the service.
-
+ \param message Defines the message to send to a service provider. The message
+ is a valid Qt slot signature published by the service provider.
+ For example, "view(QString)".
\sa message()
*/
void XQServiceRequest::setMessage(const QString& message)
@@ -301,6 +520,11 @@
mData->mArguments.clear();
}
+/*!
+ Gets the message set for the request.
+ \return Message of the request as QString.
+ \sa setMessage()
+*/
QString XQServiceRequest::message() const
{
XQSERVICE_DEBUG_PRINT("XQServiceRequest::message");
@@ -308,77 +532,68 @@
return mData->mMessage;
}
+/*!
+ Gets the complete list of arguments for this service request.
+ \return List of arguments set to the request.
+ \sa setArguments()
+*/
const QList<QVariant> &XQServiceRequest::arguments() const
{
XQSERVICE_DEBUG_PRINT("XQServiceRequest::arguments");
return mData->mArguments;
}
+/*!
+ Sets \a arguments for this service request.
+ \param arguments Complete list of arguments for this service request
+ i.e. the values to be transferred to service provider
+ function to be called.
+ \sa arguments()
+*/
void XQServiceRequest::setArguments(const QList<QVariant> &arguments)
{
XQSERVICE_DEBUG_PRINT("XQServiceRequest::setArguments");
mData->mArguments = arguments;
}
+/*!
+ Gets the latest error that happened in the request execution.
+ \return The latest error that happened in the request execution.
+ Errors are defined in xqserviceglobal.h.
+ \sa XQService::ServiceIPCErrors.
+*/
int XQServiceRequest::latestError()
{
XQSERVICE_DEBUG_PRINT("XQServiceRequest::latestError");
return XQServiceAdaptor::latestError();
}
+/*!
+ Sets additional options for the request, like embedding or start to background.
+ \param info Additional info to be set to the request.
+ \sa info()
+*/
void XQServiceRequest::setInfo(const XQRequestInfo &info)
{
XQSERVICE_DEBUG_PRINT("XQServiceRequest::setInfo");
mData->mRequestUtil.mInfo = info;
}
+/*!
+ Gets current info set for the request.
+ \return Info data set to the request.
+ \sa setInfo()
+*/
XQRequestInfo XQServiceRequest::info() const
{
XQSERVICE_DEBUG_PRINT("XQServiceRequest::info");
return mData->mRequestUtil.mInfo;
}
-
-/*!
- \fn QString XQServiceRequest::message() const
-
- Returns the message of the request.
-
- \sa setMessage()
-*/
-
-/*!
- \fn const QList<QVariant> &XQServiceRequest::arguments() const
-
- Returns the complete list of arguments for this service request.
-*/
-
-/*!
- \fn void XQServiceRequest::setArguments(const QList<QVariant> &arguments)
-
- Sets the complete list of \a arguments for this service request.
-*/
-
-/*!
- \fn XQServiceRequest &XQServiceRequest::operator<< (const T &var)
-
- Adds \a var to the list of arguments for this service request.
-*/
-
-/*!
- \fn XQServiceRequest &XQServiceRequest::operator<< (const char *var)
-
- Adds \a var to the list of arguments for this service request.
-*/
-
-/*!
- \fn void XQServiceRequest::addArg(const QVariant& var)
-
- Adds the variant \a var to the list of arguments, so that the variant's
- value is serialized in send() rather than the variant itself.
-*/
/*!
\internal
+ Adds the variant \a var to the list of arguments, so that the variant's
+ value is serialized in send() rather than the variant itself.
*/
void XQServiceRequest::addArg(const QVariant& v)
{
@@ -387,16 +602,10 @@
mData->mArguments.append(v);
}
-
-/*!
- \fn void XQServiceRequest::handleSharableFileArg()
-
- Picks the XQSharableFile argument, if any, into the request util
- By this way scan parameter list only once.
-*/
-
/*!
\internal
+ Picks the XQSharableFile argument, if any, into the request util
+ This way scan parameter is listed only once.
*/
bool XQServiceRequest::handleSharableFileArgs()
{
@@ -440,7 +649,9 @@
/*!
- \internal
+ Serializes all the arguments from the service request.
+ \param action Defines the request having arguments to be serialized.
+ \return Serialized arguments in byte array.
*/
QByteArray XQServiceRequest::serializeArguments(const XQServiceRequest &action)
{
@@ -455,7 +666,9 @@
return ret;
}
/*!
- \internal
+ Deserializes all the arguments from the byte array to service request.
+ \param action Defines the request where arguments are deserialized.
+ \param data Defines the byte array of serialized arguments.
*/
void XQServiceRequest::deserializeArguments(XQServiceRequest &action,
const QByteArray &data)
@@ -466,8 +679,8 @@
}
/*!
- \internal
- \fn void XQServiceRequest::serialize(Stream &stream) const
+ Serializes this request to the stream.
+ \param stream Defines stream this request is serialized to.
*/
template <typename Stream> void XQServiceRequest::serialize(Stream &stream) const
{
@@ -479,8 +692,8 @@
}
/*!
- \internal
- \fn void XQServiceRequest::deserialize(Stream &stream)
+ Deserializes this request from the stream.
+ \param stream Defines the stream this request is deserialized from.
*/
template <typename Stream> void XQServiceRequest::deserialize(Stream &stream)
{
--- a/qthighway/xqservice/src/xqservicethreaddata.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqservice/src/xqservicethreaddata.h Thu Sep 02 21:20:48 2010 +0300
@@ -67,6 +67,10 @@
}
};
+/*!
+ \class XQServiceChannelPrivate
+ \brief Private implementation of XQServiceChannelPrivate
+*/
class XQServiceChannelPrivate : public QSharedData
{
public:
--- a/qthighway/xqserviceipc/xqserviceipc/xqserviceipc.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipc/xqserviceipc.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -29,13 +29,13 @@
{
/*!
- \class ServiceFwIPC
- Public interface class for IPC operations
- */
+ \class ServiceFwIPC
+ \brief Public interface class for IPC operations
+*/
/*!
- Destructor
- */
+ Destructor
+*/
ServiceFwIPC::~ServiceFwIPC()
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPC::~ServiceFwIPC");
@@ -43,10 +43,10 @@
}
/*!
- Constructor
- @param aBackend IPC backend to use
- @param aParent Parent to this QObject
- */
+ Constructor.
+ \param aParent Parent to this QObject
+ \param aBackend IPC backend to use
+*/
ServiceFwIPC::ServiceFwIPC(QObject* aParent, TServiceIPCBackends aBackend) :
QObject(aParent), iAsyncRequestPending(false)
{
@@ -58,10 +58,10 @@
}
/*!
- Connect to the server
- @param aServerName name of the server to connect to
- @return true if connected, false if not
- */
+ Connect to the server.
+ \param aServerName name of the server to connect to.
+ \return true if connected, false if not.
+*/
bool ServiceFwIPC::connect(const QString& aServerName)
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPC::connect");
@@ -69,9 +69,8 @@
}
/*!
- Disconnect from the server
- @return void
- */
+ Disconnect from the server.
+*/
void ServiceFwIPC::disconnect()
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPC::disconnect");
@@ -79,11 +78,11 @@
}
/*!
- Starts the service
- @param aServerName name of the server
- @param aExeName executable of the server
- @return true if connected
- */
+ Starts the service.
+ \param aServerName Name of the server.
+ \param aExeName Executable of the server.
+ \return true if connected.
+*/
bool ServiceFwIPC::startServer(const QString& aServerName,
const QString& aExeName,
quint64& processId,
@@ -94,11 +93,11 @@
}
/*!
- Send a request synchronously
- @param aRequestType name of the request
- @param aData data to send
- @return true if sent successful, otherwise false
- */
+ Send a request synchronously.
+ \param aRequestType Name of the request.
+ \param aData Data to send.
+ \return true if sent successful, otherwise false.
+*/
bool ServiceFwIPC::sendSync(const QString& aRequestType,
const QByteArray& aData)
{
@@ -115,12 +114,11 @@
/*!
- Send a request asynchronously
- @param aRequestType name of the request
- @param aData data to send
- @note Errors will be emitted via errors() signal
- @return void
- */
+ Send a request asynchronously.
+ \param aRequestType Name of the request.
+ \param aData Data to send.
+ \note Errors will be emitted via error() signal.
+*/
void ServiceFwIPC::sendAsync(const QString& aRequestType,
const QByteArray& aData)
{
@@ -132,17 +130,19 @@
iAsyncRequestPending = true;
}
-/**
-* Async read
- */
+/*!
+ Asynchronous read.
+ \param aArray Array where read data will be put.
+*/
void ServiceFwIPC::readAll(QByteArray& aArray)
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPC::readAll(1)");
d->readAll(aArray);
}
-/**
-* sync read
+/*!
+ Synchronous read.
+ \return Array which where read data is put.
*/
QByteArray ServiceFwIPC::readAll()
{
@@ -151,9 +151,9 @@
}
/*!
- Waits until data is available for reading
- @return true if data is available for reading
- */
+ Waits until data is available for reading.
+ \return true if data is available for reading.
+*/
bool ServiceFwIPC::waitForRead()
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPC::waitForRead");
@@ -161,10 +161,10 @@
}
/*!
- Check if an async request is already pending
- @return true if an async request is pending
- false otherwise
- */
+ Check if an async request is already pending.
+ \return true if an async request is pending,
+ false otherwise.
+*/
bool ServiceFwIPC::requestPending()
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPC::requestPending");
@@ -182,20 +182,24 @@
/*!
- \fn QtService::ServiceFwIPC::error( int aError )
+ \fn QtService::ServiceFwIPC::error( int aError )
- Signal emitted to handle any errors
- @param aError error code
- @note: For local socket implementation, the error can be interpreted
- as QLocalSocket::LocalSocketError
- @return void
- */
+ Signal emitted to handle any errors.
+ \param aError error code
+ \note For local socket implementation, the error can be interpreted
+ as QLocalSocket::LocalSocketError
+*/
/*!
- \fn QtService::ServiceFwIPC::readyRead()
+ \fn QtService::ServiceFwIPC::readyRead()
+
+ Handle when a reply has been received for async requests.
+ Emitted when the entire data packet has been received
+*/
- Handle when a reply has been received for async requests\n
- Emitted when the entire data packet has been received
- @return void
- */
+/*!
+ \fn QtService::ServiceFwIPC::ReadDone()
+
+ Emitted when reading has completed.
+*/
// END OF FILE
--- a/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_apasymbian.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_apasymbian.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -43,14 +43,13 @@
/*!
- \class CApaSymbianIPC
-
- Symbian Client backend for the service IPC
- */
+ \class CApaSymbianIPC
+ \brief Symbian Client backend for the service IPC
+*/
/*!
- Constructor
- */
+ Constructor.
+*/
CApaSymbianIPC::CApaSymbianIPC() :
CActive(CActive::EPriorityStandard), iDataSize(0)
{
@@ -59,8 +58,8 @@
}
/*!
- Destructor
- */
+ Destructor.
+*/
CApaSymbianIPC::~CApaSymbianIPC()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::~CApaSymbianIPC");
@@ -70,8 +69,8 @@
}
/*!
- 2nd phased constructor
- */
+ 2nd phased constructor.
+*/
void CApaSymbianIPC::ConstructL()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::ConstructL");
@@ -79,8 +78,8 @@
}
/*!
- Two Phased Constructor
- */
+ Two Phased Constructor.
+*/
CApaSymbianIPC* CApaSymbianIPC::NewL()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::NewL");
@@ -92,10 +91,10 @@
}
/*!
- Connect to the server
- @param aServerName name of the server to connect to
- @return true if connected, false if not
- */
+ Connect to the server.
+ \param aServerName Name of the server to connect to.
+ \return true if connected, false if not.
+*/
bool CApaSymbianIPC::connect( const QString& aServerName )
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::connect");
@@ -114,8 +113,8 @@
}
/*!
- Disconnect from the server
- */
+ Disconnect from the server.
+*/
void CApaSymbianIPC::disconnect()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::disconnect");
@@ -131,10 +130,11 @@
}
/*!
- Starts the service
- @param aServerName server name
- @param aExeName server executable name
- */
+ Starts the service.
+ \param aServerName Server name.
+ \param aExeName Server executable name.
+ \return true if start was successful.
+*/
bool CApaSymbianIPC::startServer( const QString& aServerName,
const QString& /*aExeName*/,
quint64& processId,
@@ -165,10 +165,11 @@
}
/*!
- Send a request synchronously
- @param aRequestType type of request to send to the server
- @param aData data to send to the server
- */
+ Send a request synchronously.
+ \param aRequestType Type of request to send to the server.
+ \param aData Data to send to the server.
+ \return true if send was successful.
+*/
bool CApaSymbianIPC::sendSync( const QString& aRequestType, const QByteArray& aData )
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::sendSync");
@@ -204,9 +205,10 @@
}
-/*
- * read sync
- */
+/*!
+ Read sync.
+ \return Result of read as QByteArray.
+*/
QByteArray CApaSymbianIPC::readAll()
{
// this is sync operation
@@ -248,10 +250,10 @@
/*!
- Send a request asynchronously
- @param aRequestType type of request to send to the server
- @param aData data to send to the server
- */
+ Send a request asynchronously.
+ \param aRequestType Type of request to send to the server.
+ \param aData Data to send to the server.
+*/
void CApaSymbianIPC::sendAsync(const QString& aRequestType,
const QByteArray& aData )
{
@@ -305,9 +307,9 @@
}
/*!
- Reads all data pending in the buffer, leaves if an error occured
- @return QByteArray containing the result data
- */
+ Reads all data pending in the buffer, leaves if an error occured
+ \return QByteArray Containing the result data.
+*/
void CApaSymbianIPC::doReadAllL(QByteArray& aArray)
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::doReadAllL");
@@ -331,10 +333,10 @@
/*!
- Maps error codes from Symbian error codes to Service IPC error codes
- @param aError Symbian error code
- @return mapped error code
- */
+ Maps error codes from Symbian error codes to Service IPC error codes
+ \param aError Symbian error code.
+ \return Mapped error code.
+*/
int CApaSymbianIPC::doMapErrors(TInt aError)
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::doMapErrors");
@@ -378,9 +380,9 @@
return error;
}
/*!
- Waits until data is available for reading
- @return bool always true, no need to wait
- */
+ Waits until data is available for reading.
+ \return bool always true, no need to wait.
+*/
bool CApaSymbianIPC::waitForRead()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::waitForRead");
@@ -389,8 +391,8 @@
}
/*!
- Active object callback
- */
+ Active object callback
+*/
TInt CApaSymbianIPC::RunError(TInt err)
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::error %d", err);
@@ -399,6 +401,9 @@
return KErrNone;
}
+/*!
+ Active object RunL function.
+*/
void CApaSymbianIPC::RunL()
{
int err = iStatus.Int();
@@ -441,8 +446,8 @@
}
/*!
- Active object cancel
- */
+ Active object cancel
+*/
void CApaSymbianIPC::DoCancel()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::DoCancel");
@@ -464,8 +469,8 @@
}
/*!
- HandleServerAppExit
- */
+ HandleServerAppExit
+*/
void CApaSymbianIPC::HandleServerAppExit(int aReason)
{
XQSERVICE_DEBUG_PRINT("CApaSymbianIPC::HandleServerAppExit");
--- a/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_apasymbiansession.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_apasymbiansession.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -36,14 +36,13 @@
/*!
\class RApaIPCSession
-
- Symbian class encapsulating RMessage2 interface
+ \brief Symbian class encapsulating RMessage2 interface
*/
/*!
- Send a message
- @param aFunction function code
- @return message completion code
+ Send a message.
+ \param aFunction Function code.
+ \return message Completion code.
*/
TInt RApaIPCSession::SendReceiveL(TInt aFunction) const
{
@@ -52,10 +51,10 @@
}
/*!
- Send a message
- @param aFunction function code
- @param aArgs parameter to server
- @return message completion code
+ Send a message.
+ \param aFunction Function code.
+ \param aArgs Parameter to server.
+ \return Message completion code.
*/
TInt RApaIPCSession::SendReceiveL(TInt aFunction, const TIpcArgs& aArgs) const
{
@@ -64,10 +63,10 @@
}
/*!
- Send message asynchronously
- @param aFunction function code
- @param aStatus the request status object used to contain the
- completion status of the request
+ Send message asynchronously.
+ \param aFunction Function code.
+ \param aStatus The request status object used to contain the
+ completion status of the request.
*/
EXPORT_C void RApaIPCSession::SendReceive(TInt aFunction,
TRequestStatus& aStatus) const
@@ -78,11 +77,11 @@
}
/*!
- Send message asynchronously
- @param aFunction function code
- @param aArgs parameter to server
- @param aStatus the request status object used to contain the
- completion status of the request
+ Send message asynchronously.
+ \param aFunction Function code.
+ \param aArgs Parameter to server.
+ \param aStatus The request status object used to contain the
+ completion status of the request.
*/
void RApaIPCSession::SendReceive(TInt aFunction,
const TIpcArgs& aArgs,
@@ -94,10 +93,10 @@
}
/*!
- Connect to server
- @param aServer server name
- @param aVersion version of the server
- @return KErrNone success, otherwise system error code
+ Connect to server.
+ \param aServer Server name.
+ \param aVersion Version of the server.
+ \return KErrNone on success, otherwise system error code.
*/
TInt RApaIPCSession::Connect(const TDesC& aServer,
const TVersion& aVersion)
@@ -109,8 +108,8 @@
}
/*!
- Get version info
- @return version info
+ Get version info.
+ \return Version info.
*/
TVersion RApaIPCSession::Version() const
{
@@ -118,13 +117,20 @@
return iVersion;
}
-
+/*!
+ Get service uid.
+ \return Service uid.
+*/
TUid RApaIPCSession::ServiceUid() const
{
XQSERVICE_DEBUG_PRINT("RApaIPCSession::ServiceUid");
return iUid;
}
+/*!
+ Set service uid.
+ \param uid Service uid to set.
+*/
void RApaIPCSession::setServiceUid(TInt uid)
{
XQSERVICE_DEBUG_PRINT("RApaIPCSession::setServiceUid %x", uid);
--- a/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_p.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_p.h Thu Sep 02 21:20:48 2010 +0300
@@ -28,68 +28,69 @@
namespace QtService {
- /**
- * Private implementation class for IPC
- */
+ /*!
+ \class ServiceFwIPCPrivate
+ \brief Private implementation class for IPC
+ */
class ServiceFwIPC;
class ServiceFwIPCPrivate
{
public:
- /**
- * Virtual destructor
- */
+ /*!
+ Virtual destructor
+ */
virtual ~ServiceFwIPCPrivate() {};
// Virtual functions
- /**
- * Connect to the server
- * @param aServerName name of the server to connect to
- * @return true if connected, false if not
- */
+ /*!
+ Connect to the server.
+ \param aServerName Name of the server to connect to.
+ \return true if connected, false if not.
+ */
virtual bool connect(const QString& aServerName) = 0;
- /**
- * Disconnect from the server
- */
+ /*!
+ Disconnect from the server.
+ */
virtual void disconnect() = 0;
- /**
- * Starts the service
- * @note: refer to public API ServiceFwIPC
- */
+ /*!
+ Starts the service.
+ \note Refer to public API ServiceFwIPC.
+ */
virtual bool startServer(const QString& aServerName,
const QString& aExeName,
quint64& processId,
int options = 0 ) = 0;
- /**
- * Send a request synchronously
- * @note: refer to public API ServiceFwIPC
- */
+ /*!
+ Send a request synchronously.
+ \note Refer to public API ServiceFwIPC.
+ */
virtual bool sendSync(const QString& aRequestType,
const QByteArray& aData) = 0;
- /**
- * Send a request asynchronously
- * @note: refer to public API ServiceFwIPC
- */
+ /*!
+ Send a request asynchronously.
+ \note Refer to public API ServiceFwIPC.
+ */
virtual void sendAsync(const QString& aRequestType,
const QByteArray& aData) = 0;
- /**
- * Reads all data pending in the buffer
- * @note: refer to public API ServiceFwIPC
- */
+ /*!
+ Reads all data pending in the buffer.
+ \note Refer to public API ServiceFwIPC.
+ */
virtual void readAll(QByteArray& aArray) = 0;
virtual QByteArray readAll() = 0;
- /**
- * Waits until data is available for reading
- * @note: refer to public API ServiceFwIPC
- */
+ /*!
+ Waits until data is available for reading.
+ \note Refer to public API ServiceFwIPC.
+ */
virtual bool waitForRead() = 0;
virtual void setUserData(const void *data) {userData = data;};
--- a/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_symbian.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_symbian.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -41,14 +41,13 @@
/*!
- \class CServiceSymbianIPC
-
- Symbian Client backend for the service IPC
- */
+ \class CServiceSymbianIPC
+ \brief Symbian Client backend for the service IPC
+*/
/*!
- Constructor
- */
+ Constructor.
+*/
CServiceSymbianIPC::CServiceSymbianIPC() :
CActive(CActive::EPriorityStandard), iDataSize(0)
{
@@ -57,8 +56,8 @@
}
/*!
- Destructor
- */
+ Destructor.
+*/
CServiceSymbianIPC::~CServiceSymbianIPC()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::~CServiceSymbianIPC");
@@ -68,15 +67,15 @@
}
/*!
- 2nd phased constructor
- */
+ 2nd phased constructor.
+*/
void CServiceSymbianIPC::ConstructL()
{
}
/*!
- Two Phased Constructor
- */
+ Two Phased Constructor.
+*/
CServiceSymbianIPC* CServiceSymbianIPC::NewL()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::NewL");
@@ -88,10 +87,10 @@
}
/*!
- Connect to the server
- @param aServerName name of the server to connect to
- @return true if connected, false if not
- */
+ Connect to the server.
+ \param aServerName Name of the server to connect to.
+ \return true if connected, false if not.
+*/
bool CServiceSymbianIPC::connect(const QString& aServerName)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::connect");
@@ -106,8 +105,8 @@
}
/*!
- Disconnect from the server
- */
+ Disconnect from the server.
+*/
void CServiceSymbianIPC::disconnect()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::disconnect");
@@ -116,10 +115,11 @@
}
/*!
- Starts the service
- @param aServerName server name
- @param aExeName server executable name
- */
+ Starts the service.
+ \param aServerName Server name.
+ \param aExeName Server executable name.
+ \return true if successful.
+*/
bool CServiceSymbianIPC::startServer(const QString& /*aServerName*/,
const QString& aExeName,
quint64& /*processId*/,
@@ -132,10 +132,11 @@
}
/*!
- Send a request synchronously
- @param aRequestType type of request to send to the server
- @param aData data to send to the server
- */
+ Send a request synchronously.
+ \param aRequestType Type of request to send to the server.
+ \param aData Data to send to the server.
+ \return true if successful.
+*/
bool CServiceSymbianIPC::sendSync(const QString& aRequestType,
const QByteArray& aData)
{
@@ -170,8 +171,9 @@
}
-/*
-* read sync
+/*!
+ Read sync.
+ \return Result of the read.
*/
QByteArray CServiceSymbianIPC::readAll()
{
@@ -192,8 +194,8 @@
return rtn;
}
-/**
-* read sync
+/*!
+ Read sync.
*/
QByteArray CServiceSymbianIPC::doReadAllL()
{
@@ -218,10 +220,10 @@
/*!
- Send a request asynchronously
- @param aRequestType type of request to send to the server
- @param aData data to send to the server
- */
+ Send a request asynchronously.
+ \param aRequestType Type of request to send to the server.
+ \param aData Data to send to the server.
+*/
void CServiceSymbianIPC::sendAsync(const QString& aRequestType,
const QByteArray& aData)
{
@@ -255,9 +257,10 @@
iState = ESend;
SetActive();
}
-/*
- * read async
- */
+/*!
+ Read async.
+ \param aArray Array where result will be put.
+*/
void CServiceSymbianIPC::readAll(QByteArray& aArray)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::readAll");
@@ -274,9 +277,9 @@
}
/*!
- Reads all data pending in the buffer, leaves if an error occured
- @return QByteArray containing the result data
- */
+ Reads all data pending in the buffer, leaves if an error occured.
+ \param aArray QByteArray containing the result data.
+*/
void CServiceSymbianIPC::doReadAllL(QByteArray& aArray)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::doReadAllL");
@@ -298,10 +301,10 @@
/*!
- Maps error codes from Symbian error codes to Service IPC error codes
- @param aError Symbian error code
- @return mapped error code
- */
+ Maps error codes from Symbian error codes to Service IPC error codes.
+ \param aError Symbian error code.
+ \return Mapped error code.
+*/
int CServiceSymbianIPC::doMapErrors(TInt aError)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::doMapErrors");
@@ -339,9 +342,9 @@
return error;
}
/*!
- Waits until data is available for reading
- @return bool always true, no need to wait
- */
+ Waits until data is available for reading
+ \return bool Always true, no need to wait
+*/
bool CServiceSymbianIPC::waitForRead()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::waitForRead");
@@ -350,8 +353,8 @@
}
/*!
- Active object callback
- */
+ Active object callback.
+*/
TInt CServiceSymbianIPC::RunError(TInt err)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::error");
@@ -359,6 +362,9 @@
return KErrNone;
}
+/*!
+ Active object RunL() function.
+*/
void CServiceSymbianIPC::RunL()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::RunL");
@@ -401,8 +407,8 @@
}
/*!
- Active object cancel
- */
+ Active object cancel.
+*/
void CServiceSymbianIPC::DoCancel()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianIPC::DoCancel");
--- a/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_symbiansession.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipc/xqserviceipc_symbiansession.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -28,15 +28,14 @@
// ============================== MEMBER FUNCTIONS ============================
/*!
- \class RServiceIPCSession
-
- Symbian class encapsulating RMessage2 interface
+ \class RServiceIPCSession
+ \brief Symbian class encapsulating RMessage2 interface
*/
/*!
- Send a message
- @param aFunction function code
- @return message completion code
+ Send a message.
+ \param aFunction Function code.
+ \return Message completion code.
*/
TInt RServiceIPCSession::SendReceiveL(TInt aFunction) const
{
@@ -51,10 +50,10 @@
}
/*!
- Send a message
- @param aFunction function code
- @param aArgs parameter to server
- @return message completion code
+ Send a message.
+ \param aFunction Function code.
+ \param aArgs Parameter to server.
+ \return Message completion code.
*/
TInt RServiceIPCSession::SendReceiveL(TInt aFunction, const TIpcArgs& aArgs) const
{
@@ -63,11 +62,11 @@
}
/*!
- Send message asynchronously
- @param aFunction function code
- @param aStatus the request status object used to contain the
- completion status of the request
- */
+ Send message asynchronously.
+ \param aFunction Function code.
+ \param aStatus The request status object used to contain the
+ completion status of the request.
+*/
EXPORT_C void RServiceIPCSession::SendReceive(TInt aFunction,
TRequestStatus& aStatus) const
{
@@ -76,12 +75,12 @@
}
/*!
- Send message asynchronously
- @param aFunction function code
- @param aArgs parameter to server
- @param aStatus the request status object used to contain the
- completion status of the request
- */
+ Send message asynchronously.
+ \param aFunction Function code.
+ \param aArgs Parameter to server.
+ \param aStatus The request status object used to contain the
+ completion status of the request.
+*/
void RServiceIPCSession::SendReceive(TInt aFunction,
const TIpcArgs& aArgs,
TRequestStatus& aStatus) const
@@ -91,11 +90,11 @@
}
/*!
- Connect to server
- @param aServer server name
- @param aVersion version of the server
- @return KErrNone success, otherwise system error code
- */
+ Connect to server.
+ \param aServer server name.
+ \param aVersion version of the server.
+ \return KErrNone success, otherwise system error code.
+*/
TInt RServiceIPCSession::Connect(const TDesC& aServer, const TVersion& aVersion)
{
QString server = QString::fromUtf16(aServer.Ptr(), aServer.Length());
@@ -105,9 +104,9 @@
}
/*!
- Get version info
- @return version info
- */
+ Get version info.
+ \return Version info.
+*/
TVersion RServiceIPCSession::Version() const
{
XQSERVICE_DEBUG_PRINT("RServiceIPCSession::Version");
@@ -115,10 +114,10 @@
}
/*!
- Start the server
- @param aImage binary name to start
- @return KErrNone if started properly
- */
+ Start the server .
+ \param aImage Binary name to start.
+ \return KErrNone if started properly.
+*/
TInt RServiceIPCSession::StartServer(const TDesC& aImage)
{
XQSERVICE_DEBUG_PRINT("RServiceIPCSession::StartServer");
--- a/qthighway/xqserviceipc/xqserviceipc/xqserviceipcfactory.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipc/xqserviceipcfactory.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -29,31 +29,31 @@
#endif // __SYMBIAN32__
namespace QtService
{
-/*!
- \class ServiceFwIPCFactory
-
- Factory class for constructing the IPC backend
- */
/*!
- Constructor
- */
+ \class ServiceFwIPCFactory
+ \brief Factory class for constructing the IPC backend
+*/
+
+/*!
+ Constructor.
+*/
ServiceFwIPCFactory::ServiceFwIPCFactory()
{
}
/*!
- Destructor
- */
+ Destructor.
+*/
ServiceFwIPCFactory::~ServiceFwIPCFactory()
{
}
/*!
- Check to see if the particular IPC type is supported
- @param aIPCType type of the IPC
- @return true if the IPC type is supported, false otherwise
- */
+ Check to see if the particular IPC type is supported.
+ \param aIPCType Type of the IPC.
+ \return true If the IPC type is supported, false otherwise.
+*/
bool ServiceFwIPCFactory::isIPCTypeSupported(TServiceIPCBackends aIPCType)
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPCFactory::isIPCTypeSupported");
@@ -71,10 +71,10 @@
}
/*!
- Create an instance of the Service IPC backend
- @param aBackend Type of backend to create
- @return ServiceFwIPCPrivate instance
- */
+ Create an instance of the Service IPC backend.
+ \param aBackend Type of backend to create.
+ \return ServiceFwIPCPrivate instance.
+*/
ServiceFwIPCPrivate* ServiceFwIPCFactory::createBackend(TServiceIPCBackends aBackend)
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPCFactory::createBackend");
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcobserver.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcobserver.h Thu Sep 02 21:20:48 2010 +0300
@@ -28,33 +28,31 @@
class ServiceIPCRequest;
- /**
- * Interface Observer class to handle IPC related events
- */
+ /*!
+ \brief Interface Observer class to handle IPC related events
+ */
class MServiceIPCObserver
{
public:
- /**
- * Handle a new request.
- * @param aRequest request object, ownership NOT passed
- * @return bool true if handled
- */
+ /*!
+ Handle a new request.
+ \param aRequest Request object, ownership NOT passed.
+ \return true if handled.
+ */
virtual bool handleRequest(ServiceIPCRequest *aRequest) = 0;
- /**
- * Handle cancellation of the given request object.
- * @param aRequest request object that is going to be cancelled, ownership NOT passed
- * @return void
- */
+ /*!
+ Handle cancellation of the given request object.
+ \param aRequest Request object that is going to be cancelled, ownership NOT passed.
+ */
virtual void handleCancelRequest(ServiceIPCRequest *aRequest) = 0;
- /**
- * About to delete the given request object. Observer can make necessary cleanup.
- * @param aRequest request object that is going to be cancelled, ownership NOT passed
- * Object will be deleted after callback returns
- * @return void
- */
+ /*!
+ About to delete the given request object. Observer can make necessary cleanup.
+ \param aRequest Request object that is going to be cancelled, ownership NOT passed.
+ Object will be deleted after callback returns.
+ */
virtual void handleDeleteRequest(ServiceIPCRequest *aRequest) = 0;
};
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcrequest.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcrequest.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -29,16 +29,16 @@
namespace QtService
{
/*!
- \class ServiceIPCRequest
- Class to encapsulate a service request
- */
+ \class ServiceIPCRequest
+ \brief Class to encapsulate a service request
+*/
/*!
- Constructor
- @param aSession session associated with this request
- @param aDataLength amount of data to be received in this request
- @param aRequestOp operaion name
- */
+ Constructor.
+ \param aSession Session associated with this request.
+ \param aDataLength Amount of data to be received in this request.
+ \param aRequestOp Operation name.
+*/
ServiceIPCRequest::ServiceIPCRequest(ServiceIPCSession* aSession,
qint64 aDataLength,
const QString& aRequestOp) :
@@ -56,9 +56,9 @@
}
/*!
- Copy Constructor
- @param aRequest request to be copied
- */
+ Copy Constructor.
+ \param aRequest Request to be copied.
+*/
ServiceIPCRequest::ServiceIPCRequest(ServiceIPCRequest& aRequest)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::ServiceIPCRequest(2)");
@@ -84,8 +84,8 @@
}
/*!
- Destructor
- */
+ Destructor.
+*/
ServiceIPCRequest::~ServiceIPCRequest()
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::~ServiceIPCRequest");
@@ -93,10 +93,10 @@
}
/*!
- Assignment operator
- @param aRequest request to be assigned
- @return ServiceIPCRequest assigned request
- */
+ Assignment operator.
+ \param aRequest Request to be assigned.
+ \return ServiceIPCRequest assigned request.
+*/
ServiceIPCRequest& ServiceIPCRequest::operator=(ServiceIPCRequest& aRequest)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::operator=");
@@ -127,9 +127,9 @@
}
/*!
- Get the requested operation
- @return QString operation ID
- */
+ Get the requested operation.
+ \return QString operation ID.
+*/
const QString& ServiceIPCRequest::getOperation()
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::getOperation");
@@ -138,9 +138,9 @@
}
/*!
- Get the requested data
- @return QByteArray data for this operation
- */
+ Get the requested data.
+ \return QByteArray data for this operation.
+*/
const QByteArray& ServiceIPCRequest::getData()
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::getData");
@@ -149,9 +149,9 @@
}
/*!
- Write some data to the request
- @param aData data to write to the socket
- */
+ Write some data to the request.
+ \param aData Data to write to the socket.
+*/
bool ServiceIPCRequest::write(const QByteArray& aData)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::write");
@@ -161,9 +161,9 @@
}
/*!
- Complete the request
- @return true if request completed successfully
- */
+ Complete the request.
+ \return true if request completed successfully.
+*/
bool ServiceIPCRequest::completeRequest()
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::completeRequest");
@@ -171,10 +171,10 @@
}
/*!
- Append more data when creating the request
- @arg aMoreData data to be appended to the request
- @return true if iDataLength now equals the full length
- */
+ Append more data when creating the request.
+ \param aMoreData Data to be appended to the request.
+ \return true if iDataLength now equals the full length.
+*/
bool ServiceIPCRequest::addRequestdata(const QByteArray& aMoreData)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::addRequestdata");
@@ -184,9 +184,9 @@
}
/*!
- Sets the client info. Onwership of the object is passed in.
- @arg aClientInfo Client information
- */
+ Sets the client info. Onwership of the object is passed in.
+ \param aClientInfo Client information.
+*/
void ServiceIPCRequest::setClientInfo(ClientInfo *aClientInfo)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::setClientInfo");
@@ -201,9 +201,9 @@
}
/*!
- Gets the client info.
- @return Client Information object. NULL if none is available
- */
+ Gets the client info.
+ \return Client Information object, NULL if none is available.
+*/
ClientInfo* ServiceIPCRequest::clientInfo()
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::clientInfo");
@@ -211,9 +211,9 @@
}
/*!
- Gets the session.
- @return ServiceIPCSession. NULL if none is available
- */
+ Gets the session.
+ \return ServiceIPCSession, NULL if none is available.
+*/
ServiceIPCSession* ServiceIPCRequest::getSession()
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::getSession");
@@ -221,9 +221,9 @@
}
/*!
- Sets id of the request.
- @arg id Identifier of the request.
- */
+ Sets id of the request.
+ \param aId Identifier of the request.
+*/
void ServiceIPCRequest::setId(int aId)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::setId");
@@ -232,9 +232,9 @@
}
/*!
- Returns id of the request.
- @return Id of the request.
- */
+ Returns id of the request.
+ \return Id of the request.
+*/
int ServiceIPCRequest::id() const
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::id");
@@ -243,9 +243,9 @@
}
/*!
- Sets asynchcronous flag to true or false.
- @arg A value of the async flag.
- */
+ Sets asynchcronous flag to true or false.
+ \param aAsync Value of the async flag.
+*/
void ServiceIPCRequest::setAsync(bool aAsync)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::setAsync");
@@ -254,9 +254,9 @@
}
/*!
- Returns asynch flag.
- @return True if the request is asynchronous. False, if synchronous
- */
+ Returns async flag.
+ \return True if the request is asynchronous. False, if synchronous.
+*/
bool ServiceIPCRequest::isAsync() const
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::getAsync");
@@ -264,8 +264,10 @@
return iAsync;
}
-
-// Set request info passed alomg with the request
+/*!
+ Set request info passed along with the request.
+ \param info Info to be passed with the request.
+*/
void ServiceIPCRequest::setRequestInfo(XQRequestInfo *info)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::setRequestInfo");
@@ -285,12 +287,21 @@
}
}
+/*!
+ Get info added to the request.
+ \return Info to be passed with the request.
+*/
XQRequestInfo ServiceIPCRequest::requestInfo() const
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::requestInfo");
return iRequestInfo;
}
+/*!
+ Add sharable file to be passed with the request.
+ \param file Sharable file to be added to the request.
+ \param index Currently not used.
+*/
void ServiceIPCRequest::addSharableFile(XQSharableFile *file, int index)
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::setSharableFile");
@@ -298,6 +309,10 @@
iSharableFiles.append(*file);
}
+/*!
+ Get sharable file from request.
+ \param index Index of the sharable file to get.
+*/
XQSharableFile ServiceIPCRequest::sharableFile(int index) const
{
XQSERVICE_DEBUG_PRINT("ServiceIPCRequest::setSharableFile");
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -29,15 +29,15 @@
namespace QtService
{
/*!
- \class ServiceFwIPCServer
- Service Framework IPC Server public class
- */
+ \class ServiceFwIPCServer
+ \brief Service Framework IPC Server public class
+*/
/*!
- Constructor
- @param aBackend backend to instantiate
- @param aObserver engine observer to call back to handle new requests
- @param aParent QObject's parent
+ Constructor.
+ \param aObserver Engine observer to call back to handle new requests.
+ \param aParent QObject's parent.
+ \param aBackend Backend to instantiate.
*/
ServiceFwIPCServer::ServiceFwIPCServer( MServiceIPCObserver* aObserver,
QObject* aParent,
@@ -52,8 +52,8 @@
}
/*!
- Destructor
- */
+ Destructor.
+*/
ServiceFwIPCServer::~ServiceFwIPCServer()
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPCServer::~ServiceFwIPCServer");
@@ -61,10 +61,10 @@
}
/*!
- Start listening for new service requests
- @param aServerName name of the server
- @return bool if connected
- */
+ Start listening for new service requests.
+ \param aServerName Name of the server.
+ \return true if connected.
+*/
bool ServiceFwIPCServer::listen(const QString& aServerName)
{
XQSERVICE_DEBUG_PRINT("aServerName: %s", qPrintable(aServerName));
@@ -73,9 +73,8 @@
}
/*!
- Shutdown the server and stop serving clients
- @return void
- */
+ Shutdown the server and stop serving clients.
+*/
void ServiceFwIPCServer::disconnect()
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPCServer::disconnect");
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbianserver.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbianserver.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -54,12 +54,12 @@
/*!
\class CApaSymbianServer
- Symbian client server implementation
+ \brief Symbian client server implementation
*/
/*!
- Constructor
- */
+ Constructor.
+*/
CApaSymbianServer::CApaSymbianServer() /*:
CPolicyServer( EServerPriority, KServerPolicy)*/
{
@@ -68,15 +68,15 @@
}
/*!
- 2nd phased constructor
- */
+ 2nd phased constructor
+*/
void CApaSymbianServer::ConstructL()
{
}
/*!
- Two phased constructor
- */
+ Two phased constructor
+*/
CApaSymbianServer* CApaSymbianServer::NewL()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianServer::NewL");
@@ -88,17 +88,18 @@
}
/*!
- Destructor
- */
+ Destructor
+*/
CApaSymbianServer::~CApaSymbianServer()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianServer::~CApaSymbianServer");
}
/*!
- Start listening for new service requests
- @param aServerName name of the server
- */
+ Start listening for new service requests.
+ \param aServerName name of the server.
+ \return true if successful.
+*/
bool CApaSymbianServer::listen( const QString& aServerName )
{
XQSERVICE_DEBUG_PRINT("CApaSymbianServer::listen");
@@ -123,8 +124,8 @@
}
/*!
- Shutdown the server and stop serving clients
- */
+ Shutdown the server and stop serving clients.
+*/
void CApaSymbianServer::disconnect()
{
XQSERVICE_DEBUG_PRINT("CApaSymbianServer::disconnect");
@@ -133,10 +134,10 @@
}
/*!
- Create a new session, derived from CPolicyServer
- @param aVersion version of the server
- @param aMessage message object
- */
+ Create a new session, derived from CPolicyServer.
+ \param aVersion Version of the server.
+ \param aMessage Message object.
+*/
CSession2* CApaSymbianServer::NewSessionL(const TVersion& aVersion,
const RMessage2& aMessage) const
{
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbiansession.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_apasymbiansession.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -37,14 +37,14 @@
/*!
- \class CApaServerSymbianSession
- Symbian Session class
- */
+ \class CApaServerSymbianSession
+ \brief Symbian Session class
+*/
/*!
- Constructor
- @param aObserver observer to the server
- */
+ Constructor.
+ \param aObserver Observer to the server.
+*/
CApaServerSymbianSession::CApaServerSymbianSession(MServiceIPCObserver* aObserver) :
ServiceIPCSession(aObserver)
{
@@ -52,16 +52,16 @@
}
/*!
- 2nd phased constructor
- */
+ 2nd phased constructor.
+*/
void CApaServerSymbianSession::ConstructL()
{
}
/*!
- Two-Phased Constructor
- @param aObserver observer to the server
- */
+ Two-Phased Constructor.
+ \param aObserver Observer to the server.
+*/
CApaServerSymbianSession* CApaServerSymbianSession::NewL(MServiceIPCObserver* aObserver)
{
XQSERVICE_DEBUG_PRINT("CApaServerSymbianSession::NewL");
@@ -74,8 +74,8 @@
}
/*!
- Destructor
- */
+ Destructor.
+*/
CApaServerSymbianSession::~CApaServerSymbianSession()
{
XQSERVICE_DEBUG_PRINT("CApaServerSymbianSession::~CApaServerSymbianSession");
@@ -87,10 +87,10 @@
}
/*!
- Write some data in response to a request
- @param aData some data to write as response
- @return bool if write was successful
- */
+ Write some data in response to a request.
+ \param aData Some data to write as response.
+ \return bool If write was successful.
+*/
bool CApaServerSymbianSession::write( const QByteArray& aData )
{
XQSERVICE_DEBUG_PRINT("CApaServerSymbianSession::write");
@@ -101,9 +101,9 @@
}
/*!
- Complete a Request
- @return bool if request completed
- */
+ Complete a request.
+ \return true if request completed
+*/
bool CApaServerSymbianSession::completeRequest()
{
XQSERVICE_DEBUG_PRINT("CApaServerSymbianSession::completeRequest");
@@ -119,8 +119,8 @@
}
/*!
- Close a session and gracefully shutdown
- */
+ Close a session and gracefully shutdown.
+*/
void CApaServerSymbianSession::close()
{
XQSERVICE_DEBUG_PRINT("CApaServerSymbianSession::close");
@@ -128,10 +128,9 @@
}
/*!
- From CSession2
- Service request
- @param aMessage message object
- */
+ From CSession2. Service request.
+ \param aMessage Message object.
+*/
void CApaServerSymbianSession::ServiceL(const RMessage2& aMessage)
{
XQSERVICE_DEBUG_PRINT("CApaServerSymbianSession::ServiceL");
@@ -176,10 +175,10 @@
}
/*!
- From CSession2
- Handle any disconnection from the client
- @param aMessage message Object
- */
+ From CSession2.
+ Handle any disconnection from the client.
+ \param aMessage Message Object.
+*/
void CApaServerSymbianSession::Disconnect(const RMessage2 &aMessage)
{
XQSERVICE_DEBUG_PRINT("CApaServerSymbianSession::Disconnect");
@@ -191,9 +190,9 @@
}
/*!
- Handle an IPC request
- @param aMessage message Object
- */
+ Handle an IPC request.
+ \param aMessage Message Object.
+*/
void CApaServerSymbianSession::handleRequestL( const RMessage2& aMessage )
{
XQSERVICE_DEBUG_PRINT("CApaServerSymbianSession::handleRequestL");
@@ -264,7 +263,8 @@
}
/*!
- Handle getting the result buffer
+ Handle getting the result buffer.
+ \param aMessage Message Object.
*/
void CApaServerSymbianSession::handleGetBufferL( const RMessage2& aMessage )
{
@@ -276,10 +276,10 @@
}
/*!
- Read a 16 bit descriptor from the message
- @param aMessage message to read from,
- @param aMsgSlot slot to read from
- */
+ Read a 16 bit descriptor from the message.
+ \param aMessage Message to read from.
+ \param aMsgSlot Slot to read from.
+*/
HBufC* CApaServerSymbianSession::ReadDesLC(const RMessage2& aMessage,
TInt aMsgSlot)
{
@@ -292,9 +292,9 @@
}
/*!
- Read a 8 bit descriptor from the message
- @param aMessage message to read from,
- @param aMsgSlot slot to read from
+ Read a 8 bit descriptor from the message.
+ \param aMessage Message to read from.
+ \param aMsgSlot Slot to read from.
*/
HBufC8* CApaServerSymbianSession::ReadDes8LC(const RMessage2& aMessage,
TInt aMsgSlot)
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_symbianserver.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_symbianserver.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -53,13 +53,13 @@
// ======== MEMBER FUNCTIONS ========
/*!
- \class CServiceSymbianServer
- Symbian client server implementation
- */
+ \class CServiceSymbianServer
+ \brief Symbian client server implementation
+*/
/*!
- Constructor
- */
+ Constructor.
+*/
CServiceSymbianServer::CServiceSymbianServer() :
CPolicyServer(EServerPriority, KServerPolicy)
{
@@ -67,15 +67,15 @@
}
/*!
- 2nd phased constructor
- */
+ 2nd phased constructor.
+*/
void CServiceSymbianServer::ConstructL()
{
}
/*!
- Two phased constructor
- */
+ Two phased constructor.
+*/
CServiceSymbianServer* CServiceSymbianServer::NewL()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianServer::NewL");
@@ -87,17 +87,18 @@
}
/*!
- Destructor
- */
+ Destructor.
+*/
CServiceSymbianServer::~CServiceSymbianServer()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianServer::~CServiceSymbianServer");
}
/*!
- Start listening for new service requests
- @param aServerName name of the server
- */
+ Start listening for new service requests.
+ \param aServerName Name of the server.
+ \return true if successful.
+*/
bool CServiceSymbianServer::listen(const QString& aServerName)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianServer::listen");
@@ -121,8 +122,8 @@
}
/*!
- Shutdown the server and stop serving clients
- */
+ Shutdown the server and stop serving clients.
+*/
void CServiceSymbianServer::disconnect()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianServer::disconnect");
@@ -131,10 +132,10 @@
}
/*!
- Create a new session, derived from CPolicyServer
- @param aVersion version of the server
- @param aMessage message object
- */
+ Create a new session, derived from CPolicyServer.
+ \param aVersion Version of the server.
+ \param aMessage Message object.
+*/
CSession2* CServiceSymbianServer::NewSessionL(const TVersion& aVersion,
const RMessage2& aMessage) const
{
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_symbiansession.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserver_symbiansession.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -40,14 +40,14 @@
/*!
- \class CServiceSymbianSession
- Symbian Session class
- */
+ \class CServiceSymbianSession
+ \brief Symbian Session class
+*/
/*!
- Constructor
- @param aObserver observer to the server
- */
+ Constructor.
+ \param aObserver Observer to the server.
+*/
CServiceSymbianSession::CServiceSymbianSession(MServiceIPCObserver* aObserver) :
ServiceIPCSession(aObserver)
{
@@ -55,16 +55,16 @@
}
/*!
- 2nd phased constructor
- */
+ 2nd phased constructor.
+*/
void CServiceSymbianSession::ConstructL()
{
}
/*!
- Two-Phased Constructor
- @param aObserver observer to the server
- */
+ Two-Phased Constructor.
+ \param aObserver Observer to the server.
+*/
CServiceSymbianSession* CServiceSymbianSession::NewL(MServiceIPCObserver* aObserver)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::NewL");
@@ -77,8 +77,8 @@
}
/*!
- Destructor
- */
+ Destructor.
+*/
CServiceSymbianSession::~CServiceSymbianSession()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::~CServiceSymbianSession");
@@ -90,10 +90,10 @@
}
/*!
- Write some data in response to a request
- @param aData some data to write as response
- @return bool if write was successful
- */
+ Write some data in response to a request.
+ \param aData Some data to write as response.
+ \return bool if write was successful.
+*/
bool CServiceSymbianSession::write(const QByteArray& aData)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::write");
@@ -104,9 +104,9 @@
}
/*!
- Complete a Request
- @return bool if request completed
- */
+ Complete a Request.
+ \return bool if request completed
+*/
bool CServiceSymbianSession::completeRequest()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::completeRequest");
@@ -117,8 +117,8 @@
}
/*!
- Close a session and gracefully shutdown
- */
+ Close a session and gracefully shutdown.
+*/
void CServiceSymbianSession::close()
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::close");
@@ -126,10 +126,10 @@
}
/*!
- From CSession2
- Service request
- @param aMessage message object
- */
+ From CSession2.
+ Service request.
+ \param aMessage Message object.
+*/
void CServiceSymbianSession::ServiceL(const RMessage2& aMessage)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::ServiceL");
@@ -164,10 +164,10 @@
}
/*!
- From CSession2
- Handle any disconnection from the client
- @param aMessage message Object
- */
+ From CSession2.
+ Handle any disconnection from the client.
+ \param aMessage Message object.
+*/
void CServiceSymbianSession::Disconnect(const RMessage2 &aMessage)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::Disconnect");
@@ -175,9 +175,9 @@
}
/*!
- Handle an IPC request
- @param aMessage message Object
- */
+ Handle an IPC request.
+ \param aMessage Message object.
+*/
void CServiceSymbianSession::handleRequestL(const RMessage2& aMessage)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::handleRequestL");
@@ -248,8 +248,9 @@
}
/*!
- Handle getting the result buffer
- */
+ Handle getting the result buffer.
+ \param aMessage Message object.
+*/
void CServiceSymbianSession::handleGetBufferL(const RMessage2& aMessage)
{
XQSERVICE_DEBUG_PRINT("CServiceSymbianSession::handleGetBufferL");
@@ -260,9 +261,9 @@
}
/*!
- Read a 16 bit descriptor from the message
- @param aMessage message to read from,
- @param aMsgSlot slot to read from
+ Read a 16 bit descriptor from the message.
+ \param aMessage Message to read from.
+ \param aMsgSlot Slot to read from.
*/
HBufC* CServiceSymbianSession::ReadDesLC(const RMessage2& aMessage,
TInt aMsgSlot)
@@ -276,10 +277,10 @@
}
/*!
- Read a 8 bit descriptor from the message
- @param aMessage message to read from,
- @param aMsgSlot slot to read from
- */
+ Read a 8 bit descriptor from the message.
+ \param aMessage Message to read from.
+ \param aMsgSlot Slot to read from.
+*/
HBufC8* CServiceSymbianSession::ReadDes8LC(const RMessage2& aMessage,
TInt aMsgSlot)
{
@@ -312,9 +313,9 @@
return ret;
}
-//
-// Get client capabilities from the IPC request
-//
+/*!
+ Get client capabilities from the IPC request.
+*/
quint32 ClientCapabilities(const RMessage2& aMsg)
{
quint32 caps = 0;
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserverfactory.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserverfactory.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -30,31 +30,31 @@
{
/*!
- \class ServiceFwIPCServerFactory
- Factory class to construct IPC server backend
- */
+ \class ServiceFwIPCServerFactory
+ \brief Factory class to construct IPC server backend
+*/
/*!
- Destructor
- */
+ Destructor.
+*/
ServiceFwIPCServerFactory::~ServiceFwIPCServerFactory()
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPCServerFactory::~ServiceFwIPCServerFactory");
}
/*!
- Constructor
- */
+ Constructor.
+*/
ServiceFwIPCServerFactory::ServiceFwIPCServerFactory()
{
XQSERVICE_DEBUG_PRINT("ServiceFwIPCServerFactory::ServiceFwIPCServerFactory");
}
/*!
- Construct a backend
- @param aBackend backend to construct
- @param aParent parent to this QObject
- */
+ Construct a backend.
+ \param aBackend Backend to construct.
+ \param aParent Parent to this QObject.
+*/
ServiceFwIPCServerPrivate* ServiceFwIPCServerFactory::createBackend(QObject* aParent,
TServiceIPCBackends aBackend)
{
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserverprivate.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserverprivate.h Thu Sep 02 21:20:48 2010 +0300
@@ -33,10 +33,12 @@
class ServiceIPCSession;
class MServiceIPCObserver;
- /**
- * Private implementation interface for service framework server
- * This class is the abstract interface for all server backends
- */
+ /*!
+ \class ServiceFwIPCServerPrivate
+ \brief Private implementation interface for service framework server
+
+ This class is the abstract interface for all server backends.
+ */
class ServiceFwIPCServerPrivate : public QObjectPrivate
{
protected:
@@ -44,24 +46,23 @@
public:
- /**
- * Start listening for new service requests
- * @param aServerName name of the server
- * @return true if listen was successful
+ /*!
+ Start listening for new service requests.
+ \param aServerName Name of the server.
+ \return true if listen was successful.
*/
virtual bool listen( const QString& aServerName ) = 0;
- /**
- * Shutdown the server and stop serving clients
- * @return void
+ /*!
+ Shutdown the server and stop serving clients.
*/
virtual void disconnect() = 0;
protected:
- /**
- * Get the server observer
- * @return MServiceIPCObserver* observer to this server
+ /*!
+ Get the server observer.
+ \return MServiceIPCObserver* observer to this server.
*/
inline MServiceIPCObserver* Observer() { Q_Q(ServiceFwIPCServer); return q->iObserver; };
--- a/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserversession.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserversession.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -27,14 +27,14 @@
namespace QtService
{
/*!
- \class ServiceIPCSession
- Session class to hold the state of each connected client
- */
+ \class ServiceIPCSession
+ \brief Session class to hold the state of each connected client
+*/
/*!
- Constructor
- @param aObserver observer to the session
- */
+ Constructor.
+ \param aObserver Observer to the session.
+*/
ServiceIPCSession::ServiceIPCSession(MServiceIPCObserver* aObserver) :
iPendingRequest(false), iObserver(aObserver), iCurRequest(NULL)
{
@@ -42,32 +42,32 @@
}
/*!
- Destructor
- */
+ Destructor.
+*/
ServiceIPCSession::~ServiceIPCSession()
{
XQSERVICE_DEBUG_PRINT("ServiceIPCSession::~ServiceIPCSession");
}
/*!
- \fn QtService::ServiceIPCSession::write( const QByteArray& aData )
+ \fn QtService::ServiceIPCSession::write( const QByteArray& aData )
- Write some data in response to a request
- @param aData some data to write as response
- @return bool if write was successful
- */
+ Write some data in response to a request.
+ \param aData Some data to write as response.
+ \return bool If write was successful.
+*/
/*!
- \fn QtService::ServiceIPCSession::completeRequest()
+ \fn QtService::ServiceIPCSession::completeRequest()
- Complete a Request
- @return bool if request completed
- */
+ Complete a request.
+ \return bool if request completed .
+*/
/*!
- \fn QtService::ServiceIPCSession::close()
+ \fn QtService::ServiceIPCSession::close()
- Close a session and gracefully shutdown
- */
+ Close a session and gracefully shutdown.
+*/
}
// END OF FILE
--- a/qthighway/xqserviceutil/src/xqrequestinfo.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqrequestinfo.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -23,60 +23,111 @@
#include "xqrequestinfo.h"
#include "xqrequestutil.h"
+/*!
+ \class XQRequestInfo
+ \inpublicgroup QtBaseModule
+
+ \ingroup ipc
+ \brief The XQRequestInfo class encapsulates additional information of a service request
+
+ The XQRequestInfo class encapsulates additional information of a service request:
+ - For service provider it contains additional information of the service request, some set by the client, some set by the QtHighway framework.
+ - For client it gives possibility to add UI oriented options of the request
+ The XQRequestInfo is exported by the xqserviceutil library
+*/
+
+/*!
+ Constructor.
+*/
XQRequestInfo::XQRequestInfo()
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::XQRequestInfo");
}
+/*!
+ Destructor.
+*/
XQRequestInfo::~XQRequestInfo()
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::~XQRequestInfo");
}
+/*!
+ Requests service application to be launched as embedded mode.
+ \param on Set to true to turn embedded mode on.
+*/
void XQRequestInfo::setEmbedded(bool on)
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::setEmbedded %d", on);
setInfo(XQServiceUtils::OptEmbedded, on);
}
+/*!
+ Get embedded option value.
+ \return True if embedded mode is turned on, false otherwise.
+*/
bool XQRequestInfo::isEmbedded() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::isEmbedded");
return info(XQServiceUtils::OptEmbedded).toBool();
}
+/*!
+ Requests service application to be set to background before a slot call to service provider.
+ If this option is set to false or not set, the QtHighway does not alter the Z-order.
+ \param on Set to true if service application should be launched to background.
+*/
void XQRequestInfo::setBackground(bool on)
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::setBackground %d", on);
setInfo(XQServiceUtils::OptBackground, on);
}
+/*!
+ Get the value of the background option.
+ \return True if option has been set on, false otherwise.
+*/
bool XQRequestInfo::isBackground() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::isBackground");
return info(XQServiceUtils::OptBackground).toBool();
}
+/*!
+ Requests service application to be brought to foreground before a slot call to service provider.
+ If this option is false or not set, the QtHighway does not alter the Z-order.
+ \param on Set to true if service application should be launched to foreground.
+*/
void XQRequestInfo::setForeground(bool on)
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::setForeground %d", on);
setInfo(XQServiceUtils::OptForeground, on);
}
+/*!
+ Get the value of the foreground option.
+ \return True if option has been set on, false otherwise.
+*/
bool XQRequestInfo::isForeground() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::isForeground");
return info(XQServiceUtils::OptForeground).toBool();
}
-
+/*!
+ Gets the vaule of the synchronous option.
+ \return True if request is synchronous , false if asynchronous.
+*/
bool XQRequestInfo::isSynchronous() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::isSynchronous");
return info(XQServiceUtils::OptSynchronous).toBool();
}
-
+/*!
+ Gets the client's secure id option. Valid only for service provider.
+ \return Calling client's secure ID as defined by the Symbian OS platform security model.
+*/
quint32 XQRequestInfo::clientSecureId() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::clientSecureId");
@@ -86,6 +137,10 @@
return id;
}
+/*!
+ Gets the clients's vendor id option. Valid only for service provider.
+ \return Calling client's vendor ID as defined by the Symbian OS platform security model.
+*/
quint32 XQRequestInfo::clientVendorId() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::clientVendorId");
@@ -95,6 +150,11 @@
return id;
}
+/*!
+ Gets the client's capabilities. Valid only for service provider.
+ \return Calling client's capabilities as defined by the Symbian OS platform security model.
+ The values in the QSet are compatible with the TCapability values in e32capability.h.
+*/
QSet<int> XQRequestInfo::clientCapabilities() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::clientCapabilities");
@@ -118,7 +178,17 @@
return ret;
}
-
+/*!
+ Sets a \a value of the named info \a key. Key names starting with "XQ" are reserved for
+ the QtHighway internal usage. If the service operation (message) does not accept
+ these parameters already, the recommened way is to pass these in the XQRequestInfo
+ and use the following pre-defined keys:
+ - XQINFO_KEY_WINDOW_TITLE for passing the title string be shown in the service application
+ window (QtHighway does not pick the Orbit window title automatically).
+ - ViewName (QString) for passing the view to be activated in the service application.
+ \param key Info key for which \a value will be set.
+ \param value Value to be set to a \a key
+*/
void XQRequestInfo::setInfo(const QString &key, const QVariant &value)
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::setInfo %s:%s,%s",
@@ -126,6 +196,11 @@
mInfo.insert(key, value);
}
+/*!
+ Gets the set value of the \a key. The returned value may be invalid if not set.
+ \param key Key name for which value is retrieved.
+ \return Value set to the key, or invalid QVariant if not set.
+*/
QVariant XQRequestInfo::info(const QString &key) const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::info %s", qPrintable(key));
@@ -134,12 +209,24 @@
return v;
}
+/*!
+ Gets the list of key names set for the object.
+ \return List of key names set for the object.
+*/
QStringList XQRequestInfo::infoKeys() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::infoKeys");
return mInfo.keys();
}
+/*!
+ Gets the internal id of the current request. As there can be several
+ requests ongoing to the same interface, this separates multiple requests.
+ Once the request has been completed the ID becomes invalid.
+ This is the same value as returned by the XQServiceProvider::setCurrentRequestAsync()
+ to set response asynchronous.
+ \return Id of the current request as integer value.
+*/
int XQRequestInfo::id() const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::id");
@@ -153,17 +240,29 @@
return id;
}
+/*!
+ Checks if object is valid.
+ \return True if object is valid, false otherwise.
+*/
bool XQRequestInfo::isValid() const
{
return !mInfo.isEmpty();
}
+/*!
+ Serializes this XQRequestInfo data into the given stream.
+ \param s Stream the data is serialized into.
+*/
template <typename Stream> void XQRequestInfo::serialize(Stream &s) const
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::serialize");
s << mInfo;
}
+/*!
+ Deserializes XQRequestInfo data from the given stream.
+ \param s Stream the data is deserialized from.
+*/
template <typename Stream> void XQRequestInfo::deserialize(Stream &s)
{
XQSERVICE_DEBUG_PRINT("XQRequestInfo::de-serialize");
--- a/qthighway/xqserviceutil/src/xqservicemanager.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqservicemanager.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -33,6 +33,7 @@
#include <QBuffer>
#include <QString>
#include <QCoreApplication>
+#include <QHash>
#include "xqservicelog.h"
#include <xqserviceglobal.h>
@@ -45,7 +46,127 @@
#include "xqconversions.h"
+#define TIMER_DELAY 3000
+class CProcessInfo : public CActive
+ {
+ public:
+ static void AddProcessL(const TUid& appUid, RProcess& appProcess);
+ static void 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<TInt32, CProcessInfo*> 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();
+}
+
+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);
+}
+
+void CProcessInfo::EnsureProcessCanStartL(const TUid& appUid)
+{
+ XQSERVICE_DEBUG_PRINT("CProcessInfo::EnsureProcessCanStartL");
+
+ CProcessInfo* previousProcess = iProcessInfoMap.map[appUid.iUid];
+ if (previousProcess) {
+ previousProcess->Cancel();
+
+ // 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);
+
+ CleanupStack::PopAndDestroy();
+ delete previousProcess;
+ iProcessInfoMap.map.remove(appUid.iUid);
+ }
+}
+
+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
+ \brief Private implementation of the XQServiceManager.
+*/
class XQServiceManagerPrivate
{
public:
@@ -85,12 +206,23 @@
XQAiwInterfaceDescriptor iImplDescriptor;
};
+/*!
+ \class XQServiceManager
+ \brief Discovery and service startup.
+*/
+
+/*!
+ Constructor.
+*/
XQServiceManager::XQServiceManager()
{
XQSERVICE_DEBUG_PRINT("XQServiceManager::XQServiceManager");
d = new XQServiceManagerPrivate();
}
+/*!
+ Destructor.
+*/
XQServiceManager::~XQServiceManager()
{
XQSERVICE_DEBUG_PRINT("XQServiceManager::~XQServiceManager");
@@ -99,10 +231,11 @@
/*!
Starts service
- \param service The full name of service (servicename + interfacename)
- \param embedded Start in embedded mode
- \param applicationUid Returned applicatiion
- \return List of implementations
+ \param service The full name of service (servicename + interfacename).
+ \param embedded Start in embedded mode.
+ \param applicationUid Returned applicatiion.
+ \param threadId Returned process id of the application.
+ \return Error code if error occured, 0 otherwise.
*/
int XQServiceManager::startServer(const QString& service, bool embedded, int& applicationUid, quint64& threadId)
{
@@ -110,6 +243,15 @@
return startServer(service,embedded,applicationUid,threadId,NULL);
}
+/*!
+ Starts service
+ \param service The full name of service (servicename + interfacename).
+ \param embedded Start in embedded mode.
+ \param applicationUid Returned applicatiion.
+ \param threadId Returned process id of the application.
+ \param userData Additional user data.
+ \return Error code if error occured, 0 otherwise.
+*/
int XQServiceManager::startServer(const QString& service, bool embedded, int& applicationUid, quint64& threadId,
const void *userData)
{
@@ -130,9 +272,9 @@
/*!
- Finds implementations for the given interface
- \param interfaceName Interfacename to match
- \return List of implementations
+ Finds implementations for the given interface.
+ \param interfaceName Interfacename to match.
+ \return List of implementations.
*/
QList<XQAiwInterfaceDescriptor> XQServiceManager::findInterfaces ( const QString &interfaceName ) const
{
@@ -145,10 +287,10 @@
}
/*!
- Finds implementations for the given interface implemented by given service
- \param serviceName Service name
- \param interfaceName Interfacename to match
- \return List of implementations
+ Finds implementations for the given interface implemented by given service.
+ \param serviceName Service name.
+ \param interfaceName Interfacename to match.
+ \return List of implementations.
*/
QList<XQAiwInterfaceDescriptor> XQServiceManager::findInterfaces ( const QString &serviceName, const QString &interfaceName ) const
{
@@ -164,8 +306,8 @@
/*!
Finds the first implementation for the given interface name.
- \param interfaceName Interfacename to match
- \return List of implementations
+ \param interfaceName Interfacename to match.
+ \return List of implementations.
*/
QList<XQAiwInterfaceDescriptor> XQServiceManager::findFirstInterface ( const QString &interfaceName ) const
{
@@ -178,10 +320,10 @@
}
/*!
- Finds the first implementation for the given service + interface names
- \param serviceName Service name
- \param interfaceName Interfacename to match
- \return List of implementations
+ Finds the first implementation for the given service + interface names.
+ \param serviceName Service name.
+ \param interfaceName Interfacename to match.
+ \return List of implementations.
*/
QList<XQAiwInterfaceDescriptor> XQServiceManager::findFirstInterface ( const QString &serviceName, const QString &interfaceName ) const
{
@@ -197,7 +339,8 @@
/*!
- Returns the latest error occured
+ Gets the latest error occured.
+ \return Latest error code as integer value.
*/
int XQServiceManager::latestError() const
{
@@ -205,7 +348,9 @@
}
/*!
- Returns the latest error occured
+ Checks if the given \a implmentation is running.
+ \param implementation Implementation to be checked.
+ \return true if given \a implementation is running, false otherwise.
*/
bool XQServiceManager::isRunning(const XQAiwInterfaceDescriptor& implementation) const
{
@@ -347,7 +492,9 @@
embed = false;
}
}
-
+ else {
+ CProcessInfo::EnsureProcessCanStartL(uid);
+ }
TRequestStatus requestStatusForRendezvous;
// start application with command line parameters
@@ -389,6 +536,10 @@
User::WaitForRequest( requestStatusForRendezvous ); // Make the rendezvouz
XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::Rendezvous done %d", requestStatusForRendezvous.Int());
+ if (!embed) {
+ CProcessInfo::AddProcessL(uid, newApp);
+ }
+
User::LeaveIfError( requestStatusForRendezvous.Int());
CleanupStack::PopAndDestroy(2,cmdLine); // newApp, cmdLine
--- a/qthighway/xqserviceutil/src/xqservicemetadata/xqaiwinterfacedescriptor.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqservicemetadata/xqaiwinterfacedescriptor.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -69,19 +69,39 @@
This enum describes the possible property types which can be attached
to a XQAiwInterfaceDescriptor.
+*/
- \value Capabilities The capabilities property is a QStringList and
- describes the capabilities that a service client
- would require to use the service if capability
- checks are enforced.
- \value Location This property points to the location
- where the plug-in providing this service is stored.
- If the service is plug-in based the location is the
- name and/or path of the plugin.
- \value ServiceDescription This property provides a general description for
- the service.
- \value InterfaceDescription This property provides a description for the interface
- implementation.
+/*! \var XQAiwInterfaceDescriptor::PropertyKey XQAiwInterfaceDescriptor::Capabilities
+
+ The capabilities property is a QStringList and
+ describes the capabilities that a service client
+ would require to use the service if capability
+ checks are enforced.
+*/
+
+/*! \var XQAiwInterfaceDescriptor::PropertyKey XQAiwInterfaceDescriptor::Location
+
+ This property points to the location
+ where the plug-in providing this service is stored.
+ If the service is plug-in based the location is the
+ name and/or path of the plugin.
+*/
+
+/*! \var XQAiwInterfaceDescriptor::PropertyKey XQAiwInterfaceDescriptor::ServiceDescription
+
+ This property provides a general description for
+ the service.
+*/
+
+/*! \var XQAiwInterfaceDescriptor::PropertyKey XQAiwInterfaceDescriptor::InterfaceDescription
+
+ This property provides a description for the interface
+ implementation.
+*/
+
+/*! \var XQAiwInterfaceDescriptor::PropertyKey XQAiwInterfaceDescriptor::ImplementationId
+
+ Extension: settable property, contains implementation id
*/
/*!
@@ -106,6 +126,8 @@
/*!
Creates a copy of XQAiwInterfaceDescriptor contained in \a other.
+ \param other Reference to the other XQAiwInterfaceDescriptor object, from
+ which new object will be created
*/
XQAiwInterfaceDescriptor::XQAiwInterfaceDescriptor(const XQAiwInterfaceDescriptor& other)
: d(0)
@@ -117,6 +139,7 @@
/*!
Copies the content of the XQAiwInterfaceDescriptor object contained
in \a other into this one.
+ \param other Reference to XQAiwInterfaceDescriptor object, from which content will be copied
*/
XQAiwInterfaceDescriptor& XQAiwInterfaceDescriptor::operator=(const XQAiwInterfaceDescriptor& other)
{
@@ -136,8 +159,10 @@
}
/*!
- Compares a XQAiwInterfaceDescriptor to \a other. Returns true if they
- are equal and false otherwise.
+ Compares a XQAiwInterfaceDescriptor to \a other.
+ \param other Reference to XQAiwInterfaceDescriptor object, which will be compared
+ to this one.
+ \return True if both instances are equal, false otherwise.
*/
bool XQAiwInterfaceDescriptor::operator==(const XQAiwInterfaceDescriptor& other) const
{
@@ -164,10 +189,14 @@
Compares a XQAiwInterfaceDescriptor to \a other. Returns true
if they are not equal and false otherwise.
+ \param other Reference to XQAiwInterfaceDescriptor object, which will be compared
+ to this one.
+ \return False if both instances are equal, true otherwise.
*/
/*!
- Returns true if this descriptor is valid; otherwise returns false.
+ Checks if the descriptor is valid.
+ \return True if this descriptor is valid, false otherwise
*/
bool XQAiwInterfaceDescriptor::isValid() const
{
@@ -182,7 +211,9 @@
}
/*!
- Returns true if this implementation is provided for all users on the system.
+ Checks if this implementation is provided for all users on the system.
+ \return True if this implementation is provided for all users on the system,
+ false otherwise
\sa QServiceManager::Scope
*/
@@ -192,7 +223,8 @@
}
/*!
- Returns the name of service that provides this implementation.
+ Gets the name of service that provides this implementation.
+ \return Name of service
*/
QString XQAiwInterfaceDescriptor::serviceName() const
{
@@ -200,7 +232,8 @@
}
/*!
- Returns the name of the interface that is implemented.
+ Gets the name of the interface that is implemented.
+ \return Name of the interface
*/
QString XQAiwInterfaceDescriptor::interfaceName() const
{
@@ -209,11 +242,11 @@
/*!
- Returns the version of the interface.
-
+ Gets the version of the interface.
Subsequent versions of an interface are binary compatible
to previous versions of the same interface. If an intcerface
is broken it must use a new interface name.
+ \return Interface version as integer value
*/
int XQAiwInterfaceDescriptor::majorVersion() const
{
@@ -221,7 +254,8 @@
}
/*!
- Returns the version of the implementation.
+ Gets the version of the implementation.
+ \return Implementation version as integer value
*/
int XQAiwInterfaceDescriptor::minorVersion() const
{
@@ -229,8 +263,9 @@
}
/*!
- Returns the value for the property \a key; otherwise returns
- an invalid QVariant.
+ Gets the value for the property.
+ \param key Key of the property
+ \return Value of the property, invalid QVariant if does not exist
*/
QVariant XQAiwInterfaceDescriptor::property(XQAiwInterfaceDescriptor::PropertyKey key) const
{
@@ -266,8 +301,9 @@
/*!
- Returns the value for the custom property \a key; otherwise
- returns a null string.
+ Gets the value for the property.
+ \param key Key of the custom property
+ \return Value of the custom property, invalid null if does not exist
*/
QString XQAiwInterfaceDescriptor::customProperty(const QString& key) const
{
@@ -282,6 +318,10 @@
return val;
}
+/*!
+ Gets list of custom property keys.
+ \return list of custom property keys
+*/
QStringList XQAiwInterfaceDescriptor::customPropertyKeys() const
{
XQSERVICE_DEBUG_PRINT("XQAiwInterfaceDescriptor::customPropertyKeys");
@@ -332,6 +372,9 @@
Writes service interface descriptor \a dc to the stream \a out and returns a reference
to the stream.
+ \param out Stream to write to
+ \param dc Interface descriptor written to stream
+ \return Reference to the stream
*/
QDataStream &operator<<(QDataStream &out, const XQAiwInterfaceDescriptor &dc)
@@ -360,6 +403,9 @@
Reads a service interface descriptor into \a dc from the stream \a in and returns a
reference to the stream.
+ \param in Stream to read from
+ \param dc Interface descriptor read from stream
+ \return Reference to the stream
*/
QDataStream &operator>>(QDataStream &in, XQAiwInterfaceDescriptor &dc)
{
--- a/qthighway/xqserviceutil/src/xqservicemetadata/xqservicemetadata.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqservicemetadata/xqservicemetadata.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -59,8 +59,10 @@
}
#endif
-/*
+/*!
\class ServiceMetaData
+ \brief Utility class offering support for parsing metadata
+ service xml registry files.
Utility class (used by service database) that offers support for
parsing metadata service xml registry file during service registration. \n
@@ -71,11 +73,10 @@
- each interface can be retrieved
*/
-/*
- * Class constructor
- *
- * @param aXmlFilePath path to the xml file that describes the service.
- */
+/*!
+ Constructor
+ \param aXmlFilePath Path to the xml file that describes the service.
+*/
ServiceMetaData::ServiceMetaData(const QString &aXmlFilePath)
{
XQSERVICE_DEBUG_PRINT("ServiceMetaData::ServiceMetaData(1)");
@@ -85,11 +86,10 @@
latestError = 0;
}
-/*
- * Class constructor
- *
- * @param device QIODevice that contains the XML data that describes the service.
- */
+/*!
+ Constructor
+ \param device QIODevice that contains the XML data that describes the service.
+*/
ServiceMetaData::ServiceMetaData(QIODevice *device)
{
XQSERVICE_DEBUG_PRINT("ServiceMetaData::ServiceMetaData(2)");
@@ -98,10 +98,9 @@
latestError = 0;
}
-/*
- * Class destructor
- *
- */
+/*!
+ Destructor
+*/
ServiceMetaData::~ServiceMetaData()
{
XQSERVICE_DEBUG_PRINT("ServiceMetaData::~ServiceMetaData");
@@ -109,9 +108,10 @@
delete xmlDevice;
}
-/*
+/*!
Sets the device containing the XML data that describes the service to \a device.
- */
+ \param device Device containing XML data.
+*/
void ServiceMetaData::setDevice(QIODevice *device)
{
XQSERVICE_DEBUG_PRINT("ServiceMetaData::setDevice");
@@ -120,8 +120,9 @@
ownsXmlDevice = false;
}
-/*
- Returns the device containing the XML data that describes the service.
+/*!
+ Gets the device containing the XML data that describes the service.
+ \return Device containing the XML data.
*/
QIODevice *ServiceMetaData::device() const
{
@@ -129,40 +130,38 @@
return xmlDevice;
}
-/*
- * Gets the service name
- *
- * @return service name or default value (empty string) if it is not available
- */
+/*!
+ Gets the service name.
+ \return Service name or default value (empty string) if it is not available.
+*/
+
/*QString ServiceMetaData::name() const
{
return serviceName;
}*/
-/*
- * Gets the path of the service implementation file
- *
- * @return service implementation filepath
- */
+/*!
+ Gets the path of the service implementation file.
+ \return Service implementation filepath.
+*/
/*QString ServiceMetaData::location() const
{
return serviceLocation;
}*/
-/*
- * Gets the service description
- *
- * @return service description or default value (empty string) if it is not available
- */
+/*!
+ Gets the service description.
+ \return Service description or default value (empty string) if it is not available.
+*/
/*QString ServiceMetaData::description() const
{
return serviceDescription;
}*/
-/*
- Returns the metadata of the interace at \a index; otherwise
- returns 0.
- */
+/*!
+ Gets the list of interfaces.
+ \return List interfaces.
+*/
/*QList<XQServiceInterfaceDescriptor> ServiceMetaData::getInterfaces() const
{
return serviceInterfaces;
@@ -170,7 +169,6 @@
/*!
\internal
-
Returns a streamable object containing the results of the parsing.
*/
ServiceMetaDataResults ServiceMetaData::parseResults() const
@@ -188,13 +186,13 @@
return results;
}
-/*
+/*!
Parses the file and extracts the service metadata \n
Custom error codes: \n
SFW_ERROR_UNABLE_TO_OPEN_FILE in case can not open the XML file \n
SFW_ERROR_INVALID_XML_FILE in case service registry is not a valid XML file \n
SFW_ERROR_NO_SERVICE in case XML file has no service tag\n
- @return true if the metadata was read properly, false if there is an error
+ \return true if the metadata was read properly, false if there is an error.
*/
bool ServiceMetaData::extractMetadata()
{
@@ -256,10 +254,10 @@
return !parseError;
}
-/*
- Gets the latest parsing error \n
- @return parsing error(negative value) or 0 in case there is none
- */
+/*!
+ Gets the latest parsing error.
+ \return Parsing error(negative value) or 0 in case there is none.
+*/
int ServiceMetaData::getLatestError() const
{
XQSERVICE_DEBUG_PRINT("ServiceMetaData::getLatestError");
@@ -267,9 +265,9 @@
return latestError;
}
-/*
+/*!
Parses and extracts the service from the current xml <service> node
- using the new format (Version 2) \n
+ using the new format (Version 2).
Schema:
<!ELEMENT service ( name, filepath, description?, interface+ ) >
<!ELEMENT description ( #CDATA ) >
@@ -363,14 +361,14 @@
Parses and extracts the service from the current xml <service> node
using the new format (Version 1) \n
-<!ELEMENT service ( description?, interface+ ) >
-<!ATTLIST service name #CDATA #REQUIRED >
-<!ATTLIST service filepath #CDATA #REQUIRED >
-<!ELEMENT description ( #CDATA ) >
-<!ELEMENT interface ( description? ) >
-<!ATTLIST interface name #CDATA #REQUIRED >
-<!ATTLIST interface version #CDATA #REQUIRED >
-<!ATTLIST interface capabilities #CDATA >
+ <!ELEMENT service ( description?, interface+ ) >
+ <!ATTLIST service name #CDATA #REQUIRED >
+ <!ATTLIST service filepath #CDATA #REQUIRED >
+ <!ELEMENT description ( #CDATA ) >
+ <!ELEMENT interface ( description? ) >
+ <!ATTLIST interface name #CDATA #REQUIRED >
+ <!ATTLIST interface version #CDATA #REQUIRED >
+ <!ATTLIST interface capabilities #CDATA >
Custom error codes: \n
SFW_ERROR_NO_SERVICE_NAME in case no service name in XML file \n
@@ -378,9 +376,9 @@
SFW_ERROR_PARSE_SERVICE in case can not parse service section in XML file \n
SFW_ERROR_NO_SERVICE_FILEPATH in case no service file path in XML file \n
SFW_ERROR_INVALID_XML_FILE in case XML file is not valid \n
- SFW_ERROR_NO_SERVICE_INTERFACE in case no interface defined for service in XML file \n
- @param aXMLReader xml stream reader
- @return true if the metadata was read properly, false if there is an error
+ SFW_ERROR_NO_SERVICE_INTERFACE in case no interface defined for service in XML file.
+ \param aXMLReader xml stream reader .
+ \return true if the metadata was read properly, false if there is an error.
*/
@@ -446,8 +444,10 @@
}
-/*
- Parses and extracts the interface metadata from the current xml <interface> node \n
+/*!
+ Parses and extracts the interface metadata from the current xml <interface> node.
+ \param aXMLReader xml stream reader .
+ \return true if the metadata was read properly, false if there is an error.
*/
bool ServiceMetaData::processInterfaceElement(QXmlStreamReader &aXMLReader)
{
@@ -580,14 +580,14 @@
}
/*!
- Parses and extracts the interface metadata from the current xml <interface> node \n
+ Parses and extracts the interface metadata from the current xml <interface> node. \n
Custome error codes: \n
SFW_ERROR_NO_INTERFACE_NAME in case no interface name in XML file \n
SFW_ERROR_PARSE_INTERFACE in case error parsing interface section \n
SFW_ERROR_INVALID_XML_FILE in case XML file is not valid \n
- @param aXMLReader xml stream reader
- @return true if the metadata was read properly, false if there is an error
- */
+ \param aXMLReader xml stream reader.
+ \return true if the metadata was read properly, false if there is an error.
+*/
bool ServiceMetaData::processInterfaceElementPrevVersion(QXmlStreamReader &aXMLReader)
{
XQSERVICE_DEBUG_PRINT("ServiceMetaData::processInterfaceElementPrevVersion");
@@ -712,12 +712,12 @@
/*!
- Gets the value of the attribute from the XML node \n
- @param aDomElement xml node
- @param aAttributeName attribute name
- @param aValue [out] attribute value
- @return true if the value was read, false otherwise
- */
+ Gets the value of the attribute from the XML node.
+ \param aDomElement Xml node.
+ \param aAttributeName Attribute name.
+ \param aValue [out] attribute value.
+ \return true if the value was read, false otherwise.
+*/
bool ServiceMetaData::getAttributeValue(const QXmlStreamReader &aXMLReader, const QString &aAttributeName, QString &aValue)
{
XQSERVICE_DEBUG_PRINT("ServiceMetaData::getAttributeValue");
@@ -812,10 +812,9 @@
}
}
-/*
- * Clears the service metadata
- *
- */
+/*!
+ Clears the service metadata.
+*/
void ServiceMetaData::clearMetadata()
{
XQSERVICE_DEBUG_PRINT("ServiceMetaData::clearMetadata");
--- a/qthighway/xqserviceutil/src/xqserviceutil.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqserviceutil.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -108,6 +108,12 @@
// ======== MEMBER FUNCTIONS ========
+
+/*!
+ Send service application to backround in asynchronous service call.
+ \param value Defines should application be send to backround (if set to true)
+ or to be brought back to foreground (if set to false)
+*/
void XQServiceUtil::toBackground( bool value )
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::toBackground");
@@ -133,62 +139,126 @@
}
}
+/*!
+ Check if service application is being launched as an embedded application.
+ This information is passed in the command line arguments to started service application.
+ \return true if service application is as an embedded application, otherwise false.
+*/
bool XQServiceUtil::isEmbedded()
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::isEmbedded");
return isKeySet(QString::fromLatin1(XQServiceUtils::StartupArgEmbedded));
}
+/*!
+ Check if service application is being launched as service (other include stand-alone launch
+ or activity launch). This information is valid upon service application launch. It is passed
+ in the command line arguments so can be used already in main() function before initializing any UI.
+ \return true if launched as service, false otherwise (lanched as stand-alone or activity or other mode).
+*/
bool XQServiceUtil::isService()
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::isService");
return isKeySet(QString::fromLatin1(XQServiceUtils::StartupArgService));
}
+/*!
+ Returns the interface name part of the full service name to be called later.
+ This information is valid upon service application launch. It is passed
+ in the command line arguments so can be used already in main() function before
+ initializing any UI. For example for initializing only necessary components,
+ for generating interface specific UI etc.
+ \return Interface name part of the full service name.
+ - \b Note: The service name part should be known already by the service provider implicitly.
+*/
QString XQServiceUtil::interfaceName()
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::interfaceName");
return keyValue(QString::fromLatin1(XQServiceUtils::StartupArgInterfaceName));
}
+/*!
+ Returns the operation name within the interfaceName() to be called later.
+ This information is valid upon service application launch. It is passed
+ in the command line arguments so can be used already in main() function before
+ initializing any UI. For example for initializing only necessary components
+ for the coming slot call.
+ \return Operation name within the interfaceName()
+*/
QString XQServiceUtil::operationName()
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::operationName");
return keyValue(QString::fromLatin1(XQServiceUtils::StartupArgOperationName));
}
+/*!
+
+*/
QString XQServiceUtil::serviceName()
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::serviceName");
return keyValue(QString::fromLatin1(XQServiceUtils::StartupArgServiceName));
}
+/*!
+ Check if service application is being launched as an embedded application,
+ based on passed \a argv arguments.
+ \param argc Number of command line arguments.
+ \param argv List of command line arguments.
+ \return true if service application is as an embedded application, otherwise false.
+ \sa isEmbedded()
+*/
bool XQServiceUtil::isEmbedded(int argc, char **argv)
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::isEmbedded argv");
return isKeySet(argc,argv,QString::fromLatin1(XQServiceUtils::StartupArgEmbedded));
}
-
+/*!
+ Check if service application is being launched as service (other include stand-alone launch
+ or activity launch), based on passed \a argv arguments.
+ \param argc Number of command line arguments.
+ \param argv List of command line arguments.
+ \return true if launched as service, false otherwise (lanched as stand-alone or activity or other mode).
+ \sa isService()
+*/
bool XQServiceUtil::isService(int argc, char **argv)
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::isService argv");
return isKeySet(argc,argv,QString::fromLatin1(XQServiceUtils::StartupArgService));
}
+/*!
+ Returns the interface name part of the full service name to be called later,
+ based on passed \a argv arguments.
+ \param argc Number of command line arguments.
+ \param argv List of command line arguments.
+ \return Interface name part of the full service name.
+ \sa interfaceName()
+*/
QString XQServiceUtil::interfaceName(int argc, char **argv)
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::interfaceName");
return keyValue(argc,argv,QString::fromLatin1(XQServiceUtils::StartupArgInterfaceName));
}
-
+/*!
+ Returns the operation name within the interfaceName() to be called later,
+ based on passed \a argv arguments.
+ \param argc Number of command line arguments.
+ \param argv List of command line arguments.
+ \return Operation name within the interfaceName()
+ \sa operationName()
+*/
QString XQServiceUtil::operationName(int argc, char **argv)
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::operationName argv");
return keyValue(argc,argv,QString::fromLatin1(XQServiceUtils::StartupArgOperationName));
}
+/*!
+
+*/
QString XQServiceUtil::serviceName(int argc, char **argv)
{
XQSERVICE_DEBUG_PRINT("XQServiceUtil::serviceName argv");
--- a/qthighway/xqserviceutil/src/xqserviceutil.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqserviceutil.h Thu Sep 02 21:20:48 2010 +0300
@@ -24,7 +24,9 @@
#include <xqserviceglobal.h>
-
+/*!
+ \brief Provides static utility functions for service provider (used also by QtHighway impl.)
+*/
namespace XQServiceUtil
{
// Utility to set started application to background
--- a/qthighway/xqserviceutil/src/xqsharablefile.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqsharablefile.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -23,26 +23,52 @@
#include "xqsharablefile.h"
#include <QVariant>
+/*!
+ \class XQSharableFile
+ \inpublicgroup QtBaseModule
+ \ingroup ipc
+ \brief Encapsulates needed functionality to pass one Symbian data-caged file handle to service provider.
+*/
+
+/*!
+ Constructor.
+*/
XQSharableFile::XQSharableFile() :
mHandle(0)
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::XQSharableFile");
}
+/*!
+ Constructor.
+ \param file Existing and valid file handle to be set to this XQSharableFile.
+*/
XQSharableFile::XQSharableFile(RFile &file)
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::XQSharableFile(RFile)");
setHandle(file);
}
+/*!
+ Destroys the descriptor.
+
+ \b Note!
+ The destructor does not close the file handle.
+ You have to close it via the close() method.
+*/
XQSharableFile::~XQSharableFile()
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::~XQSharableFile");
// One need to call close() explicitelly when all done
}
-
+/*!
+ Sets the existing and valid sharable file. Use this
+ function if you obtained the handle from the other APIs.
+ \return True if the handle is valid and can be set,
+ false otherwise.
+*/
bool XQSharableFile::setHandle(RFile &file)
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::setHandle");
@@ -65,6 +91,12 @@
return true;
}
+/*!
+ Gets the set handle, if any.
+ \param handle Reference to handle to be set with
+ this XQSharableFile's handle.
+ \return True if the handle is valid, false otherwise.
+*/
bool XQSharableFile::getHandle(RFile &handle) const
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::getHandle");
@@ -75,19 +107,37 @@
return true;
}
-
+/*!
+ Get file name associated with this XQSharableFile.
+ \return Full file name associated with this XQSharableFile.
+*/
QString XQSharableFile::fileName() const
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::fileName");
return mFileName;
}
+/*!
+ Checks if this XQSharableFile is valid, that is if the associated
+ file handle is valid.
+ \return True if file handle of this XQSharableFile is valid,
+ false otherwise.
+*/
bool XQSharableFile::isValid() const
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::isValid=%d", mHandle != 0);
return mHandle != 0;
}
+/*!
+ Creates and sets the sharable file handle of the given file.
+ The file can be private, data-caged directory.
+ Currently only supported access mode is R/O.
+ \b Note! After opening the file, it should be closed by calling close().
+ \param fileName File to be opened.
+ \return True if the file name was ok and the file was opened successfuly,
+ false otherwise.
+*/
bool XQSharableFile::open(const QString &fileName)
{
close(); // Close possibly existing old one
@@ -116,6 +166,10 @@
return true;
}
+/*!
+ Close the sharable file handle.
+ <b>It is very important to close the handle if it is no longer needed.</b>
+*/
void XQSharableFile::close()
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::close");
@@ -132,7 +186,10 @@
}
-
+/*!
+ Serializes XQSharableFile into a stream.
+ \param s Stream to which this XQSharableFile will be serialized.
+*/
template <typename Stream> void XQSharableFile::serialize(Stream &s) const
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::serialize");
@@ -142,6 +199,10 @@
XQSERVICE_DEBUG_PRINT("%s", qPrintable(str));
}
+/*!
+ Deserializes XQSharableFile from a stream.
+ \param s Stream from which XQSharableFile will be deserialized.
+*/
template <typename Stream> void XQSharableFile::deserialize(Stream &s)
{
XQSERVICE_DEBUG_PRINT("XQSharableFile::deserialize");
@@ -154,6 +215,10 @@
}
+/*!
+ Compares two XQSharableFile objects.
+ \return True if both XQSharableFile objects are equal, false otherwise.
+*/
bool XQSharableFile::operator==( const XQSharableFile &other )
{
return (mFileName == other.mFileName) && (mHandle == other.mHandle);
--- a/qtmobileextensions/src/keycapture/keymapper.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qtmobileextensions/src/keycapture/keymapper.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -25,146 +25,146 @@
#include "keymapper.h"
#include <e32keys.h>
+using namespace Qt;
+
+static const KeyMapping keyMapping[] = {
+ {EKeyBackspace, EStdKeyBackspace, Key_Backspace},
+ {EKeyTab, EStdKeyTab, Key_Tab},
+ {EKeyEnter, EStdKeyEnter, Key_Enter},
+ {EKeyEscape, EStdKeyEscape, Key_Escape},
+ {EKeySpace, EStdKeySpace, Key_Space},
+ {EKeyDelete, EStdKeyDelete, Key_Delete},
+ {EKeyPrintScreen, EStdKeyPrintScreen, Key_SysReq},
+ {EKeyPause, EStdKeyPause, Key_Pause},
+ {EKeyHome, EStdKeyHome, Key_Home},
+ {EKeyEnd, EStdKeyEnd, Key_End},
+ {EKeyPageUp, EStdKeyPageUp, Key_PageUp},
+ {EKeyPageDown, EStdKeyPageDown, Key_PageDown},
+ {EKeyInsert, EStdKeyInsert, Key_Insert},
+ {EKeyLeftArrow, EStdKeyLeftArrow, Key_Left},
+ {EKeyRightArrow, EStdKeyRightArrow, Key_Right},
+ {EKeyUpArrow, EStdKeyUpArrow, Key_Up},
+ {EKeyDownArrow, EStdKeyDownArrow, Key_Down},
+ {EKeyLeftShift, EStdKeyLeftShift, Key_Shift},
+ {EKeyRightShift, EStdKeyRightShift, Key_Shift},
+ {EKeyLeftAlt, EStdKeyLeftAlt, Key_Alt},
+ {EKeyRightAlt, EStdKeyRightAlt, Key_AltGr},
+ {EKeyLeftCtrl, EStdKeyLeftCtrl, Key_Control},
+ {EKeyRightCtrl, EStdKeyRightCtrl, Key_Control},
+ {EKeyLeftFunc, EStdKeyLeftFunc, Key_Super_L},
+ {EKeyRightFunc, EStdKeyRightFunc, Key_Super_R},
+ {EKeyCapsLock, EStdKeyCapsLock, Key_CapsLock},
+ {EKeyNumLock, EStdKeyNumLock, Key_NumLock},
+ {EKeyScrollLock, EStdKeyScrollLock, Key_ScrollLock},
+ {EKeyF1, EStdKeyF1, Key_F1},
+ {EKeyF2, EStdKeyF2, Key_F2},
+ {EKeyF3, EStdKeyF3, Key_F3},
+ {EKeyF4, EStdKeyF4, Key_F4},
+ {EKeyF5, EStdKeyF5, Key_F5},
+ {EKeyF6, EStdKeyF6, Key_F6},
+ {EKeyF7, EStdKeyF7, Key_F7},
+ {EKeyF8, EStdKeyF8, Key_F8},
+ {EKeyF9, EStdKeyF9, Key_F9},
+ {EKeyF10, EStdKeyF10, Key_F10},
+ {EKeyF11, EStdKeyF11, Key_F11},
+ {EKeyF12, EStdKeyF12, Key_F12},
+ {EKeyF13, EStdKeyF13, Key_F13},
+ {EKeyF14, EStdKeyF14, Key_F14},
+ {EKeyF15, EStdKeyF15, Key_F15},
+ {EKeyF16, EStdKeyF16, Key_F16},
+ {EKeyF17, EStdKeyF17, Key_F17},
+ {EKeyF18, EStdKeyF18, Key_F18},
+ {EKeyF19, EStdKeyF19, Key_F19},
+ {EKeyF20, EStdKeyF20, Key_F20},
+ {EKeyF21, EStdKeyF21, Key_F21},
+ {EKeyF22, EStdKeyF22, Key_F22},
+ {EKeyF23, EStdKeyF23, Key_F23},
+ {EKeyF24, EStdKeyF24, Key_F24},
+ {EKeyOff, EStdKeyOff, Key_PowerOff},
+// {EKeyMenu, EStdKeyMenu, Key_Menu}, // Menu is EKeyApplication0
+ {EKeyHelp, EStdKeyHelp, Key_Help},
+ {EKeyDial, EStdKeyDial, Key_Call},
+ {EKeyIncVolume, EStdKeyIncVolume, Key_VolumeUp},
+ {EKeyDecVolume, EStdKeyDecVolume, Key_VolumeDown},
+ {EKeyDevice0, EStdKeyDevice0, Key_Context1}, // Found by manual testing.
+ {EKeyDevice1, EStdKeyDevice1, Key_Context2}, // Found by manual testing.
+ {EKeyDevice3, EStdKeyDevice3, Key_Select},
+ {EKeyDevice7, EStdKeyDevice7, Key_Camera},
+ {EKeyApplication0, EStdKeyApplication0, Key_Menu}, // Found by manual testing.
+ {EKeyApplication1, EStdKeyApplication1, Key_Launch1}, // Found by manual testing.
+ {EKeyApplication2, EStdKeyApplication2, Key_MediaPlay}, // Found by manual testing.
+ {EKeyApplication3, EStdKeyApplication3, Key_MediaStop}, // Found by manual testing.
+ {EKeyApplication4, EStdKeyApplication4, Key_MediaNext}, // Found by manual testing.
+ {EKeyApplication5, EStdKeyApplication5, Key_MediaPrevious}, // Found by manual testing.
+ {EKeyApplication6, EStdKeyApplication6, Key_Launch6},
+ {EKeyApplication7, EStdKeyApplication7, Key_Launch7},
+ {EKeyApplication8, EStdKeyApplication8, Key_Launch8},
+ {EKeyApplication9, EStdKeyApplication9, Key_Launch9},
+ {EKeyApplicationA, EStdKeyApplicationA, Key_LaunchA},
+ {EKeyApplicationB, EStdKeyApplicationB, Key_LaunchB},
+ {EKeyApplicationC, EStdKeyApplicationC, Key_LaunchC},
+ {EKeyApplicationD, EStdKeyApplicationD, Key_LaunchD},
+ {EKeyApplicationE, EStdKeyApplicationE, Key_LaunchE},
+ {EKeyApplicationF, EStdKeyApplicationF, Key_LaunchF},
+ {EKeyApplication19, EStdKeyApplication19, Key_CameraFocus},
+ {EKeyYes, EStdKeyYes, Key_Yes},
+ {EKeyNo, EStdKeyNo, Key_No},
+ {TKeyCode(0), TStdScanCode(0), Qt::Key(0)}
+};
QKeyMapper::QKeyMapper()
{
- fillKeyMap();
+ // fillKeyMap();
}
QKeyMapper::~QKeyMapper()
{
}
-void QKeyMapper::fillKeyMap()
-{
- using namespace Qt;
- keyMapping.append(KeyMapping(EKeyBackspace, EStdKeyBackspace, Key_Backspace));
- keyMapping.append(KeyMapping(EKeyTab, EStdKeyTab, Key_Tab));
- keyMapping.append(KeyMapping(EKeyEnter, EStdKeyEnter, Key_Enter));
- keyMapping.append(KeyMapping(EKeyEscape, EStdKeyEscape, Key_Escape));
- keyMapping.append(KeyMapping(EKeySpace, EStdKeySpace, Key_Space));
- keyMapping.append(KeyMapping(EKeyDelete, EStdKeyDelete, Key_Delete));
- keyMapping.append(KeyMapping(EKeyPrintScreen, EStdKeyPrintScreen, Key_SysReq));
- keyMapping.append(KeyMapping(EKeyPause, EStdKeyPause, Key_Pause));
- keyMapping.append(KeyMapping(EKeyHome, EStdKeyHome, Key_Home));
- keyMapping.append(KeyMapping(EKeyEnd, EStdKeyEnd, Key_End));
- keyMapping.append(KeyMapping(EKeyPageUp, EStdKeyPageUp, Key_PageUp));
- keyMapping.append(KeyMapping(EKeyPageDown, EStdKeyPageDown, Key_PageDown));
- keyMapping.append(KeyMapping(EKeyInsert, EStdKeyInsert, Key_Insert));
- keyMapping.append(KeyMapping(EKeyLeftArrow, EStdKeyLeftArrow, Key_Left));
- keyMapping.append(KeyMapping(EKeyRightArrow, EStdKeyRightArrow, Key_Right));
- keyMapping.append(KeyMapping(EKeyUpArrow, EStdKeyUpArrow, Key_Up));
- keyMapping.append(KeyMapping(EKeyDownArrow, EStdKeyDownArrow, Key_Down));
- keyMapping.append(KeyMapping(EKeyLeftShift, EStdKeyLeftShift, Key_Shift));
- keyMapping.append(KeyMapping(EKeyRightShift, EStdKeyRightShift, Key_Shift));
- keyMapping.append(KeyMapping(EKeyLeftAlt, EStdKeyLeftAlt, Key_Alt));
- keyMapping.append(KeyMapping(EKeyRightAlt, EStdKeyRightAlt, Key_AltGr));
- keyMapping.append(KeyMapping(EKeyLeftCtrl, EStdKeyLeftCtrl, Key_Control));
- keyMapping.append(KeyMapping(EKeyRightCtrl, EStdKeyRightCtrl, Key_Control));
- keyMapping.append(KeyMapping(EKeyLeftFunc, EStdKeyLeftFunc, Key_Super_L));
- keyMapping.append(KeyMapping(EKeyRightFunc, EStdKeyRightFunc, Key_Super_R));
- keyMapping.append(KeyMapping(EKeyCapsLock, EStdKeyCapsLock, Key_CapsLock));
- keyMapping.append(KeyMapping(EKeyNumLock, EStdKeyNumLock, Key_NumLock));
- keyMapping.append(KeyMapping(EKeyScrollLock, EStdKeyScrollLock, Key_ScrollLock));
- keyMapping.append(KeyMapping(EKeyF1, EStdKeyF1, Key_F1));
- keyMapping.append(KeyMapping(EKeyF2, EStdKeyF2, Key_F2));
- keyMapping.append(KeyMapping(EKeyF3, EStdKeyF3, Key_F3));
- keyMapping.append(KeyMapping(EKeyF4, EStdKeyF4, Key_F4));
- keyMapping.append(KeyMapping(EKeyF5, EStdKeyF5, Key_F5));
- keyMapping.append(KeyMapping(EKeyF6, EStdKeyF6, Key_F6));
- keyMapping.append(KeyMapping(EKeyF7, EStdKeyF7, Key_F7));
- keyMapping.append(KeyMapping(EKeyF8, EStdKeyF8, Key_F8));
- keyMapping.append(KeyMapping(EKeyF9, EStdKeyF9, Key_F9));
- keyMapping.append(KeyMapping(EKeyF10, EStdKeyF10, Key_F10));
- keyMapping.append(KeyMapping(EKeyF11, EStdKeyF11, Key_F11));
- keyMapping.append(KeyMapping(EKeyF12, EStdKeyF12, Key_F12));
- keyMapping.append(KeyMapping(EKeyF13, EStdKeyF13, Key_F13));
- keyMapping.append(KeyMapping(EKeyF14, EStdKeyF14, Key_F14));
- keyMapping.append(KeyMapping(EKeyF15, EStdKeyF15, Key_F15));
- keyMapping.append(KeyMapping(EKeyF16, EStdKeyF16, Key_F16));
- keyMapping.append(KeyMapping(EKeyF17, EStdKeyF17, Key_F17));
- keyMapping.append(KeyMapping(EKeyF18, EStdKeyF18, Key_F18));
- keyMapping.append(KeyMapping(EKeyF19, EStdKeyF19, Key_F19));
- keyMapping.append(KeyMapping(EKeyF20, EStdKeyF20, Key_F20));
- keyMapping.append(KeyMapping(EKeyF21, EStdKeyF21, Key_F21));
- keyMapping.append(KeyMapping(EKeyF22, EStdKeyF22, Key_F22));
- keyMapping.append(KeyMapping(EKeyF23, EStdKeyF23, Key_F23));
- keyMapping.append(KeyMapping(EKeyF24, EStdKeyF24, Key_F24));
- keyMapping.append(KeyMapping(EKeyOff, EStdKeyOff, Key_PowerOff));
-// keyMapping.append(KeyMapping(EKeyMenu, EStdKeyMenu, Key_Menu)); // Menu is EKeyApplication0
- keyMapping.append(KeyMapping(EKeyHelp, EStdKeyHelp, Key_Help));
- keyMapping.append(KeyMapping(EKeyDial, EStdKeyDial, Key_Call));
- keyMapping.append(KeyMapping(EKeyIncVolume, EStdKeyIncVolume, Key_VolumeUp));
- keyMapping.append(KeyMapping(EKeyDecVolume, EStdKeyDecVolume, Key_VolumeDown));
- keyMapping.append(KeyMapping(EKeyDevice0, EStdKeyDevice0, Key_Context1)); // Found by manual testing.
- keyMapping.append(KeyMapping(EKeyDevice1, EStdKeyDevice1, Key_Context2)); // Found by manual testing.
- keyMapping.append(KeyMapping(EKeyDevice3, EStdKeyDevice3, Key_Select));
-// keyMapping.append(KeyMapping(EKeyDevice7, EStdKeyDevice7, Key_Camera)); //not supported by qt yet
- keyMapping.append(KeyMapping(EKeyApplication0, EStdKeyApplication0, Key_Menu)); // Found by manual testing.
- keyMapping.append(KeyMapping(EKeyApplication1, EStdKeyApplication1, Key_Launch1)); // Found by manual testing.
- keyMapping.append(KeyMapping(EKeyApplication2, EStdKeyApplication2, Key_MediaPlay)); // Found by manual testing.
- keyMapping.append(KeyMapping(EKeyApplication3, EStdKeyApplication3, Key_MediaStop)); // Found by manual testing.
- keyMapping.append(KeyMapping(EKeyApplication4, EStdKeyApplication4, Key_MediaNext)); // Found by manual testing.
- keyMapping.append(KeyMapping(EKeyApplication5, EStdKeyApplication5, Key_MediaPrevious)); // Found by manual testing.
- keyMapping.append(KeyMapping(EKeyApplication6, EStdKeyApplication6, Key_Launch6));
- keyMapping.append(KeyMapping(EKeyApplication7, EStdKeyApplication7, Key_Launch7));
- keyMapping.append(KeyMapping(EKeyApplication8, EStdKeyApplication8, Key_Launch8));
- keyMapping.append(KeyMapping(EKeyApplication9, EStdKeyApplication9, Key_Launch9));
- keyMapping.append(KeyMapping(EKeyApplicationA, EStdKeyApplicationA, Key_LaunchA));
- keyMapping.append(KeyMapping(EKeyApplicationB, EStdKeyApplicationB, Key_LaunchB));
- keyMapping.append(KeyMapping(EKeyApplicationC, EStdKeyApplicationC, Key_LaunchC));
- keyMapping.append(KeyMapping(EKeyApplicationD, EStdKeyApplicationD, Key_LaunchD));
- keyMapping.append(KeyMapping(EKeyApplicationE, EStdKeyApplicationE, Key_LaunchE));
- keyMapping.append(KeyMapping(EKeyApplicationF, EStdKeyApplicationF, Key_LaunchF));
-// keyMapping.append(KeyMapping(EKeyApplication19, EStdKeyApplication19, Key_CameraFocus)); //not supported by qt yet
- keyMapping.append(KeyMapping(EKeyYes, EStdKeyYes, Key_Yes));
- keyMapping.append(KeyMapping(EKeyNo, EStdKeyNo, Key_No));
-}
-
int QKeyMapper::mapS60KeyToQt(TUint s60key)
{
- int res = Qt::Key_unknown;
- for ( int i = 0, size = keyMapping.count(); i<size; i++){
- if ( keyMapping[i].s60KeyCode == s60key){
- res = keyMapping[i].qtKey;
- break;
- }
- }
- return res;
+ int res = Qt::Key_unknown;
+ for (int i = 0; keyMapping[i].s60KeyCode != 0; i++) {
+ if (keyMapping[i].s60KeyCode == s60key) {
+ res = keyMapping[i].qtKey;
+ break;
+ }
+ }
+ return res;
}
int QKeyMapper::mapS60ScanCodesToQt(TUint s60scanCode)
{
- int res = Qt::Key_unknown;
- for ( int i = 0, size = keyMapping.count(); i<size; i++){
- if ( keyMapping[i].s60ScanCode == s60scanCode){
- res = keyMapping[i].qtKey;
- break;
- }
- }
- return res;
+ int res = Qt::Key_unknown;
+ for (int i = 0; keyMapping[i].s60KeyCode != 0; i++) {
+ if (keyMapping[i].s60ScanCode == s60scanCode) {
+ res = keyMapping[i].qtKey;
+ break;
+ }
+ }
+ return res;
}
int QKeyMapper::mapQtToS60Key(int qtKey)
{
int res = KErrUnknown;
- for ( int i = 0, size = keyMapping.count(); i<size; i++){
- if ( keyMapping[i].qtKey == qtKey){
- res = keyMapping[i].s60KeyCode;
- break;
- }
- }
- return res;
+ for (int i = 0; keyMapping[i].s60KeyCode != 0; i++) {
+ if (keyMapping[i].qtKey == qtKey) {
+ res = keyMapping[i].s60KeyCode;
+ break;
+ }
+ }
+ return res;
}
int QKeyMapper::mapQtToS60ScanCodes(int qtKey)
{
- int res = KErrUnknown;
- for ( int i = 0, size = keyMapping.count(); i<size; i++){
- if ( keyMapping[i].qtKey == qtKey){
- res = keyMapping[i].s60ScanCode;
- break;
- }
- }
- return res;
+ int res = KErrUnknown;
+ for (int i = 0; keyMapping[i].s60KeyCode != 0; i++) {
+ if (keyMapping[i].qtKey == qtKey) {
+ res = keyMapping[i].s60ScanCode;
+ break;
+ }
+ }
+ return res;
}
--- a/qtmobileextensions/src/keycapture/keymapper.h Wed Aug 18 10:38:12 2010 +0300
+++ b/qtmobileextensions/src/keycapture/keymapper.h Thu Sep 02 21:20:48 2010 +0300
@@ -37,15 +37,12 @@
class QKeyEvent;
-class KeyMapping
-{
-public:
- KeyMapping(TKeyCode aS60KeyCode, TStdScanCode aS60ScanCode, Qt::Key aQtKey) : s60KeyCode(aS60KeyCode), s60ScanCode(aS60ScanCode), qtKey(aQtKey) { };
-
+
+struct KeyMapping{
TKeyCode s60KeyCode;
- TStdScanCode s60ScanCode;
+ TStdScanCode s60ScanCode;
Qt::Key qtKey;
-};
+};
class QKeyMapper
{
@@ -54,9 +51,6 @@
~QKeyMapper();
#if defined(Q_OS_SYMBIAN)
-private:
- QList<KeyMapping> keyMapping;
- void fillKeyMap();
public:
int mapS60KeyToQt(TUint s60key);
int mapS60ScanCodesToQt(TUint s60key);
--- a/qtmobileextensions/src/keycapture/tsrc/test_xqkeycapture.cpp Wed Aug 18 10:38:12 2010 +0300
+++ b/qtmobileextensions/src/keycapture/tsrc/test_xqkeycapture.cpp Thu Sep 02 21:20:48 2010 +0300
@@ -119,6 +119,7 @@
void testKeyMapperFile();
private:
+ QString clearString(const QString& line);
QString clearString(const QString& line, const QString& prefix, const QString& comment);
private:
@@ -1569,6 +1570,13 @@
keyCapture->errorId();
}
+QString TestXQKeyCapture::clearString(const QString& line) {
+ QString s(line);
+ s.replace(" ", "");
+ s.replace("\t", "");
+ return s.trimmed();
+}
+
QString TestXQKeyCapture::clearString(const QString& line, const QString& prefix, const QString& comment) {
QString s(line);
s.replace(prefix, comment);
@@ -1582,45 +1590,64 @@
////////////////////////////////////////////////////////////////
void TestXQKeyCapture::testKeyMapperFile()
{
- QString prefix(" keyMapping.append(KeyMapping(");
+ // test only for emulator build
+ #ifdef __WINSCW__
+
+ QString firstline("static const KeyMapping keyMapping[] = {");
+ QString lastline("};");
QString comment("//");
QStringList qt;
QStringList kc;
QFile qtFile("c:\\qkeymapper_s60.cpp");
- QVERIFY(qtFile.open(QIODevice::ReadOnly | QIODevice::Text));
+ QVERIFY2(qtFile.open(QIODevice::ReadOnly | QIODevice::Text), "Failed to open: qtFile");
QFile kcFile("c:\\keymapper.cpp");
- QVERIFY(kcFile.open(QIODevice::ReadOnly | QIODevice::Text));
+ QVERIFY2(kcFile.open(QIODevice::ReadOnly | QIODevice::Text), "Failed to open: kcFile");
QTextStream inQtFile(&qtFile);
+ bool test(false);
while (!inQtFile.atEnd()) {
QString line = inQtFile.readLine();
- if (line.contains(prefix) && !line.contains(comment)) {
- qt.append(clearString(line, prefix, comment));
+ // trim everything that is on right side of comment and add to list if needed
+ if (test) qt.append(clearString(line.split(comment).at(0)));
+ if (line.contains(firstline)) {
+ test = true;
+ }
+ if (line.contains(lastline)) {
+ test = false;
}
}
-
+ test = false;
QTextStream inKcFile(&kcFile);
while (!inKcFile.atEnd()) {
QString line = inKcFile.readLine();
- if (line.contains(prefix) && !line.contains(comment)) {
- kc.append(clearString(line, prefix, comment));
+ // trim everything that is on right side of comment and add to list if needed
+ if (test) kc.append(clearString(line.split(comment).at(0)));
+ if (line.contains(firstline)) {
+ test = true;
+ }
+ if (line.contains(lastline)) {
+ test = false;
}
}
- QVERIFY(qt.size() == kc.size());
+ QVERIFY2(qt.count() == kc.count(), "Amount of lines inside key definition is different");
for(int i = 0; i < kc.size(); i++) {
QString keys = kc.at(i);
- QVERIFY(qt.contains(keys));
+ QVERIFY2(qt.contains(keys), "qtFile does not contain key(s) from capture keys");
}
for(int i = 0; i < qt.size(); i++) {
QString keys = qt.at(i);
- QVERIFY(kc.contains(keys));
+ QVERIFY2(kc.contains(keys), "kcFile does not conatin qt keys");
}
+#else
+ // Skip test on hw
+ QSKIP( "This test is valid only on emulator", SkipSingle);
+#endif // __WINSCW__
}
--- a/qtmobileextensions/src/keycapture/tsrc/tsrc.pro Wed Aug 18 10:38:12 2010 +0300
+++ b/qtmobileextensions/src/keycapture/tsrc/tsrc.pro Thu Sep 02 21:20:48 2010 +0300
@@ -45,15 +45,26 @@
../xqkeycapture.cpp
symbian {
+
+ LIBS += -lremconinterfacebase -lremconcoreapi -lremconextensionapi
+
HEADERS += ../keycapture_s60_p.h \
../capturerequest_s60.h \
- ../keymapper.h
+ ../keymapper.h \
+ ../targetwrapper.h \
+ ../responsehandler.h \
+ ../responsehandlerex.h
+
SOURCES +=../keycapture_s60_p.cpp \
../capturerequest_s60.cpp \
- ../keymapper.cpp
+ ../keymapper.cpp \
+ ../targetwrapper.cpp \
+ ../responsehandler.cpp \
+ ../responsehandlerex.cpp
- sourcefiles.sources += r:\sf\mw\qt\src\gui\kernel\qkeymapper_s60.cpp
- sourcefiles.sources += r:\sf\mw\qtextensions\qtmobileextensions\src\keycapture\keymapper.cpp
+ sourcefiles.sources += /sf/mw/qt/src/gui/kernel/qkeymapper_s60.cpp
+ sourcefiles.sources += ../keymapper.cpp
+
sourcefiles.path = /
DEPLOYMENT += sourcefiles
} else {