2 * This file is part of TpSession
4 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
5 * Contact Kate Alhola kate.alholanokia.com
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.
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.
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
21 #ifndef TPSESSIONACCOUNT_H
22 #define TPSESSIONACCOUNT_H
24 #include <TelepathyQt4/Types>
25 #include <TelepathyQt4/Account>
26 #include <TelepathyQt4/Types>
27 #include <TelepathyQt4/PendingChannelRequest>
28 #include <TelepathyQt4/ChannelRequest>
29 #include <TelepathyQt4/PendingChannel>
30 #include <TelepathyQt4/PendingContacts>
31 #include <TelepathyQt4/Channel>
32 #include <TelepathyQt4/TextChannel>
33 #include <TelepathyQt4/AccountManager>
34 #include <TelepathyQt4/PendingReady>
35 #include <TelepathyQt4/ContactManager>
40 #include "tpsessionchannel.h"
42 class TpSessionAccount:public QObject
47 TpSessionAccount(Tp::AccountManagerPtr am,const QString &objectPath);
48 bool makeContactFromAddress(QString address);
49 void sendMessageToAddress(QString address,QString message);
50 Tp::ContactPtr getContactFromAddress(QString address);
51 void addOutgoingChannel(const Tp::ContactPtr &contact);
52 void addOutgoingChannel(QString address);
53 TpSessionChannel *getChannelFromPeerAddress(QString id);
55 void accountReady(TpSessionAccount *);
56 void channelReady(TpSessionAccount *);
57 void messageQueued(TpSessionAccount *,bool);
58 void messageReceived(const Tp::ReceivedMessage &,TpSessionAccount *);
59 void messageSent(const Tp::Message &,TpSessionAccount *);
60 void newChannel(TpSessionAccount *,QString,QString,const Tp::ChannelDetails &);
61 void contactRetrieved(Tp::ContactPtr,bool,bool);
64 void onReady(Tp::PendingOperation *op);
65 void onOutgoingChannelReady(TpSessionChannel *ch);
66 void onContactsConnectionReady(Tp::PendingOperation *op);
67 void onNewContactRetrieved(Tp::PendingOperation *op);
68 void onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *);
69 void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *);
70 void onNewChannels(const Tp::ChannelDetailsList&);
77 Tp::ConnectionPtr contactsConn;
78 QSet<Tp::ContactPtr> myContacts;
79 QSet<TpSessionChannel *> myChannels;
82 #endif // TPSESSIONACCOUNT_H