QXmpp  Version: 1.10.4
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 
15 class QHostAddress;
16 class QXmppCallPrivate;
17 class QXmppCallManager;
18 class QXmppCallManagerPrivate;
19 
20 class 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 
30 public:
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 
84 private:
85  Q_SLOT void localCandidatesChanged();
86  Q_SLOT void terminated();
87 
88  QXmppCall(const QString &jid, QXmppCall::Direction direction, QXmppCallManager *parent);
89 
90  const std::unique_ptr<QXmppCallPrivate> d;
91  friend class QXmppCallManager;
92  friend class QXmppCallManagerPrivate;
93  friend class QXmppCallPrivate;
94 };
95 
96 Q_DECLARE_METATYPE(QXmppCall::State)
97 
98 #endif
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:109
Direction
This enum is used to describe the direction of a call.
Definition: QXmppCall.h:32
The call is incoming.
Definition: QXmppCall.h:33
Definition: QXmppCall.h:20
Definition: QXmppCallStream.h:22
State
This enum is used to describe the state of a call.
Definition: QXmppCall.h:39
The QXmppCallManager class provides support for making and receiving voice calls. ...
Definition: QXmppCallManager.h:45