--- 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");