blob: 8bf6455b504de6f0a6e828037c07af6c94d23ac8 [file] [log] [blame]
Edric Milaretcdc978b2015-06-04 11:25:12 -04001/***************************************************************************
Edric Milaret5f316da2015-09-28 11:57:42 -04002 * Copyright (C) 2015 by Savoir-faire Linux *
Edric Milaretcdc978b2015-06-04 11:25:12 -04003 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
Edric Milaret5f316da2015-09-28 11:57:42 -040019#pragma once
Edric Milaretcdc978b2015-06-04 11:25:12 -040020
21#include <QWidget>
22#include <QKeyEvent>
Edric Milaret83b248c2015-06-02 11:42:23 -040023#include <QSettings>
Edric Milaretcdc978b2015-06-04 11:25:12 -040024
25#include "call.h"
26#include "media/media.h"
27
Edric Milaret83b248c2015-06-02 11:42:23 -040028#include "imdelegate.h"
29
Edric Milaretcdc978b2015-06-04 11:25:12 -040030namespace Ui {
31class InstantMessagingWidget;
32}
33
Edric Milaretbd0baf82015-06-22 14:58:06 -040034class InstantMessagingWidget final : public QWidget
Edric Milaretcdc978b2015-06-04 11:25:12 -040035{
36 Q_OBJECT
37
38public:
39 explicit InstantMessagingWidget(QWidget *parent = 0);
40 ~InstantMessagingWidget();
41 void setMediaText(Call* call);
42
43protected:
Edric Milaretbd0baf82015-06-22 14:58:06 -040044 virtual void keyPressEvent(QKeyEvent *event) override;
45 virtual void showEvent(QShowEvent * event) override;
Edric Milaretcdc978b2015-06-04 11:25:12 -040046
Edric Milaretd398dcb2015-06-05 17:02:14 -040047//UI SLOTS
48private slots:
49 void on_sendButton_clicked();
50
Edric Milaretcdc978b2015-06-04 11:25:12 -040051private slots:
52 void mediaAdd(Media::Media *media);
Edric Milaret2cf34292015-06-22 16:27:03 -040053 void onMsgReceived(const QMap<QString, QString>& message);
Edric Milaretcdc978b2015-06-04 11:25:12 -040054
55private:
56 Ui::InstantMessagingWidget *ui;
Edric Milaret83b248c2015-06-02 11:42:23 -040057 ImDelegate* imDelegate_;
58 QSettings settings_;
Edric Milaretcdc978b2015-06-04 11:25:12 -040059 void copyToClipboard();
60};
61