kalarm
sounddlg.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SOUNDDLG_H
00022 #define SOUNDDLG_H
00023
00024 #include <QString>
00025 #include <kurl.h>
00026 #include <kdialog.h>
00027 #include <kmessagebox.h>
00028
00029 class QPushButton;
00030 class QShowEvent;
00031 class QResizeEvent;
00032 class KHBox;
00033 namespace Phonon { class MediaObject; }
00034 class PushButton;
00035 class CheckBox;
00036 class SpinBox;
00037 class Slider;
00038 class LineEdit;
00039
00040
00041 class SoundDlg : public KDialog
00042 {
00043 Q_OBJECT
00044 public:
00045 SoundDlg(const QString& file, float volume, float fadeVolume, int fadeSeconds, bool repeat,
00046 const QString& caption, QWidget* parent);
00047 ~SoundDlg();
00048 void setReadOnly(bool);
00049 bool isReadOnly() const { return mReadOnly; }
00050 KUrl getFile() const { return mUrl; }
00051 bool getSettings(float& volume, float& fadeVolume, int& fadeSeconds) const;
00052 QString defaultDir() const { return mDefaultDir; }
00053
00054 static QString i18n_chk_Repeat();
00055
00056 protected:
00057 virtual void showEvent(QShowEvent*);
00058 virtual void resizeEvent(QResizeEvent*);
00059
00060 protected slots:
00061 virtual void slotOk();
00062
00063 private slots:
00064 void slotPickFile();
00065 void slotVolumeToggled(bool on);
00066 void slotFadeToggled(bool on);
00067 void playSound();
00068 void playFinished();
00069
00070 private:
00071 bool checkFile();
00072
00073 QPushButton* mFilePlay;
00074 LineEdit* mFileEdit;
00075 PushButton* mFileBrowseButton;
00076 CheckBox* mRepeatCheckbox;
00077 CheckBox* mVolumeCheckbox;
00078 Slider* mVolumeSlider;
00079 CheckBox* mFadeCheckbox;
00080 KHBox* mFadeBox;
00081 SpinBox* mFadeTime;
00082 KHBox* mFadeVolumeBox;
00083 Slider* mFadeSlider;
00084 QString mDefaultDir;
00085 KUrl mUrl;
00086 Phonon::MediaObject* mPlayer;
00087 bool mReadOnly;
00088 };
00089
00090 #endif