Mailcommon

soundtestwidget.h
1/*
2 kmfawidgets.h - KMFilterAction parameter widgets
3 SPDX-FileCopyrightText: 2001 Marc Mutz <mutz@kde.org>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#pragma once
9
10#include <QWidget>
11
12namespace Phonon
13{
14class MediaObject;
15}
16
17class QPushButton;
18class KUrlRequester;
19
20namespace MailCommon
21{
22/**
23 * @short A widget to play a sound from a given URL.
24 */
26{
28
29public:
30 /**
31 * Creates a new sound test widget.
32 *
33 * @param parent The parent widget.
34 */
35 explicit SoundTestWidget(QWidget *parent = nullptr);
36
37 /**
38 * Destroys the sound test widget.
39 */
40 ~SoundTestWidget() override;
41
42 /**
43 * Sets the @p url of the sound file to play.
44 */
45 void setUrl(const QString &url);
46
47 /**
48 * Returns the url of the sound file to play.
49 */
50 [[nodiscard]] QString url() const;
51
52 /**
53 * Clears the url of the sound file to play.
54 */
55 void clear();
56
58 /**
59 * This signal is emitted when the user
60 * enters a new URL.
61 */
62 void textChanged(const QString &);
63
64private:
65 void playSound();
66 void openSoundDialog(KUrlRequester *);
67 void slotUrlChanged(const QString &);
68 KUrlRequester *const m_urlRequester;
69 QPushButton *const m_playButton;
70 Phonon::MediaObject *m_player = nullptr;
71};
72}
A widget to play a sound from a given URL.
SoundTestWidget(QWidget *parent=nullptr)
Creates a new sound test widget.
void setUrl(const QString &url)
Sets the url of the sound file to play.
void textChanged(const QString &)
This signal is emitted when the user enters a new URL.
~SoundTestWidget() override
Destroys the sound test widget.
void clear()
Clears the url of the sound file to play.
QString url() const
Returns the url of the sound file to play.
The filter dialog.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.