ModemManagerQt

call.h
1/*
2 SPDX-FileCopyrightText: 2018 Aleksander Morgado <aleksander@aleksander.es>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef MODEMMANAGERQT_CALL_H
8#define MODEMMANAGERQT_CALL_H
9
10#include <modemmanagerqt_export.h>
11
12#include <QDBusPendingReply>
13#include <QObject>
14#include <QSharedPointer>
15
16#include "generictypes.h"
17
18namespace ModemManager
19{
20class CallPrivate;
21
22/**
23 * Provides an interface to manipulate and control a call
24 *
25 * Note: MMCallState, MMCallStateReason and MMCallDirection enums are defined in <ModemManager/ModemManager-enums.h>
26 * See http://www.freedesktop.org/software/ModemManager/api/latest/ModemManager-Flags-and-Enumerations.html
27 */
28class MODEMMANAGERQT_EXPORT Call : public QObject
29{
30 Q_OBJECT
31 Q_DECLARE_PRIVATE(Call)
32
33public:
35 typedef QList<Ptr> List;
36
37 explicit Call(const QString &path, QObject *parent = nullptr);
38 ~Call() override;
39
40 QString uni() const;
41
42 /**
43 * Start a call
44 */
46
47 /**
48 * Accept a call
49 */
50 QDBusPendingReply<> accept();
51
52 /**
53 * Hangup a call
54 */
55 QDBusPendingReply<> hangup();
56
57 /**
58 * Send DTMF
59 */
60 QDBusPendingReply<> sendDtmf(const QString &dtmf);
61
62 /**
63 * This method returns the state of the call
64 */
65 MMCallState state() const;
66
67 /**
68 * This method returns the reason for the call state change
69 */
70 MMCallStateReason stateReason() const;
71
72 /**
73 * This method returns the direction of the call
74 */
75 MMCallDirection direction() const;
76
77 /**
78 * This method returns the remote phone number
79 */
80 QString number() const;
81
82 /**
83 * Sets the timeout in milliseconds for all async method DBus calls.
84 * -1 means the default DBus timeout (usually 25 seconds).
85 */
86 void setTimeout(int timeout);
87
88 /**
89 * Returns the current value of the DBus timeout in milliseconds.
90 * -1 means the default DBus timeout (usually 25 seconds).
91 */
92 int timeout() const;
93
94Q_SIGNALS:
95 void stateChanged(MMCallState oldState, MMCallState newState, MMCallStateReason reason);
96 void numberChanged(const QString &number);
97 void dtmfReceived(const QString &dtmf);
98
99private:
100 CallPrivate *const d_ptr;
101};
102
103} // namespace ModemManager
104
105#endif
Provides an interface to manipulate and control a call.
Definition call.h:29
Q_SCRIPTABLE Q_NOREPLY void start()
This namespace allows to query the underlying system to discover the available modem interfaces respo...
Definition bearer.cpp:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:54 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.