Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 1 | /*************************************************************************** |
Edric Milaret | 4bba46d | 2015-04-29 16:33:38 -0400 | [diff] [blame] | 2 | * Copyright (C) 2015 by Savoir-Faire Linux * |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -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 | |
| 19 | #ifndef CALLWIDGET_H |
| 20 | #define CALLWIDGET_H |
| 21 | |
| 22 | #include <QWidget> |
Edric Milaret | 67007d1 | 2015-05-07 09:40:09 -0400 | [diff] [blame] | 23 | #include <QVector> |
| 24 | #include <QString> |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 25 | |
| 26 | #include "navwidget.h" |
| 27 | |
| 28 | #include "callmodel.h" |
| 29 | #include "video/renderer.h" |
| 30 | #include "video/previewmanager.h" |
| 31 | |
| 32 | #include "categorizedhistorymodel.h" |
| 33 | #include "minimalhistorybackend.h" |
| 34 | |
| 35 | namespace Ui { |
| 36 | class CallWidget; |
| 37 | } |
| 38 | |
| 39 | class CallWidget : public NavWidget |
| 40 | { |
| 41 | Q_OBJECT |
| 42 | |
Edric Milaret | 67007d1 | 2015-05-07 09:40:09 -0400 | [diff] [blame] | 43 | const QVector<QString> state = {"New", "Incoming", "Ringing", "Current", |
| 44 | "Dialing", "Hold", "Failure", "Busy", |
| 45 | "Transferred", "Transfer hold", "Over", |
| 46 | "Error", "Conference", |
| 47 | "Conference Hold", "Initialization", |
| 48 | "Aborted", "Connected"}; |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 49 | public: |
| 50 | explicit CallWidget(QWidget *parent = 0); |
| 51 | ~CallWidget(); |
| 52 | void atExit(); |
| 53 | |
| 54 | //UI SLOTS |
| 55 | private slots: |
| 56 | void on_acceptButton_clicked(); |
| 57 | void on_refuseButton_clicked(); |
| 58 | void on_holdButton_toggled(bool checked); |
| 59 | void on_hangupButton_clicked(); |
| 60 | void on_callList_activated(const QModelIndex &index); |
| 61 | void on_muteSpeakerButton_toggled(bool checked); |
| 62 | void on_muteMicButton_toggled(bool checked); |
| 63 | void on_speakerSlider_sliderMoved(int position); |
| 64 | void on_speakerSlider_sliderReleased(); |
| 65 | void on_micSlider_sliderMoved(int position); |
| 66 | void on_micSlider_sliderReleased(); |
Edric Milaret | 67007d1 | 2015-05-07 09:40:09 -0400 | [diff] [blame] | 67 | void on_contactView_doubleClicked(const QModelIndex &index); |
Edric Milaret | 53f57b6 | 2015-05-11 11:02:17 -0400 | [diff] [blame] | 68 | void on_historyList_doubleClicked(const QModelIndex &index); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 69 | |
| 70 | private slots: |
| 71 | void callIncoming(Call *call); |
| 72 | void addedCall(Call *call, Call *parent); |
| 73 | void callStateChanged(Call *call, Call::State previousState); |
Edric Milaret | 67007d1 | 2015-05-07 09:40:09 -0400 | [diff] [blame] | 74 | void findRingAccount(QModelIndex idx1, QModelIndex idx2, QVector<int> vec); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 75 | |
| 76 | private: |
| 77 | Ui::CallWidget *ui; |
| 78 | Call* actualCall_; |
| 79 | Video::Renderer* videoRenderer_; |
| 80 | CallModel* callModel_; |
| 81 | int outputVolume_; |
| 82 | int inputVolume_; |
| 83 | void findRingAccount(); |
Edric Milaret | 6456baa | 2015-05-21 12:18:07 -0400 | [diff] [blame^] | 84 | void setActualCall(Call *value); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 85 | }; |
| 86 | |
| 87 | #endif // CALLWIDGET_H |