channelDestroyed hadling, TPSESSION_DEBUG env
[tpsession] / tpsession-0.1 / tpsession / tpsessionchannel.h
1 /*
2  * This file is part of TpSession
3  *
4  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
5  * Contact Kate Alhola  kate.alholanokia.com
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21 #ifndef TPSESSIONCHANNEL_H
22 #define TPSESSIONCHANNEL_H
23
24 #include <QObject>
25 #include <TelepathyQt4/Types>
26 #include <TelepathyQt4/Types>
27 #include <TelepathyQt4/Message>
28 #include <TelepathyQt4/PendingChannel>
29 #include <TelepathyQt4/ChannelRequest>
30 #include <TelepathyQt4/Channel>
31 #include <TelepathyQt4/TextChannel>
32 #include <TelepathyQt4/PendingReady>
33 #include <TelepathyQt4/ContactManager>
34 #include <TelepathyQt4/Connection>
35
36 class TpSessionChannel;
37
38 #include "tpsession.h"
39
40 class TpSessionChannel : public QObject
41 {
42   Q_OBJECT
43 public:
44     TpSessionChannel(Tp::TextChannelPtr);
45     TpSessionChannel(Tp::ConnectionPtr conn,const Tp::ContactPtr &contact);
46     void sendMessage(QString message);
47     QString peerId();
48     QString objectPath();
49     QString type();
50 signals:
51   void channelReady(TpSessionChannel *);
52   void channelDestroyed(TpSessionChannel *);
53   void messageReceived(const Tp::ReceivedMessage &,TpSessionChannel *);
54   void messageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *);
55 public slots:
56     void onChannelCreated(Tp::PendingOperation *op);
57     void onChannelReady(Tp::PendingOperation *op);
58     void onChannelDestroyed();
59     void onMessageReceived(const Tp::ReceivedMessage &);
60     void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &);
61 public:
62     Tp::ContactPtr peerContact;
63     Tp::TextChannelPtr channel;
64 };
65
66 #endif // TPSESSIONCHANNEL_H