logsui/logsengine/tsrc/stubs/qthighway_stub.cpp
changeset 15 76d2cf7a585e
parent 9 68f3171a5819
child 21 2f0af9ba7665
equal deleted inserted replaced
13:52d644758b05 15:76d2cf7a585e
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <xqservicerequest.h>
    18 #include <xqservicerequest.h>
    19 #include <xqrequestinfo.h>
    19 #include <xqrequestinfo.h>
       
    20 #include <xqappmgr.h>
    20 #include <QHash>
    21 #include <QHash>
    21 #include "qthighway_stub_helper.h"
    22 #include "qthighway_stub_helper.h"
    22 
    23 
    23 QString qtHighwayStubService;
    24 QString qtHighwayStubService;
    24 QString qtHighwayStubMessage;
    25 QString qtHighwayStubMessage;
    25 bool qtHighwayStubRequestBg = false;
    26 bool qtHighwayStubRequestBg = false;
    26 bool qtHighwayStubRequestEmbedded = false;
    27 bool qtHighwayStubRequestEmbedded = false;
    27 
    28 
       
    29 QString qtAiwStubInterface;
       
    30 QString qtAiwStubOperation;
       
    31 bool qtAiwStubSynchronous = true;
       
    32 bool qtAiwFailCreateRequest = false;
       
    33 
    28 void QtHighwayStubHelper::reset()
    34 void QtHighwayStubHelper::reset()
    29 {
    35 {
    30     qtHighwayStubService.clear();
    36     qtHighwayStubService.clear();
    31     qtHighwayStubMessage.clear();
    37     qtHighwayStubMessage.clear();
    32     qtHighwayStubRequestBg = false;
    38     qtHighwayStubRequestBg = false;
    33     qtHighwayStubRequestEmbedded = false;
    39     qtHighwayStubRequestEmbedded = false;
       
    40     qtAiwStubInterface.clear();
       
    41     qtAiwStubOperation.clear();
       
    42     qtAiwStubSynchronous = true;
       
    43     qtAiwFailCreateRequest = false;
       
    44 }
       
    45 
       
    46 bool QtHighwayStubHelper::isRequestSynchronous()
       
    47 {
       
    48     return qtAiwStubSynchronous;
       
    49 }
       
    50 
       
    51 void QtHighwayStubHelper::setFailCreateAiwRequest(bool fail)
       
    52 {
       
    53     qtAiwFailCreateRequest = fail;
    34 }
    54 }
    35 
    55 
    36 QString QtHighwayStubHelper::service()
    56 QString QtHighwayStubHelper::service()
    37 {
    57 {
    38     return qtHighwayStubService;
    58     return qtHighwayStubService;
   122 
   142 
   123 void XQRequestInfo::setEmbedded(bool embedded)
   143 void XQRequestInfo::setEmbedded(bool embedded)
   124 {
   144 {
   125     qtHighwayStubRequestEmbedded = embedded;
   145     qtHighwayStubRequestEmbedded = embedded;
   126 }
   146 }
       
   147 
       
   148 
       
   149 // -----------------------------------------------------------------------------
       
   150 // XQApplicationManager stubs
       
   151 // -----------------------------------------------------------------------------
       
   152 //
       
   153 XQApplicationManager::XQApplicationManager()
       
   154 {
       
   155 }
       
   156 
       
   157 XQApplicationManager::~XQApplicationManager()
       
   158 {
       
   159 }
       
   160 
       
   161 XQAiwRequest* XQApplicationManager::create( const QString& interface, 
       
   162         const QString& operation, bool embedded)
       
   163 {
       
   164     if (!qtAiwFailCreateRequest) {
       
   165         qtAiwStubInterface = interface;
       
   166         qtAiwStubOperation = operation;
       
   167         qtHighwayStubRequestEmbedded = embedded;
       
   168         XQAiwInterfaceDescriptor descr;
       
   169         return new XQAiwRequest(descr, operation, embedded);
       
   170     } else {
       
   171         return 0; 
       
   172     }
       
   173 }
       
   174 
       
   175 XQAiwRequest::XQAiwRequest(const XQAiwInterfaceDescriptor &descriptor, 
       
   176         const QString &operation, bool embedded)
       
   177 {
       
   178     Q_UNUSED(descriptor)
       
   179     Q_UNUSED(operation)
       
   180     Q_UNUSED(embedded)
       
   181 }
       
   182 
       
   183 XQAiwRequest::~XQAiwRequest()
       
   184 {    
       
   185 }
       
   186 
       
   187 const QString& XQAiwRequest::operation() const
       
   188 {
       
   189     return qtAiwStubOperation;
       
   190 }
       
   191 
       
   192 const XQAiwInterfaceDescriptor& XQAiwRequest::descriptor() const
       
   193 {
       
   194     return XQAiwInterfaceDescriptor();
       
   195 }
       
   196 
       
   197 void XQAiwRequest::setArguments(const QList<QVariant> &arguments)
       
   198 {
       
   199     Q_UNUSED(arguments)
       
   200 }
       
   201 
       
   202 bool XQAiwRequest::send()
       
   203 {
       
   204     return true;
       
   205 }
       
   206 
       
   207 void XQAiwRequest::setSynchronous(bool synchronous)
       
   208 {
       
   209     qtAiwStubSynchronous = synchronous;
       
   210 }
       
   211 
       
   212 XQAiwInterfaceDescriptor::XQAiwInterfaceDescriptor()
       
   213 {    
       
   214 }
       
   215 
       
   216 XQAiwInterfaceDescriptor::~XQAiwInterfaceDescriptor()
       
   217 {    
       
   218 }
       
   219 
       
   220 QString XQAiwInterfaceDescriptor::interfaceName() const
       
   221 {
       
   222     return qtAiwStubInterface;
       
   223 }