qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
src
widget
chatformheader.h
Go to the documentation of this file.
1
/*
2
Copyright © 2017-2019 by The qTox Project Contributors
3
4
This file is part of qTox, a Qt-based graphical interface for Tox.
5
6
qTox is libre software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
qTox is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with qTox. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <QWidget>
23
24
#include "
src/core/extension.h
"
25
26
#include <memory>
27
28
class
MaskablePixmapWidget
;
29
class
QVBoxLayout;
30
class
QHBoxLayout;
31
class
CroppingLabel
;
32
class
QPushButton;
33
class
QToolButton;
34
class
CallConfirmWidget
;
35
class
QLabel;
36
class
ExtensionStatus
;
37
38
class
ChatFormHeader
:
public
QWidget
39
{
40
Q_OBJECT
41
public
:
42
enum class
CallButtonState
{
43
Disabled
= 0,
// Grey
44
Avaliable
= 1,
// Green
45
InCall
= 2,
// Red
46
Outgoing
= 3,
// Yellow
47
Incoming
= 4,
// Yellow
48
};
49
enum class
ToolButtonState
{
50
Disabled
= 0,
// Grey
51
Off
= 1,
// Green
52
On
= 2,
// Red
53
};
54
enum
Mode
{
55
None
= 0,
56
Audio
= 1,
57
Video
= 2,
58
AV
=
Audio
|
Video
59
};
60
61
ChatFormHeader
(QWidget* parent =
nullptr
);
62
~ChatFormHeader
();
63
64
void
setName
(
const
QString& newName);
65
void
setMode
(
Mode
mode
);
66
67
void
showOutgoingCall
(
bool
video);
68
void
createCallConfirm
(
bool
video);
69
void
showCallConfirm
();
70
void
removeCallConfirm
();
71
72
void
updateExtensionSupport
(
ExtensionSet
extensions);
73
void
updateCallButtons
(
bool
online,
bool
audio,
bool
video =
false
);
74
void
updateMuteMicButton
(
bool
active,
bool
inputMuted);
75
void
updateMuteVolButton
(
bool
active,
bool
outputMuted);
76
77
void
setAvatar
(
const
QPixmap& img);
78
QSize
getAvatarSize
()
const
;
79
80
// TODO: Remove
81
void
addWidget
(QWidget* widget,
int
stretch = 0, Qt::Alignment alignment = Qt::Alignment());
82
void
addLayout
(QLayout* layout);
83
void
addStretch
();
84
85
public
slots:
86
void
reloadTheme
();
87
88
signals:
89
void
callTriggered
();
90
void
videoCallTriggered
();
91
void
micMuteToggle
();
92
void
volMuteToggle
();
93
94
void
nameChanged
(
const
QString& name);
95
96
void
callAccepted
();
97
void
callRejected
();
98
99
private
slots:
100
void
retranslateUi
();
101
void
updateButtonsView
();
102
103
private
:
104
Mode
mode
;
105
MaskablePixmapWidget
*
avatar
;
106
QVBoxLayout*
headTextLayout
;
107
QHBoxLayout*
nameLine
;
108
ExtensionStatus
*
extensionStatus
;
109
CroppingLabel
*
nameLabel
;
110
111
QPushButton*
callButton
;
112
QPushButton*
videoButton
;
113
QPushButton*
volButton
;
114
QPushButton*
micButton
;
115
116
CallButtonState
callState
;
117
CallButtonState
videoState
;
118
ToolButtonState
volState
;
119
ToolButtonState
micState
;
120
121
std::unique_ptr<CallConfirmWidget>
callConfirm
;
122
};
ChatFormHeader::videoCallTriggered
void videoCallTriggered()
ChatFormHeader::Mode
Mode
Definition:
chatformheader.h:54
CallConfirmWidget
This is a widget with dialog buttons to accept/reject a call.
Definition:
callconfirmwidget.h:31
ChatFormHeader::CallButtonState::Disabled
@ Disabled
ChatFormHeader::volState
ToolButtonState volState
Definition:
chatformheader.h:118
ChatFormHeader::Video
@ Video
Definition:
chatformheader.h:57
ChatFormHeader::updateExtensionSupport
void updateExtensionSupport(ExtensionSet extensions)
Definition:
chatformheader.cpp:237
ChatFormHeader::nameLabel
CroppingLabel * nameLabel
Definition:
chatformheader.h:109
ChatFormHeader::nameLine
QHBoxLayout * nameLine
Definition:
chatformheader.h:107
ChatFormHeader::removeCallConfirm
void removeCallConfirm()
Definition:
chatformheader.cpp:232
CroppingLabel
Definition:
croppinglabel.h:26
ChatFormHeader::showOutgoingCall
void showOutgoingCall(bool video)
Definition:
chatformheader.cpp:211
ChatFormHeader::volMuteToggle
void volMuteToggle()
ChatFormHeader::None
@ None
Definition:
chatformheader.h:55
ChatFormHeader::ToolButtonState::On
@ On
ChatFormHeader::~ChatFormHeader
~ChatFormHeader()
ChatFormHeader::CallButtonState::InCall
@ InCall
ChatFormHeader::micMuteToggle
void micMuteToggle()
ChatFormHeader::videoState
CallButtonState videoState
Definition:
chatformheader.h:117
ChatFormHeader::updateMuteMicButton
void updateMuteMicButton(bool active, bool inputMuted)
Definition:
chatformheader.cpp:269
ChatFormHeader::updateMuteVolButton
void updateMuteVolButton(bool active, bool outputMuted)
Definition:
chatformheader.cpp:281
ChatFormHeader::callRejected
void callRejected()
ChatFormHeader::mode
Mode mode
Definition:
chatformheader.h:104
ChatFormHeader::ToolButtonState
ToolButtonState
Definition:
chatformheader.h:49
ChatFormHeader::videoButton
QPushButton * videoButton
Definition:
chatformheader.h:112
ChatFormHeader::ChatFormHeader
ChatFormHeader(QWidget *parent=nullptr)
Definition:
chatformheader.cpp:111
ChatFormHeader::retranslateUi
void retranslateUi()
Definition:
chatformheader.cpp:193
ChatFormHeader::volButton
QPushButton * volButton
Definition:
chatformheader.h:113
ChatFormHeader::CallButtonState::Avaliable
@ Avaliable
ChatFormHeader::callConfirm
std::unique_ptr< CallConfirmWidget > callConfirm
Definition:
chatformheader.h:121
ChatFormHeader::callState
CallButtonState callState
Definition:
chatformheader.h:116
ChatFormHeader::getAvatarSize
QSize getAvatarSize() const
Definition:
chatformheader.cpp:298
ChatFormHeader::CallButtonState
CallButtonState
Definition:
chatformheader.h:42
ChatFormHeader::setAvatar
void setAvatar(const QPixmap &img)
Definition:
chatformheader.cpp:293
ChatFormHeader::callAccepted
void callAccepted()
MaskablePixmapWidget
Definition:
maskablepixmapwidget.h:24
ChatFormHeader::updateCallButtons
void updateCallButtons(bool online, bool audio, bool video=false)
Definition:
chatformheader.cpp:242
extension.h
ChatFormHeader::addStretch
void addStretch()
Definition:
chatformheader.cpp:322
ChatFormHeader::addLayout
void addLayout(QLayout *layout)
Definition:
chatformheader.cpp:317
ChatFormHeader::extensionStatus
ExtensionStatus * extensionStatus
Definition:
chatformheader.h:108
ChatFormHeader::headTextLayout
QVBoxLayout * headTextLayout
Definition:
chatformheader.h:106
ChatFormHeader::Audio
@ Audio
Definition:
chatformheader.h:56
ChatFormHeader::reloadTheme
void reloadTheme()
Definition:
chatformheader.cpp:303
ChatFormHeader::createCallConfirm
void createCallConfirm(bool video)
Definition:
chatformheader.cpp:218
ChatFormHeader::CallButtonState::Incoming
@ Incoming
ChatFormHeader::micState
ToolButtonState micState
Definition:
chatformheader.h:119
ExtensionSet
std::bitset< ExtensionType::max > ExtensionSet
Definition:
extension.h:32
ExtensionStatus
Definition:
extensionstatus.h:26
ChatFormHeader::showCallConfirm
void showCallConfirm()
Definition:
chatformheader.cpp:226
ChatFormHeader::callTriggered
void callTriggered()
ChatFormHeader::CallButtonState::Outgoing
@ Outgoing
ChatFormHeader::nameChanged
void nameChanged(const QString &name)
ChatFormHeader
Definition:
chatformheader.h:38
ChatFormHeader::setMode
void setMode(Mode mode)
Definition:
chatformheader.cpp:182
ChatFormHeader::updateButtonsView
void updateButtonsView()
Definition:
chatformheader.cpp:201
ChatFormHeader::ToolButtonState::Disabled
@ Disabled
ChatFormHeader::micButton
QPushButton * micButton
Definition:
chatformheader.h:114
ChatFormHeader::addWidget
void addWidget(QWidget *widget, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Definition:
chatformheader.cpp:312
ChatFormHeader::callButton
QPushButton * callButton
Definition:
chatformheader.h:111
ChatFormHeader::avatar
MaskablePixmapWidget * avatar
Definition:
chatformheader.h:105
ChatFormHeader::ToolButtonState::Off
@ Off
ChatFormHeader::setName
void setName(const QString &newName)
Definition:
chatformheader.cpp:175
ChatFormHeader::AV
@ AV
Definition:
chatformheader.h:58
Generated by
1.8.17