~tiagosh/telepathy-qt/group-chat2

« back to all changes in this revision

Viewing changes to TelepathyQt/incoming-file-transfer-channel.h

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo
  • Date: 2013-06-06 04:56:14 UTC
  • Revision ID: package-import@ubuntu.com-20130606045614-inpxexo6765rnmp1
Tags: upstream-0.9.3
ImportĀ upstreamĀ versionĀ 0.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * This file is part of TelepathyQt
 
3
 *
 
4
 * @copyright Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
 
5
 * @copyright Copyright (C) 2009 Nokia Corporation
 
6
 * @license LGPL 2.1
 
7
 *
 
8
 * This library is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Lesser General Public
 
10
 * License as published by the Free Software Foundation; either
 
11
 * version 2.1 of the License, or (at your option) any later version.
 
12
 *
 
13
 * This library is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
 * Lesser General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU Lesser General Public
 
19
 * License along with this library; if not, write to the Free Software
 
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
21
 */
 
22
 
 
23
#ifndef _TelepathyQt_incoming_file_transfer_channel_h_HEADER_GUARD_
 
24
#define _TelepathyQt_incoming_file_transfer_channel_h_HEADER_GUARD_
 
25
 
 
26
#ifndef IN_TP_QT_HEADER
 
27
#error IN_TP_QT_HEADER
 
28
#endif
 
29
 
 
30
#include <TelepathyQt/FileTransferChannel>
 
31
 
 
32
#include <QAbstractSocket>
 
33
 
 
34
namespace Tp
 
35
{
 
36
 
 
37
class TP_QT_EXPORT IncomingFileTransferChannel : public FileTransferChannel
 
38
{
 
39
    Q_OBJECT
 
40
    Q_DISABLE_COPY(IncomingFileTransferChannel)
 
41
 
 
42
public:
 
43
    static const Feature FeatureCore;
 
44
 
 
45
    static IncomingFileTransferChannelPtr create(const ConnectionPtr &connection,
 
46
            const QString &objectPath, const QVariantMap &immutableProperties);
 
47
 
 
48
    virtual ~IncomingFileTransferChannel();
 
49
 
 
50
    PendingOperation *setUri(const QString& uri);
 
51
    PendingOperation *acceptFile(qulonglong offset, QIODevice *output);
 
52
 
 
53
Q_SIGNALS:
 
54
    void uriDefined(const QString &uri);
 
55
 
 
56
protected:
 
57
    IncomingFileTransferChannel(const ConnectionPtr &connection,
 
58
            const QString &objectPath,
 
59
            const QVariantMap &immutableProperties,
 
60
            const Feature &coreFeature = IncomingFileTransferChannel::FeatureCore);
 
61
 
 
62
private Q_SLOTS:
 
63
    TP_QT_NO_EXPORT void onAcceptFileFinished(Tp::PendingOperation *op);
 
64
 
 
65
    TP_QT_NO_EXPORT void onSocketConnected();
 
66
    TP_QT_NO_EXPORT void onSocketDisconnected();
 
67
    TP_QT_NO_EXPORT void onSocketError(QAbstractSocket::SocketError error);
 
68
    TP_QT_NO_EXPORT void doTransfer();
 
69
 
 
70
private:
 
71
    TP_QT_NO_EXPORT void connectToHost();
 
72
    TP_QT_NO_EXPORT void setFinished();
 
73
 
 
74
    struct Private;
 
75
    friend struct Private;
 
76
    Private *mPriv;
 
77
};
 
78
 
 
79
} // Tp
 
80
 
 
81
#endif