smf/smfservermodule/smfclient/client/smfclientqt.h
author cgandhi
Thu, 05 Aug 2010 16:46:37 +0530
changeset 17 106a4bfcb866
parent 13 b5d63d5fc252
permissions -rw-r--r--
pushing the flickr auth app and gallery plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     1
/**
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     2
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     3
 * All rights reserved.
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0"
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     6
 * which accompanies  this distribution, and is available
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     8
 *
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
     9
 * Initial Contributors:
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    10
 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    11
 *
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    12
 * Contributors:
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    13
 * Manasij Roy, Nalina Hariharan
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    14
 */
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    15
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    16
#ifndef SMFCLIENTQT_H
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    17
#define SMFCLIENTQT_H
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    18
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    19
#include <QObject>
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    20
#include <QByteArray>
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    21
#include <QString>
13
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    22
#include <QLocalSocket>
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    23
10
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    24
#include "smfglobal.h"
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    25
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    26
class SmfClientQt : public QObject
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    27
{
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    28
Q_OBJECT
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    29
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    30
public:
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    31
    explicit SmfClientQt(QObject *parent = 0);
13
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    32
    ~SmfClientQt();
10
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    33
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    34
public:
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    35
    /**
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    36
     * Send a request to the server.
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    37
     * @param aSerializedData serialized by the caller.
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    38
     * @param aInterfaceName Interface name
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    39
     * @param requestType Opcode
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    40
     */
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    41
    int sendRequest(QByteArray& aSerializedData,
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    42
                QString aInterfaceName,
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    43
                SmfRequestTypeID requestType);
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    44
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    45
    /**
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    46
     * This overloaded API is for ESmfGetServices, where data should be
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    47
     * fetched synchronously
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    48
     */
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    49
    QByteArray sendRequest(QString aInterfaceName,
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    50
                SmfRequestTypeID requestType);
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    51
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    52
    /**
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    53
     * For testing purpose only
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    54
     */
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    55
    int sendDummyRequest(QByteArray* provider,QString aInterfaceName,
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    56
                SmfRequestTypeID requestType);
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    57
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    58
    /**
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    59
    * CancelRequest.
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    60
    * Cancels an outstanding request.
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    61
    */
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    62
    void CancelRequest();
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    63
13
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    64
private slots:
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    65
    void connectionEstablished();
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    66
    void readIncomingData();
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    67
    void handleError(QLocalSocket::LocalSocketError error);
10
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    68
13
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    69
private:
b5d63d5fc252 Basic functionality on desktop server build. Started a test for GetServices
James Aley <jamesa@symbian.org>
parents: 10
diff changeset
    70
    QLocalSocket *m_serverConnection;
10
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    71
};
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    72
77a56c951f86 Fixed build for Qt desktop
James Aley <jamesa@symbian.org>
parents:
diff changeset
    73
#endif // SMFCLIENTQT_H