Added initial code for text chat with telepathy framework, classes TpTextClientHandler
[miniature:miniature.git] / src / telepathy / tptubesclienthandler.h
1 /* Miniature - A chess board that goes always with you, ready to let
2  * you play and learn wherever you go.
3  *
4  * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
5  *              Dariusz Mikulski <dariusz.mikulski@collabora.co.uk>
6  *
7  *
8  * Miniature 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  * Miniature 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 Miniature. If not, see <http://www.gnu.org/licenses/>.
20  */
21
22 #ifndef TPTUBESCLIENTHANDLER_H
23 #define TPTUBESCLIENTHANDLER_H
24
25 #include <TelepathyQt4/AbstractClientHandler>
26 #include <TelepathyQt4/PendingOperation>
27 #include <TelepathyQt4/Channel>
28
29 #include <QTcpSocket>
30
31 namespace Miniature
32 {
33
34 class TpOutgoingTube;
35 class TpIncomingTube;
36
37 class TpTubesClientHandler : public QObject, public Tp::AbstractClientHandler
38 {
39     Q_OBJECT
40 public:
41     TpTubesClientHandler(QObject *parent = 0);
42     virtual ~TpTubesClientHandler();
43
44     virtual bool bypassApproval() const;
45     virtual void handleChannels(const Tp::MethodInvocationContextPtr<> &context,
46                                 const Tp::AccountPtr &account,
47                                 const Tp::ConnectionPtr &connection,
48                                 const QList<Tp::ChannelPtr> &channels,
49                                 const QList<Tp::ChannelRequestPtr> &requestedSatisfied,
50                                 const QDateTime &userActionTime,
51                                 const QVariantMap &handlerInfo);
52
53 Q_SIGNALS:
54     void newOutgoingTube(QTcpSocket *socket, const Tp::ContactPtr &);
55     void newIncomingTube(QTcpSocket *socket, const Tp::ContactPtr &);    
56
57 private Q_SLOTS:
58     void deleteOutgoingTube();
59     void deleteIncomingTube();
60
61 private:
62     QList<TpOutgoingTube*> mOutgoingTubes;
63     QList<TpIncomingTube*> mIncomingTubes;
64 };
65
66 };
67
68 #endif // TPTUBESCLIENTHANDLER_H