QXmpp  Version:1.3.1
QXmppCall.h
1 /*
2  * Copyright (C) 2008-2020 The QXmpp developers
3  *
4  * Author:
5  * Jeremy LainĂ©
6  *
7  * Source:
8  * https://github.com/qxmpp-project/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 #ifndef QXMPPCALL_H
25 #define QXMPPCALL_H
26 
27 #include "QXmppCallStream.h"
28 #include "QXmppClientExtension.h"
29 #include "QXmppLogger.h"
30 
31 #include <QMetaType>
32 #include <QObject>
33 
34 class QHostAddress;
35 class QXmppCallPrivate;
36 class QXmppCallManager;
37 class QXmppCallManagerPrivate;
38 
42 
43 class QXMPP_EXPORT QXmppCall : public QXmppLoggable
44 {
45  Q_OBJECT
46  Q_PROPERTY(Direction direction READ direction CONSTANT)
47  Q_PROPERTY(QString jid READ jid CONSTANT)
48  Q_PROPERTY(State state READ state NOTIFY stateChanged)
49 
50 public:
52  enum Direction {
54  OutgoingDirection
55  };
56  Q_ENUM(Direction)
57 
58 
59  enum State {
60  ConnectingState = 0,
61  ActiveState = 1,
62  DisconnectingState = 2,
63  FinishedState = 3
64  };
65  Q_ENUM(State)
66 
67  ~QXmppCall();
68 
69  QXmppCall::Direction direction() const;
70  QString jid() const;
71  QString sid() const;
72  QXmppCall::State state() const;
73 
74  GstElement *pipeline() const;
75  QXmppCallStream *audioStream() const;
76  QXmppCallStream *videoStream() const;
77 
78 signals:
84  void connected();
85 
90  void finished();
91 
93  void ringing();
94 
96  void stateChanged(QXmppCall::State state);
97 
99  void streamCreated(QXmppCallStream *stream);
100 
101 public slots:
102  void accept();
103  void hangup();
104  void addVideo();
105 
106 private slots:
107  void localCandidatesChanged();
108  void terminated();
109 
110 private:
111  QXmppCall(const QString &jid, QXmppCall::Direction direction, QXmppCallManager *parent);
112 
113  QXmppCallPrivate *d;
114  friend class QXmppCallManager;
115  friend class QXmppCallManagerPrivate;
116  friend class QXmppCallPrivate;
117 };
118 
119 Q_DECLARE_METATYPE(QXmppCall::State)
120 
121 #endif
QXmppCall::IncomingDirection
@ IncomingDirection
The call is incoming.
Definition: QXmppCall.h:53
QXmppCall::State
State
This enum is used to describe the state of a call.
Definition: QXmppCall.h:59
QXmppLoggable
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:123
QXmppCall::Direction
Direction
This enum is used to describe the direction of a call.
Definition: QXmppCall.h:52
QXmppCallManager
The QXmppCallManager class provides support for making and receiving voice calls.
Definition: QXmppCallManager.h:64
QXmppCall
The QXmppCall class represents a Voice-Over-IP call to a remote party.
Definition: QXmppCall.h:43
QXmppCallStream
The QXmppCallStream class represents an RTP stream in a VoIP call.
Definition: QXmppCallStream.h:46