callwidget.h 2.93 KB
Newer Older
Edric Milaret's avatar
Edric Milaret committed
1
/***************************************************************************
Edric Milaret's avatar
Edric Milaret committed
2
 * Copyright (C) 2015 by Savoir-faire Linux                                *
Edric Milaret's avatar
Edric Milaret committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
 *                                                                         *
 * This program is free software; you can redistribute it and/or modify    *
 * it under the terms of the GNU General Public License as published by    *
 * the Free Software Foundation; either version 3 of the License, or       *
 * (at your option) any later version.                                     *
 *                                                                         *
 * This program is distributed in the hope that it will be useful,         *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 * GNU General Public License for more details.                            *
 *                                                                         *
 * You should have received a copy of the GNU General Public License       *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 **************************************************************************/

Edric Milaret's avatar
Edric Milaret committed
19
#pragma once
Edric Milaret's avatar
Edric Milaret committed
20 21

#include <QWidget>
22 23
#include <QVector>
#include <QString>
Edric Milaret's avatar
Edric Milaret committed
24
#include <QMenu>
25
#include <QItemSelection>
26
#include <QMovie>
Edric Milaret's avatar
Edric Milaret committed
27 28

#include "navwidget.h"
Edric Milaret's avatar
Edric Milaret committed
29
#include "instantmessagingwidget.h"
Edric Milaret's avatar
Edric Milaret committed
30 31
#include "historydelegate.h"
#include "contactdelegate.h"
Edric Milaret's avatar
Edric Milaret committed
32 33 34 35

#include "callmodel.h"
#include "video/renderer.h"
#include "video/previewmanager.h"
36
#include "accountmodel.h"
Edric Milaret's avatar
Edric Milaret committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#include "categorizedhistorymodel.h"

namespace Ui {
class CallWidget;
}

class CallWidget : public NavWidget
{
    Q_OBJECT

public:
    explicit CallWidget(QWidget *parent = 0);
    ~CallWidget();
    void atExit();

//UI SLOTS
private slots:
    void on_acceptButton_clicked();
    void on_refuseButton_clicked();
56
    void on_contactView_doubleClicked(const QModelIndex &index);
57
    void on_historyList_doubleClicked(const QModelIndex &index);
58
    void on_sortComboBox_currentIndexChanged(int index);
59
    void on_callList_activated(const QModelIndex &index);
Edric Milaret's avatar
Edric Milaret committed
60 61 62 63 64

private slots:
    void callIncoming(Call *call);
    void addedCall(Call *call, Call *parent);
    void callStateChanged(Call *call, Call::State previousState);
65
    void findRingAccount(QModelIndex idx1, QModelIndex idx2, QVector<int> vec);
66
    void checkRegistrationState(Account* account,Account::RegistrationState state);
Edric Milaret's avatar
Edric Milaret committed
67

68 69
    void on_cancelButton_clicked();

Edric Milaret's avatar
Edric Milaret committed
70 71 72 73 74 75 76
private:
    Ui::CallWidget *ui;
    Call* actualCall_;
    Video::Renderer* videoRenderer_;
    CallModel* callModel_;
    int outputVolume_;
    int inputVolume_;
Edric Milaret's avatar
Edric Milaret committed
77
    QMenu *menu_;
78
    QMovie *spinner_;
Edric Milaret's avatar
Edric Milaret committed
79 80 81
    HistoryDelegate *historyDelegate_;
    ContactDelegate *contactDelegate_;

Edric Milaret's avatar
Edric Milaret committed
82
private:
Edric Milaret's avatar
Edric Milaret committed
83
    void findRingAccount();
84
    void setActualCall(Call *value);
85
    void displaySpinner(bool display);
Edric Milaret's avatar
Edric Milaret committed
86 87
};