You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
1.9 KiB
84 lines
1.9 KiB
// File autogenerated
|
|
|
|
// declaration include
|
|
#include "serviceInterface.h"
|
|
|
|
// TQt includes
|
|
#include <tqdom.h>
|
|
|
|
// TQt D-Bus includes
|
|
#include <tqdbuserror.h>
|
|
#include <tqdbusmessage.h>
|
|
|
|
|
|
namespace org
|
|
{
|
|
namespace example
|
|
{
|
|
|
|
void ServiceInterface::buildIntrospectionData(TQDomElement& interfaceElement)
|
|
{
|
|
interfaceElement.setAttribute("name", "org.example.Service");
|
|
|
|
TQDomDocument document = interfaceElement.ownerDocument();
|
|
TQDomElement methodElement = document.createElement("method");
|
|
methodElement.setAttribute("name", "GetValue");
|
|
|
|
TQDomElement argumentElement = document.createElement("arg");
|
|
argumentElement.setAttribute("name", "output");
|
|
argumentElement.setAttribute("type", "t");
|
|
argumentElement.setAttribute("direction", "out");
|
|
methodElement.appendChild(argumentElement);
|
|
|
|
interfaceElement.appendChild(methodElement);
|
|
}
|
|
|
|
TQT_DBusMessage ServiceInterface::callGetValue(const TQT_DBusMessage& message)
|
|
{
|
|
TQT_DBusError error;
|
|
TQT_DBusMessage reply;
|
|
|
|
TQ_UINT64 _output;
|
|
|
|
if (GetValue(_output, error))
|
|
{
|
|
reply = TQT_DBusMessage::methodReply(message);
|
|
reply << TQT_DBusData::fromUInt64(_output);
|
|
}
|
|
else
|
|
{
|
|
if (!error.isValid())
|
|
{
|
|
tqWarning("Call to implementation of org::example::ServiceInterface::GetValue returned 'false' but error object is not valid!");
|
|
|
|
error = TQT_DBusError::stdFailed("org.example.Service.GetValue execution failed");
|
|
}
|
|
|
|
reply = TQT_DBusMessage::methodError(message, error);
|
|
}
|
|
|
|
return reply;
|
|
}
|
|
|
|
bool ServiceInterface::handleMethodCall(const TQT_DBusMessage& message)
|
|
{
|
|
if (message.interface() != "org.example.Service") return false;
|
|
|
|
if (message.member() == "GetValue")
|
|
{
|
|
TQT_DBusMessage reply = callGetValue(message);
|
|
handleMethodReply(reply);
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
}; // namespace example
|
|
|
|
}; // namespace org
|
|
|
|
// End of File
|
|
|