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