-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.h
65 lines (47 loc) · 1.63 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "isendrecv.h"
#include <QMainWindow>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class QSlider;
class MainToolBar;
class MainWindow : public QMainWindow, public ISendRecv
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
Q_SIGNALS:
// A signal that is emitted when a message is sent to another user
void messageSent(const QString& message);
void messageReceived(const QString& message);
private Q_SLOTS:
void onRingingCall();
void onHangUp();
void onHelp();
void onSettings();
// A slot that is called when the text of the chat input changes
void onChatInputTextChanged(const QString& text);
// A slot that is called when the return key is pressed on the chat input
void onChatInputReturnPressed();
// A slot that is called when the send button is clicked
void onSendButtonClicked();
// A slot that is called when a message is received from another user
void onMessageReceived(const QString& message);
private:
// A helper function that sends a message to another user
void sendMessage(const QString& message);
private:
Ui::MainWindow *ui;
MainToolBar* m_mainToolbar;
QSlider* m_volume;
uintptr_t m_channelId = 0;
// Inherited via ISendRecv
void handleRecv(uintptr_t id, const char* data) override;
QMetaObject::Connection setAudioVolumeLambda(std::function<void(int)> lambda) override;
QMetaObject::Connection setSendLambda(std::function<void(const QString&)> lambda) override;
void onQuit() override;
};
#endif // MAINWINDOW_H