QXmppCall.h
/*
* Copyright (C) 2008-2021 The QXmpp developers
*
* Author:
* Jeremy Lainé
*
* Source:
* https://github.com/qxmpp-project/qxmpp
*
* This file is a part of QXmpp library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
#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 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;
GstElement *pipeline() const;
QXmppCallStream *audioStream() const;
QXmppCallStream *videoStream() const;
signals:
void connected();
void finished();
void ringing();
void stateChanged(QXmppCall::State state);
void streamCreated(QXmppCallStream *stream);
public slots:
void accept();
void hangup();
void addVideo();
private slots:
void localCandidatesChanged();
void terminated();
private:
QXmppCall(const QString &jid, QXmppCall::Direction direction, QXmppCallManager *parent);
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:65
QXmppCallStream
The QXmppCallStream class represents an RTP stream in a VoIP call.
Definition: QXmppCallStream.h:48
QXmppCall
The QXmppCall class represents a Voice-Over-IP call to a remote party.
Definition: QXmppCall.h:44
QXmppCall::stateChanged
void stateChanged(QXmppCall::State state)
This signal is emitted when the call state changes.
QXmppCall::connected
void connected()
This signal is emitted when a call is connected.
QXmppCall::Direction
Direction
This enum is used to describe the direction of a call.
Definition: QXmppCall.h:52
QXmppCall::IncomingDirection
@ IncomingDirection
The call is incoming.
Definition: QXmppCall.h:53
QXmppCall::finished
void finished()
This signal is emitted when a call is finished.
QXmppCall::State
State
This enum is used to describe the state of a call.
Definition: QXmppCall.h:59
QXmppCall::streamCreated
void streamCreated(QXmppCallStream *stream)
This signal is emitted when a stream is created.
QXmppCall::ringing
void ringing()
This signal is emitted when the remote party is ringing.
QXmppLoggable
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:124