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 | 7d40a4a | 2015-05-13 13:01:15 -0400 | [diff] [blame] | 25 | #include <QMenu> |
Edric Milaret | 029b95a | 2015-06-09 09:51:44 -0400 | [diff] [blame] | 26 | #include <QItemSelection> |
Edric Milaret | c7ab550 | 2015-06-15 11:18:02 -0400 | [diff] [blame] | 27 | #include <QMovie> |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 28 | |
| 29 | #include "navwidget.h" |
Edric Milaret | cdc978b | 2015-06-04 11:25:12 -0400 | [diff] [blame] | 30 | #include "instantmessagingwidget.h" |
Edric Milaret | 01f2384 | 2015-06-22 14:46:01 -0400 | [diff] [blame] | 31 | #include "historydelegate.h" |
| 32 | #include "contactdelegate.h" |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 33 | |
| 34 | #include "callmodel.h" |
| 35 | #include "video/renderer.h" |
| 36 | #include "video/previewmanager.h" |
Edric Milaret | e5afb07 | 2015-06-02 16:45:44 -0400 | [diff] [blame] | 37 | #include "accountmodel.h" |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 38 | #include "categorizedhistorymodel.h" |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 39 | |
| 40 | namespace Ui { |
| 41 | class CallWidget; |
| 42 | } |
| 43 | |
| 44 | class CallWidget : public NavWidget |
| 45 | { |
| 46 | Q_OBJECT |
| 47 | |
| 48 | public: |
| 49 | explicit CallWidget(QWidget *parent = 0); |
| 50 | ~CallWidget(); |
| 51 | void atExit(); |
| 52 | |
| 53 | //UI SLOTS |
| 54 | private slots: |
| 55 | void on_acceptButton_clicked(); |
| 56 | void on_refuseButton_clicked(); |
Edric Milaret | 67007d1 | 2015-05-07 09:40:09 -0400 | [diff] [blame] | 57 | void on_contactView_doubleClicked(const QModelIndex &index); |
Edric Milaret | 53f57b6 | 2015-05-11 11:02:17 -0400 | [diff] [blame] | 58 | void on_historyList_doubleClicked(const QModelIndex &index); |
Edric Milaret | 1b197eb | 2015-06-01 15:09:56 -0400 | [diff] [blame] | 59 | void on_sortComboBox_currentIndexChanged(int index); |
Edric Milaret | 029b95a | 2015-06-09 09:51:44 -0400 | [diff] [blame] | 60 | void on_callList_activated(const QModelIndex &index); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 61 | |
| 62 | private slots: |
| 63 | void callIncoming(Call *call); |
| 64 | void addedCall(Call *call, Call *parent); |
| 65 | void callStateChanged(Call *call, Call::State previousState); |
Edric Milaret | 67007d1 | 2015-05-07 09:40:09 -0400 | [diff] [blame] | 66 | void findRingAccount(QModelIndex idx1, QModelIndex idx2, QVector<int> vec); |
Edric Milaret | e5afb07 | 2015-06-02 16:45:44 -0400 | [diff] [blame] | 67 | void checkRegistrationState(Account* account,Account::RegistrationState state); |
Edric Milaret | 1235382 | 2015-05-14 14:41:09 -0400 | [diff] [blame] | 68 | |
Edric Milaret | d8528fa | 2015-07-07 14:13:51 -0400 | [diff] [blame] | 69 | void on_cancelButton_clicked(); |
| 70 | |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 71 | private: |
| 72 | Ui::CallWidget *ui; |
| 73 | Call* actualCall_; |
| 74 | Video::Renderer* videoRenderer_; |
| 75 | CallModel* callModel_; |
| 76 | int outputVolume_; |
| 77 | int inputVolume_; |
Edric Milaret | 7d40a4a | 2015-05-13 13:01:15 -0400 | [diff] [blame] | 78 | QMenu *menu_; |
Edric Milaret | c7ab550 | 2015-06-15 11:18:02 -0400 | [diff] [blame] | 79 | QMovie *spinner_; |
Edric Milaret | 01f2384 | 2015-06-22 14:46:01 -0400 | [diff] [blame] | 80 | HistoryDelegate *historyDelegate_; |
| 81 | ContactDelegate *contactDelegate_; |
| 82 | |
Edric Milaret | 7d40a4a | 2015-05-13 13:01:15 -0400 | [diff] [blame] | 83 | private: |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 84 | void findRingAccount(); |
Edric Milaret | 6456baa | 2015-05-21 12:18:07 -0400 | [diff] [blame] | 85 | void setActualCall(Call *value); |
Edric Milaret | c7ab550 | 2015-06-15 11:18:02 -0400 | [diff] [blame] | 86 | void displaySpinner(bool display); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 87 | }; |
| 88 | |
| 89 | #endif // CALLWIDGET_H |