QXmpp Version: 1.12.0
Loading...
Searching...
No Matches
QXmppCall.h
1// SPDX-FileCopyrightText: 2019 Jeremy Lainé <jeremy.laine@m4x.org>
2// SPDX-FileCopyrightText: 2019 Niels Ole Salscheider <ole@salscheider.org>
3// SPDX-FileCopyrightText: 2025 Linus Jahn <lnj@kaidan.im>
4//
5// SPDX-License-Identifier: LGPL-2.1-or-later
6
7#ifndef QXMPPCALL_H
8#define QXMPPCALL_H
9
10#include "QXmppCallStream.h"
11#include "QXmppClientExtension.h"
12#include "QXmppLogger.h"
13
14#include <QMetaType>
15#include <QObject>
16
17class QHostAddress;
18class QXmppCallPrivate;
20class QXmppCallManagerPrivate;
21
22class QXMPP_EXPORT QXmppCall : public QXmppLoggable
23{
24 Q_OBJECT
26 Q_PROPERTY(Direction direction READ direction CONSTANT)
28 Q_PROPERTY(QString jid READ jid CONSTANT)
30 Q_PROPERTY(State state READ state NOTIFY stateChanged)
31
32public:
34 enum Direction {
36 OutgoingDirection
37 };
38 Q_ENUM(Direction)
39
40
41 enum State {
42 ConnectingState = 0,
43 ActiveState = 1,
44 DisconnectingState = 2,
45 FinishedState = 3
46 };
47 Q_ENUM(State)
48
49 ~QXmppCall();
50
51 QXmppCall::Direction direction() const;
52 QString jid() const;
53 QString sid() const;
54 QXmppCall::State state() const;
55
56 GstElement *pipeline() const;
57 QXmppCallStream *audioStream() const;
58 QXmppCallStream *videoStream() const;
59
60 bool isEncrypted() const;
61
67 Q_SIGNAL void connected();
68
73 Q_SIGNAL void finished();
74
76 Q_SIGNAL void ringing();
77
79 Q_SIGNAL void stateChanged(QXmppCall::State state);
80
82 Q_SIGNAL void streamCreated(QXmppCallStream *stream);
83
84 Q_SLOT void accept();
85 Q_SLOT void hangup();
86 Q_SLOT void addVideo();
87
88private:
89 void onLocalCandidatesChanged(QXmppCallStream *stream);
90 void terminated();
91
92 QXmppCall(const QString &jid, QXmppCall::Direction direction, QXmppCallManager *parent);
93
94 const std::unique_ptr<QXmppCallPrivate> d;
95 friend class QXmppCallManager;
96 friend class QXmppCallManagerPrivate;
97 friend class QXmppCallPrivate;
98};
99
100Q_DECLARE_METATYPE(QXmppCall::State)
101
102#endif
The QXmppCallManager class provides support for making and receiving voice calls.
Definition QXmppCallManager.h:27
Definition QXmppCallStream.h:22
Definition QXmppCall.h:23
Q_SIGNAL void ringing()
This signal is emitted when the remote party is ringing.
Direction
This enum is used to describe the direction of a call.
Definition QXmppCall.h:34
@ IncomingDirection
The call is incoming.
Definition QXmppCall.h:35
Q_SIGNAL void streamCreated(QXmppCallStream *stream)
This signal is emitted when a stream is created.
Q_SIGNAL void finished()
This signal is emitted when a call is finished.
State
This enum is used to describe the state of a call.
Definition QXmppCall.h:41
Q_SIGNAL void connected()
This signal is emitted when a call is connected.
Q_SIGNAL void stateChanged(QXmppCall::State state)
This signal is emitted when the call state changes.
The QXmppLoggable class represents a source of logging messages.
Definition QXmppLogger.h:110