blob: 8220b1c55c2a70eea377e5bf6e4da6029dbe93ce [file] [log] [blame]
Edric Milaretcdc978b2015-06-04 11:25:12 -04001/***************************************************************************
2 * Copyright (C) 2015 by Savoir-Faire Linux *
3 * 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
19#ifndef INSTANTMESSAGINGWIDGET_H
20#define INSTANTMESSAGINGWIDGET_H
21
22#include <QWidget>
23#include <QKeyEvent>
Edric Milaret83b248c2015-06-02 11:42:23 -040024#include <QSettings>
Edric Milaretcdc978b2015-06-04 11:25:12 -040025
26#include "call.h"
27#include "media/media.h"
28
Edric Milaret83b248c2015-06-02 11:42:23 -040029#include "imdelegate.h"
30
Edric Milaretcdc978b2015-06-04 11:25:12 -040031namespace Ui {
32class InstantMessagingWidget;
33}
34
Edric Milaretbd0baf82015-06-22 14:58:06 -040035class InstantMessagingWidget final : public QWidget
Edric Milaretcdc978b2015-06-04 11:25:12 -040036{
37 Q_OBJECT
38
39public:
40 explicit InstantMessagingWidget(QWidget *parent = 0);
41 ~InstantMessagingWidget();
42 void setMediaText(Call* call);
43
44protected:
Edric Milaretbd0baf82015-06-22 14:58:06 -040045 virtual void keyPressEvent(QKeyEvent *event) override;
46 virtual void showEvent(QShowEvent * event) override;
Edric Milaretcdc978b2015-06-04 11:25:12 -040047
Edric Milaretd398dcb2015-06-05 17:02:14 -040048//UI SLOTS
49private slots:
50 void on_sendButton_clicked();
51
Edric Milaretcdc978b2015-06-04 11:25:12 -040052private slots:
53 void mediaAdd(Media::Media *media);
Edric Milaret2cf34292015-06-22 16:27:03 -040054 void onMsgReceived(const QMap<QString, QString>& message);
Edric Milaretcdc978b2015-06-04 11:25:12 -040055
56private:
57 Ui::InstantMessagingWidget *ui;
Edric Milaret83b248c2015-06-02 11:42:23 -040058 ImDelegate* imDelegate_;
59 QSettings settings_;
Edric Milaretcdc978b2015-06-04 11:25:12 -040060 void copyToClipboard();
61};
62
63#endif // INSTANTMESSAGINGWIDGET_H