qthighway/xqserviceutil/src/xqrequestutil.h
branchRCL_3
changeset 10 cd2778e5acfe
parent 9 5d007b20cfd0
child 11 19a54be74e5e
equal deleted inserted replaced
9:5d007b20cfd0 10:cd2778e5acfe
     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 XQREQUESTUTIL_H
       
    23 #define XQREQUESTUTIL_H
       
    24 
       
    25 #include <QList>
       
    26 #include <QVariant>
       
    27 
       
    28 #include <xqserviceglobal.h>
       
    29 #include <xqaiwinterfacedescriptor.h>
       
    30 #include "xqrequestinfo.h"
       
    31 #include "xqsharablefile.h"
       
    32 
       
    33 
       
    34 //
       
    35 // XQRequestUtil is internal helper class for starting QtHigway service app
       
    36 // and for request handling
       
    37 //
       
    38 // Option key names for XQRequestInfo
       
    39 
       
    40 namespace XQServiceUtils
       
    41 {
       
    42     static const char * OptEmbedded= "XQEmb";    // Option Embedded (off=Non-Embedded)
       
    43     static const char * OptBackground= "XQBg";   // Option Service to Background (missing=no changes in Z-order)
       
    44     static const char * OptForeground= "XQFg";   // Set service app to foreground (missing=no changes in Z-order)
       
    45     static const char * OptSynchronous= "XQSync"; // Option Syncronous / Asynchronous call
       
    46     static const char * InfoSID= "XQSid"; // Client secure ID
       
    47     static const char * InfoVID= "XQVid"; // Client vendor ID
       
    48     static const char * InfoCap= "XQCap"; //Client cap
       
    49     static const char * InfoId= "XQId"; // Request ID
       
    50     
       
    51     // Startup arguments
       
    52     static const char * StartupArgEmbedded = "embedded=yes";
       
    53     static const char * StartupArgService = "service=yes";
       
    54     static const char * StartupArgInterfaceName = "intf=";
       
    55     static const char * StartupArgOperationName = "oper=";
       
    56     static const char * StartupArgServiceName = "xqsn=";
       
    57 }
       
    58 
       
    59 
       
    60 class XQSERVICEUTIL_EXPORT XQRequestUtil
       
    61 {
       
    62     public:
       
    63         XQRequestUtil() ;
       
    64         virtual ~XQRequestUtil() ;
       
    65 
       
    66     // Helper to set the option OptSynchronous 
       
    67     void setSynchronous(bool on);
       
    68     void setSecurityInfo(const quint32 sid, const quint32 vid, const quint32 caps );
       
    69     const XQSharableFile *getSharableFile(int index) const;
       
    70     static int mapError(int error);
       
    71     static QString channelName(const QString &connectionName);
       
    72         
       
    73     public:
       
    74         XQAiwInterfaceDescriptor mDescriptor;  // Contains e.g. service and interface name 
       
    75         XQRequestInfo mInfo;
       
    76         QList<XQSharableFile> mSharableFileArgs;   // Use list even though one file possible to transfer
       
    77         QString mOperation;  // Operation (message) wanted
       
    78 };
       
    79 
       
    80 #endif