QXmpp Version: 1.5.6
Loading...
Searching...
No Matches
QXmppCall.h
1// SPDX-FileCopyrightText: 2019 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPCALL_H
6#define QXMPPCALL_H
7
8#include "QXmppCallStream.h"
9#include "QXmppClientExtension.h"
10#include "QXmppLogger.h"
11
12#include <QMetaType>
13#include <QObject>
14
15class QHostAddress;
16class QXmppCallPrivate;
18class QXmppCallManagerPrivate;
19
20class QXMPP_EXPORT QXmppCall : public QXmppLoggable
21{
22 Q_OBJECT
24 Q_PROPERTY(Direction direction READ direction CONSTANT)
26 Q_PROPERTY(QString jid READ jid CONSTANT)
28 Q_PROPERTY(State state READ state NOTIFY stateChanged)
29
30public:
32 enum Direction {
34 OutgoingDirection
35 };
36 Q_ENUM(Direction)
37
38
39 enum State {
40 ConnectingState = 0,
41 ActiveState = 1,
42 DisconnectingState = 2,
43 FinishedState = 3
44 };
45 Q_ENUM(State)
46
47 ~QXmppCall();
48
49 QXmppCall::Direction direction() const;
50 QString jid() const;
51 QString sid() const;
52 QXmppCall::State state() const;
53
54 GstElement *pipeline() const;
55 QXmppCallStream *audioStream() const;
56 QXmppCallStream *videoStream() const;
57
63 Q_SIGNAL void connected();
64
69 Q_SIGNAL void finished();
70
72 Q_SIGNAL void ringing();
73
75 Q_SIGNAL void stateChanged(QXmppCall::State state);
76
78 Q_SIGNAL void streamCreated(QXmppCallStream *stream);
79
80 Q_SLOT void accept();
81 Q_SLOT void hangup();
82 Q_SLOT void addVideo();
83
84private:
85 Q_SLOT void localCandidatesChanged();
86 Q_SLOT void terminated();
87
88 QXmppCall(const QString &jid, QXmppCall::Direction direction, QXmppCallManager *parent);
89
90 QXmppCallPrivate *d;
91 friend class QXmppCallManager;
92 friend class QXmppCallManagerPrivate;
93 friend class QXmppCallPrivate;
94};
95
96Q_DECLARE_METATYPE(QXmppCall::State)
97
98#endif
The QXmppCallManager class provides support for making and receiving voice calls.
Definition QXmppCallManager.h:46
Definition QXmppCallStream.h:23
Definition QXmppCall.h:21
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:32
@ IncomingDirection
The call is incoming.
Definition QXmppCall.h:33
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:39
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:105