kalarm

sounddlg.h

00001 /*
00002  *  sounddlg.h  -  sound file selection and configuration dialog
00003  *  Program:  kalarm
00004  *  Copyright © 2005,2007 by David Jarvie <software@astrojar.org.uk>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef SOUNDDLG_H
00022 #define SOUNDDLG_H
00023 
00024 #include <qframe.h>
00025 #include <qstring.h>
00026 #include <kdialogbase.h>
00027 
00028 class QHBox;
00029 class QPushButton;
00030 class LineEdit;
00031 class PushButton;
00032 class CheckBox;
00033 class SpinBox;
00034 class Slider;
00035 
00036 
00037 class SoundDlg : public KDialogBase
00038 {
00039         Q_OBJECT
00040     public:
00041         SoundDlg(const QString& file, float volume, float fadeVolume, int fadeSeconds, bool repeat,
00042                  const QString& caption, QWidget* parent, const char* name = 0);
00043         void           setReadOnly(bool);
00044         bool           isReadOnly() const    { return mReadOnly; }
00045         QString        getFile() const       { return mFileName; }
00046         bool           getSettings(float& volume, float& fadeVolume, int& fadeSeconds) const;
00047         QString        defaultDir() const    { return mDefaultDir; }
00048 
00049         static QString i18n_SetVolume();   // plain text of Set volume checkbox
00050         static QString i18n_v_SetVolume(); // text of Set volume checkbox, with 'V' shortcut
00051         static QString i18n_Repeat();      // plain text of Repeat checkbox
00052         static QString i18n_p_Repeat();    // text of Repeat checkbox, with 'P' shortcut
00053 
00054     protected:
00055         virtual void   showEvent(QShowEvent*);
00056         virtual void   resizeEvent(QResizeEvent*);
00057 
00058     protected slots:
00059         virtual void   slotOk();
00060 
00061     private slots:
00062         void           slotPickFile();
00063         void           slotVolumeToggled(bool on);
00064         void           slotFadeToggled(bool on);
00065         void           playSound();
00066 
00067     private:
00068         bool           checkFile();
00069 
00070         QPushButton*   mFilePlay;
00071         LineEdit*      mFileEdit;
00072         PushButton*    mFileBrowseButton;
00073         CheckBox*      mRepeatCheckbox;
00074         CheckBox*      mVolumeCheckbox;
00075         Slider*        mVolumeSlider;
00076         CheckBox*      mFadeCheckbox;
00077         QHBox*         mFadeBox;
00078         SpinBox*       mFadeTime;
00079         QHBox*         mFadeVolumeBox;
00080         Slider*        mFadeSlider;
00081         QString        mDefaultDir;     // current default directory for mFileEdit
00082         QString        mFileName;
00083         bool           mReadOnly;
00084 };
00085 
00086 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys