1/****************************************************************************
2**
3** Copyright (C) 2009-2011 Collabora Ltd <info@collabora.co.uk>
4** Copyright (C) 2009 Abner Silva <abner.silva@kdemail.net>
5**
6** This file is part of KDE.
7**
8** This program is free software; you can redistribute it and/or modify
9** it under the terms of the GNU General Public License as published by
10** the Free Software Foundation; either version 2 of the License, or
11** (at your option) any later version.
12**
13** This program 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
16** GNU General Public License for more details.
17**
18** You should have received a copy of the GNU General Public License
19** along with this program; see the file COPYING. If not, write to
20** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21** Boston, MA 02110-1301, USA.
22**
23****************************************************************************/
24
25#ifndef TUBESMANAGER_H
26#define TUBESMANAGER_H
27
28#include <TelepathyQt/StreamTubeClient>
29#include <QtNetwork/QHostAddress>
30#include <KUrl>
31
32class TubesManager : public QObject
33{
34 Q_OBJECT
35
36public:
37 explicit TubesManager(QObject *parent);
38 virtual ~TubesManager();
39
40 void closeTube(const KUrl & url);
41
42Q_SIGNALS:
43 void newConnection(KUrl);
44
45private Q_SLOTS:
46 void onTubeAccepted(
47 const QHostAddress & listenAddress,
48 quint16 listenPort,
49 const QHostAddress & sourceAddress,
50 quint16 sourcePort,
51 const Tp::AccountPtr & account,
52 const Tp::IncomingStreamTubeChannelPtr & tube);
53
54private:
55 Tp::StreamTubeClientPtr m_stubeClient;
56 QHash<KUrl, Tp::IncomingStreamTubeChannelPtr> m_tubes;
57};
58
59#endif
60