Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 1 | /*************************************************************************** |
Edric Milaret | 5f316da | 2015-09-28 11:57:42 -0400 | [diff] [blame] | 2 | * Copyright (C) 2015 by Savoir-faire Linux * |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 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 | |
Edric Milaret | 5f316da | 2015-09-28 11:57:42 -0400 | [diff] [blame] | 19 | #pragma once |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 20 | |
| 21 | #include <QWidget> |
| 22 | #include <QKeyEvent> |
Edric Milaret | 83b248c | 2015-06-02 11:42:23 -0400 | [diff] [blame] | 23 | #include <QSettings> |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 24 | |
| 25 | #include "call.h" |
| 26 | #include "media/media.h" |
| 27 | |
Edric Milaret | 83b248c | 2015-06-02 11:42:23 -0400 | [diff] [blame] | 28 | #include "imdelegate.h" |
| 29 | |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 30 | namespace Ui { |
| 31 | class InstantMessagingWidget; |
| 32 | } |
| 33 | |
Edric Milaret | bd0baf8 | 2015-06-22 14:58:06 -0400 | [diff] [blame] | 34 | class InstantMessagingWidget final : public QWidget |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 35 | { |
| 36 | Q_OBJECT |
| 37 | |
| 38 | public: |
| 39 | explicit InstantMessagingWidget(QWidget *parent = 0); |
| 40 | ~InstantMessagingWidget(); |
| 41 | void setMediaText(Call* call); |
| 42 | |
| 43 | protected: |
Edric Milaret | bd0baf8 | 2015-06-22 14:58:06 -0400 | [diff] [blame] | 44 | virtual void keyPressEvent(QKeyEvent *event) override; |
| 45 | virtual void showEvent(QShowEvent * event) override; |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 46 | |
Edric Milaret | d398dcb | 2015-06-05 17:02:14 -0400 | [diff] [blame] | 47 | //UI SLOTS |
| 48 | private slots: |
| 49 | void on_sendButton_clicked(); |
| 50 | |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 51 | private slots: |
| 52 | void mediaAdd(Media::Media *media); |
Edric Milaret | 2cf3429 | 2015-06-22 16:27:03 -0400 | [diff] [blame] | 53 | void onMsgReceived(const QMap<QString, QString>& message); |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 54 | |
| 55 | private: |
| 56 | Ui::InstantMessagingWidget *ui; |
Edric Milaret | 83b248c | 2015-06-02 11:42:23 -0400 | [diff] [blame] | 57 | ImDelegate* imDelegate_; |
| 58 | QSettings settings_; |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 59 | void copyToClipboard(); |
| 60 | }; |
| 61 | |