blob: 0ded03ed044f6a74aa09687a5f731795d185f8be [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 Milaret627500d2015-03-27 16:41:40 -040025
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
35namespace Ui {
36class CallWidget;
37}
38
39class CallWidget : public NavWidget
40{
41 Q_OBJECT
42
Edric Milaret67007d12015-05-07 09:40:09 -040043 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 Milaret627500d2015-03-27 16:41:40 -040049public:
50 explicit CallWidget(QWidget *parent = 0);
51 ~CallWidget();
52 void atExit();
53
54//UI SLOTS
55private 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 Milaret67007d12015-05-07 09:40:09 -040067 void on_contactView_doubleClicked(const QModelIndex &index);
Edric Milaret53f57b62015-05-11 11:02:17 -040068 void on_historyList_doubleClicked(const QModelIndex &index);
Edric Milaret627500d2015-03-27 16:41:40 -040069
70private slots:
71 void callIncoming(Call *call);
72 void addedCall(Call *call, Call *parent);
73 void callStateChanged(Call *call, Call::State previousState);
Edric Milaret67007d12015-05-07 09:40:09 -040074 void findRingAccount(QModelIndex idx1, QModelIndex idx2, QVector<int> vec);
Edric Milaret627500d2015-03-27 16:41:40 -040075
76private:
77 Ui::CallWidget *ui;
78 Call* actualCall_;
79 Video::Renderer* videoRenderer_;
80 CallModel* callModel_;
81 int outputVolume_;
82 int inputVolume_;
83 void findRingAccount();
Edric Milaret6456baa2015-05-21 12:18:07 -040084 void setActualCall(Call *value);
Edric Milaret627500d2015-03-27 16:41:40 -040085};
86
87#endif // CALLWIDGET_H