Loading...
Searching...
No Matches
QXmppCall.h
// SPDX-FileCopyrightText: 2019 Jeremy Lainé <jeremy.laine@m4x.org>
// SPDX-FileCopyrightText: 2019 Niels Ole Salscheider <ole@salscheider.org>
// SPDX-FileCopyrightText: 2025 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPCALL_H
#define QXMPPCALL_H
#include "QXmppCallStream.h"
#include "QXmppClientExtension.h"
#include "QXmppLogger.h"
#include <QMetaType>
#include <QObject>
class QHostAddress;
class QXmppCallPrivate;
class QXmppCallManager;
class QXmppCallManagerPrivate;
class QXmppError;
class QXMPP_EXPORT QXmppCall : public QXmppLoggable
{
Q_OBJECT
Q_PROPERTY(Direction direction READ direction CONSTANT)
Q_PROPERTY(QString jid READ jid CONSTANT)
Q_PROPERTY(State state READ state NOTIFY stateChanged)
public:
enum Direction {
IncomingDirection,
OutgoingDirection
};
Q_ENUM(Direction)
enum State {
ConnectingState = 0,
ActiveState = 1,
DisconnectingState = 2,
FinishedState = 3
};
Q_ENUM(State)
~QXmppCall();
QXmppCall::Direction direction() const;
QString jid() const;
QString sid() const;
QXmppCall::State state() const;
std::optional<QXmppError> error() const;
GstElement *pipeline() const;
QXmppCallStream *audioStream() const;
QXmppCallStream *videoStream() const;
bool isEncrypted() const;
bool videoSupported() const;
void accept();
void decline();
void hangUp();
void addVideo();
Q_SIGNAL void connected();
Q_SIGNAL void finished();
Q_SIGNAL void ringing();
Q_SIGNAL void stateChanged(QXmppCall::State state);
Q_SIGNAL void streamCreated(QXmppCallStream *stream);
private:
void onLocalCandidatesChanged(QXmppCallStream *stream);
void terminated();
QXmppCall(const QString &jid, const QString &sid, Direction direction, QXmppCallManager *manager);
QXmppCall(const QString &jid, const QString &sid, Direction direction, State state, QXmppError &&error, QXmppCallManager *manager);
const std::unique_ptr<QXmppCallPrivate> d;
friend class QXmppCallManager;
friend class QXmppCallManagerPrivate;
friend class QXmppCallPrivate;
};
Q_DECLARE_METATYPE(QXmppCall::State)
#endif
QXmppCallManager
The QXmppCallManager class provides support for making and receiving voice calls.
Definition QXmppCallManager.h:25
QXmppCallStream
Definition QXmppCallStream.h:22
QXmppCall
Definition QXmppCall.h:24
QXmppCall::ringing
Q_SIGNAL void ringing()
This signal is emitted when the remote party is ringing.
QXmppCall::jid
QString jid
The remote party's JID.
Definition QXmppCall.h:29
QXmppCall::Direction
Direction
This enum is used to describe the direction of a call.
Definition QXmppCall.h:35
QXmppCall::OutgoingDirection
@ OutgoingDirection
The call is outgoing.
Definition QXmppCall.h:37
QXmppCall::IncomingDirection
@ IncomingDirection
The call is incoming.
Definition QXmppCall.h:36
QXmppCall::streamCreated
Q_SIGNAL void streamCreated(QXmppCallStream *stream)
This signal is emitted when a stream is created.
QXmppCall::finished
Q_SIGNAL void finished()
This signal is emitted when a call is finished.
QXmppCall::sid
QString sid() const
Definition QXmppCall.cpp:771
QXmppCall::State
State
This enum is used to describe the state of a call.
Definition QXmppCall.h:42
QXmppCall::ActiveState
@ ActiveState
The call is active.
Definition QXmppCall.h:44
QXmppCall::DisconnectingState
@ DisconnectingState
The call is being disconnected.
Definition QXmppCall.h:45
QXmppCall::FinishedState
@ FinishedState
The call is finished.
Definition QXmppCall.h:46
QXmppCall::ConnectingState
@ ConnectingState
The call is being connected.
Definition QXmppCall.h:43
QXmppCall::direction
Direction direction
The call's direction.
Definition QXmppCall.h:27
QXmppCall::connected
Q_SIGNAL void connected()
This signal is emitted when a call is connected.
QXmppCall::stateChanged
Q_SIGNAL void stateChanged(QXmppCall::State state)
This signal is emitted when the call state changes.
QXmppCall::error
std::optional< QXmppError > error() const
Definition QXmppCall.cpp:791
QXmppCall::state
State state
The call's state.
Definition QXmppCall.h:31
QXmppLoggable::QXmppLoggable
QXmppLoggable(QObject *parent=nullptr)
Definition QXmppLogger.cpp:57
QXmppError
Definition QXmppError.h:17