~phablet-team/telephony-service/trunk

« back to all changes in this revision

Viewing changes to handler/chatstartingjob.h

  • Committer: Tiago Salem Herrmann
  • Date: 2016-12-06 16:45:01 UTC
  • mfrom: (1212.1.6 fix-hardcoded-paths)
  • mto: This revision was merged to the branch mainline in revision 1222.
  • Revision ID: tiago.herrmann@canonical.com-20161206164501-rw041bjz35wq9t17
merge parent branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical, Ltd.
 
3
 *
 
4
 * Authors:
 
5
 *  Tiago Salem Herrmann <tiago.herrmann@canonical.com>
 
6
 *  Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
 
7
 *
 
8
 * This file is part of telephony-service.
 
9
 *
 
10
 * telephony-service is free software; you can redistribute it and/or modify
 
11
 * it under the terms of the GNU General Public License as published by
 
12
 * the Free Software Foundation; version 3.
 
13
 *
 
14
 * telephony-service is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
21
 */
 
22
 
 
23
#ifndef CHATSTARTINGJOB_H
 
24
#define CHATSTARTINGJOB_H
 
25
 
 
26
#include <QObject>
 
27
#include "messagejob.h"
 
28
#include <TelepathyQt/Types>
 
29
#include <TelepathyQt/PendingOperation>
 
30
 
 
31
class TextHandler;
 
32
 
 
33
class ChatStartingJob : public MessageJob
 
34
{
 
35
    Q_OBJECT
 
36
    Q_PROPERTY(QString accountId READ accountId CONSTANT)
 
37
    Q_PROPERTY(Tp::TextChannelPtr textChannel READ textChannel NOTIFY textChannelChanged)
 
38
    Q_PROPERTY(QString channelObjectPath READ channelObjectPath NOTIFY channelObjectPathChanged)
 
39
public:
 
40
    ChatStartingJob(TextHandler *textHandler, const QString &accountId, const QVariantMap &properties);
 
41
 
 
42
    QString accountId();
 
43
    Tp::TextChannelPtr textChannel() const;
 
44
    QString channelObjectPath() const;
 
45
 
 
46
public Q_SLOTS:
 
47
    virtual void startJob();
 
48
 
 
49
Q_SIGNALS:
 
50
    void textChannelChanged();
 
51
    void channelObjectPathChanged();
 
52
 
 
53
 
 
54
protected Q_SLOTS:
 
55
    void startTextChat(const Tp::AccountPtr &account, const QVariantMap &properties);
 
56
    void startTextChatRoom(const Tp::AccountPtr &account, const QVariantMap &properties);
 
57
    void setTextChannel(Tp::TextChannelPtr channel);
 
58
 
 
59
    void onChannelRequestFinished(Tp::PendingOperation *op);
 
60
 
 
61
private:
 
62
    TextHandler *mTextHandler;
 
63
    QString mAccountId;
 
64
    QVariantMap mProperties;
 
65
    Tp::TextChannelPtr mTextChannel;
 
66
 
 
67
};
 
68
 
 
69
#endif // CHATSTARTINGJOB_H