qthighway/xqservice/src/xqaiwuridriver.h
branchRCL_3
changeset 9 5d007b20cfd0
equal deleted inserted replaced
8:885c2596c964 9:5d007b20cfd0
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 *
       
     5 * This program is free software: you can redistribute it and/or modify
       
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     8 * 
       
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
       
    13 *
       
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not, 
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:
       
    19 *
       
    20 */
       
    21 
       
    22 #ifndef XQAIWURIDRIVER_H
       
    23 #define XQAIWURIDRIVER_H
       
    24 
       
    25 #include <xqaiwglobal.h>
       
    26 
       
    27 #include <QObject>
       
    28 #include <qglobal.h>
       
    29 
       
    30 #include <QList>
       
    31 #include <QVariant>
       
    32 #include <QAction>
       
    33 #include <QUrl>
       
    34 #include <xqaiwinterfacedescriptor.h>
       
    35 #include "xqaiwrequestdriver.h"
       
    36 #include "xqaiwutils.h"
       
    37 
       
    38 class XQServiceRequest;
       
    39 
       
    40 class XQAiwUriDriver : public XQAiwRequestDriver
       
    41     {
       
    42     Q_OBJECT
       
    43 
       
    44 public:
       
    45 
       
    46     XQAiwUriDriver(
       
    47          const QUrl &uri, const XQAiwInterfaceDescriptor& descriptor, const QString &operation);
       
    48     
       
    49     virtual ~XQAiwUriDriver();
       
    50     
       
    51     void setArguments(const QList<QVariant> &arguments);
       
    52 
       
    53     bool send(QVariant& retValue);
       
    54 
       
    55     QAction *createAction();
       
    56 
       
    57     int lastError() const;
       
    58 
       
    59     const QString& lastErrorMessage() const;
       
    60 
       
    61     const XQAiwInterfaceDescriptor &descriptor() const;
       
    62 
       
    63     void setEmbedded(bool embedded);
       
    64     bool isEmbedded() const;
       
    65 
       
    66     void setOperation(const QString &operation);
       
    67     const QString &operation() const;
       
    68 
       
    69     void setSynchronous(bool synchronous);
       
    70     bool isSynchronous() const;
       
    71 
       
    72     static bool hasCustomHandler(const QUrl &uri);
       
    73 
       
    74     void setBackground(bool background );
       
    75     bool isBackground() const;
       
    76     
       
    77 private slots:
       
    78 
       
    79    void handleAsyncResponse(const QVariant& value);
       
    80    void handleAsyncError(int err);
       
    81    
       
    82 private:   
       
    83    bool handleApptoUri(const QUrl &url);
       
    84    
       
    85 private:
       
    86     QUrl mUri;
       
    87     XQAiwUtils * mUtilities;
       
    88 
       
    89     };
       
    90 
       
    91 #endif /* XQAIWURIDRIVER_H */