qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcrequest.h
branchRCL_3
changeset 10 cd2778e5acfe
parent 9 5d007b20cfd0
child 11 19a54be74e5e
equal deleted inserted replaced
9:5d007b20cfd0 10:cd2778e5acfe
     1 /*
       
     2 * Copyright (c) 2008 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:  Class to represent a IPC request
       
    19 *
       
    20 */
       
    21 
       
    22 #ifndef XQ_SERVICEIPC_REQUEST_H
       
    23 #define XQ_SERVICEIPC_REQUEST_H
       
    24 
       
    25 #include <QtCore>
       
    26 #include <QList>
       
    27 #include <xqserviceipcdefs.h>
       
    28 #include <xqrequestinfo.h>
       
    29 #include <xqsharablefile.h>
       
    30 
       
    31 namespace QtService {
       
    32         
       
    33     class ServiceIPCSession;
       
    34     class ClientInfo;
       
    35     
       
    36     class SFWIPCSRV_EXPORT ServiceIPCRequest : public QObject
       
    37     {
       
    38     public:
       
    39         virtual ~ServiceIPCRequest();
       
    40     
       
    41         ServiceIPCRequest(ServiceIPCSession* aSession,
       
    42                           qint64 aDataLength,
       
    43                           const QString& aRequestOp);
       
    44         
       
    45         ServiceIPCRequest(ServiceIPCRequest& aRequest);
       
    46         
       
    47         ServiceIPCRequest& operator=(ServiceIPCRequest& aRequest);
       
    48     
       
    49     public:
       
    50         // New function
       
    51     
       
    52         const QString& getOperation();
       
    53     
       
    54         const QByteArray& getData();
       
    55     
       
    56         bool write(const QByteArray& aData);
       
    57     
       
    58         bool completeRequest();
       
    59     
       
    60         bool addRequestdata(const QByteArray& aMoreData);
       
    61 
       
    62         void setClientInfo(ClientInfo *aClientInfo);
       
    63 
       
    64         ClientInfo* clientInfo();
       
    65         
       
    66         ServiceIPCSession* getSession();
       
    67         
       
    68         void setId(int id);
       
    69         
       
    70         int id() const;
       
    71         
       
    72         void setAsync(bool aAsync);
       
    73         
       
    74         bool isAsync() const;
       
    75 
       
    76         void setRequestInfo(XQRequestInfo *info);
       
    77         XQRequestInfo requestInfo() const;
       
    78         
       
    79         void addSharableFile(XQSharableFile *file, int index);
       
    80         XQSharableFile sharableFile(int index) const;
       
    81         
       
    82     private:
       
    83         ServiceIPCSession* iSession; // not owned
       
    84         ClientInfo *iClientInfo;  // owned
       
    85         QString iRequestOp;
       
    86         QByteArray iRequestData;
       
    87         qint64 iDatalength;
       
    88         int iId;
       
    89         bool iAsync;
       
    90         XQRequestInfo iRequestInfo;  // owned
       
    91         QList<XQSharableFile> iSharableFiles;  // owned
       
    92     };
       
    93 
       
    94 }
       
    95 #endif // XQ_SERVICEIPC_REQUEST_H