Build with clang.
[kdepim.git] / mailcommon / soundtestwidget.h
blobb4ce0010c942ff0160d1c4243df44c23661591e6
1 /*
2 kmfawidgets.h - KMFilterAction parameter widgets
3 Copyright (c) 2001 Marc Mutz <mutz@kde.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef MAILCOMMON_SOUNDTESTWIDGET_H
21 #define MAILCOMMON_SOUNDTESTWIDGET_H
23 #include <KLineEdit>
25 #include <QString>
27 class QPushButton;
28 class KUrlRequester;
30 namespace MailCommon {
32 /**
33 * @short A widget to play a sound from a given URL.
35 class SoundTestWidget : public QWidget
37 Q_OBJECT
39 public:
40 /**
41 * Creates a new sound test widget.
43 * @param parent The parent widget.
45 explicit SoundTestWidget( QWidget *parent = 0 );
47 /**
48 * Destroys the sound test widget.
50 ~SoundTestWidget();
52 /**
53 * Sets the @p url of the sound file to play.
55 void setUrl( const QString &url );
57 /**
58 * Returns the url of the sound file to play.
60 QString url() const;
62 /**
63 * Clears the url of the sound file to play.
65 void clear();
67 Q_SIGNALS:
68 /**
69 * This signal is emitted when the user clicked
70 * the Play button.
72 void testPressed();
74 /**
75 * This signal is emitted when the user
76 * enters a new URL.
78 void textChanged( const QString& );
80 private Q_SLOTS:
81 void playSound();
82 void openSoundDialog( KUrlRequester* );
83 void slotUrlChanged( const QString& );
85 private:
86 KUrlRequester *m_urlRequester;
87 QPushButton *m_playButton;
92 #endif