blob: 81f5022bcf9c17be397c080d295117ee7a9f9a11 [file] [log] [blame]
Edric Milaret627500d2015-03-27 16:41:40 -04001/***************************************************************************
Edric Milaret4bba46d2015-04-29 16:33:38 -04002 * Copyright (C) 2015 by Savoir-Faire Linux *
Edric Milaret627500d2015-03-27 16:41:40 -04003 * 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 Milaret67007d12015-05-07 09:40:09 -040023#include <QVector>
24#include <QString>
Edric Milaret7d40a4a2015-05-13 13:01:15 -040025#include <QMenu>
Edric Milaret029b95a2015-06-09 09:51:44 -040026#include <QItemSelection>
Edric Milaretc7ab5502015-06-15 11:18:02 -040027#include <QMovie>
Edric Milaret627500d2015-03-27 16:41:40 -040028
29#include "navwidget.h"
Edric Milaretcdc978b2015-06-04 11:25:12 -040030#include "instantmessagingwidget.h"
Edric Milaret01f23842015-06-22 14:46:01 -040031#include "historydelegate.h"
32#include "contactdelegate.h"
Edric Milaret627500d2015-03-27 16:41:40 -040033
34#include "callmodel.h"
35#include "video/renderer.h"
36#include "video/previewmanager.h"
Edric Milarete5afb072015-06-02 16:45:44 -040037#include "accountmodel.h"
Edric Milaret627500d2015-03-27 16:41:40 -040038#include "categorizedhistorymodel.h"
Edric Milaret627500d2015-03-27 16:41:40 -040039
40namespace Ui {
41class CallWidget;
42}
43
44class CallWidget : public NavWidget
45{
46 Q_OBJECT
47
48public:
49 explicit CallWidget(QWidget *parent = 0);
50 ~CallWidget();
51 void atExit();
52
53//UI SLOTS
54private slots:
55 void on_acceptButton_clicked();
56 void on_refuseButton_clicked();
Edric Milaret67007d12015-05-07 09:40:09 -040057 void on_contactView_doubleClicked(const QModelIndex &index);
Edric Milaret53f57b62015-05-11 11:02:17 -040058 void on_historyList_doubleClicked(const QModelIndex &index);
Edric Milaret1b197eb2015-06-01 15:09:56 -040059 void on_sortComboBox_currentIndexChanged(int index);
Edric Milaret029b95a2015-06-09 09:51:44 -040060 void on_callList_activated(const QModelIndex &index);
Edric Milaret627500d2015-03-27 16:41:40 -040061
62private slots:
63 void callIncoming(Call *call);
64 void addedCall(Call *call, Call *parent);
65 void callStateChanged(Call *call, Call::State previousState);
Edric Milaret67007d12015-05-07 09:40:09 -040066 void findRingAccount(QModelIndex idx1, QModelIndex idx2, QVector<int> vec);
Edric Milarete5afb072015-06-02 16:45:44 -040067 void checkRegistrationState(Account* account,Account::RegistrationState state);
Edric Milaret12353822015-05-14 14:41:09 -040068
Edric Milaretd8528fa2015-07-07 14:13:51 -040069 void on_cancelButton_clicked();
70
Edric Milaret627500d2015-03-27 16:41:40 -040071private:
72 Ui::CallWidget *ui;
73 Call* actualCall_;
74 Video::Renderer* videoRenderer_;
75 CallModel* callModel_;
76 int outputVolume_;
77 int inputVolume_;
Edric Milaret7d40a4a2015-05-13 13:01:15 -040078 QMenu *menu_;
Edric Milaretc7ab5502015-06-15 11:18:02 -040079 QMovie *spinner_;
Edric Milaret01f23842015-06-22 14:46:01 -040080 HistoryDelegate *historyDelegate_;
81 ContactDelegate *contactDelegate_;
82
Edric Milaret7d40a4a2015-05-13 13:01:15 -040083private:
Edric Milaret627500d2015-03-27 16:41:40 -040084 void findRingAccount();
Edric Milaret6456baa2015-05-21 12:18:07 -040085 void setActualCall(Call *value);
Edric Milaretc7ab5502015-06-15 11:18:02 -040086 void displaySpinner(bool display);
Edric Milaret627500d2015-03-27 16:41:40 -040087};
88
89#endif // CALLWIDGET_H