kalarm

sounddlg.h

00001 /*
00002  *  sounddlg.h  -  sound file selection and configuration dialog
00003  *  Program:  kalarm
00004  *  Copyright (C) 2005 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 PushButton;
00030 class CheckBox;
00031 class SpinBox;
00032 class Slider;
00033 class LineEdit;
00034 
00035 
00036 class SoundDlg : public KDialogBase
00037 {
00038         Q_OBJECT
00039     public:
00040         SoundDlg(const QString& file, float volume, float fadeVolume, int fadeSeconds, bool repeat,
00041                  const QString& caption, QWidget* parent, const char* name = 0);
00042         void           setReadOnly(bool);
00043         bool           isReadOnly() const    { return mReadOnly; }
00044         QString        getFile() const;
00045         bool           getSettings(float& volume, float& fadeVolume, int& fadeSeconds) const;
00046         QString        defaultDir() const    { return mDefaultDir; }
00047 
00048         static QString i18n_SetVolume();   // plain text of Set volume checkbox
00049         static QString i18n_v_SetVolume(); // text of Set volume checkbox, with 'V' shortcut
00050         static QString i18n_Repeat();      // plain text of Repeat checkbox
00051         static QString i18n_p_Repeat();    // text of Repeat checkbox, with 'P' shortcut
00052 
00053     protected:
00054         virtual void   showEvent(QShowEvent*);
00055         virtual void   resizeEvent(QResizeEvent*);
00056 
00057     protected slots:
00058         virtual void   slotOk();
00059 
00060     private slots:
00061         void           slotPickFile();
00062         void           slotVolumeToggled(bool on);
00063         void           slotFadeToggled(bool on);
00064 
00065     private:
00066         LineEdit*      mFileEdit;
00067         PushButton*    mFileBrowseButton;
00068         CheckBox*      mRepeatCheckbox;
00069         CheckBox*      mVolumeCheckbox;
00070         Slider*        mVolumeSlider;
00071         CheckBox*      mFadeCheckbox;
00072         QHBox*         mFadeBox;
00073         SpinBox*       mFadeTime;
00074         QHBox*         mFadeVolumeBox;
00075         Slider*        mFadeSlider;
00076         QString        mDefaultDir;     // current default directory for mFileEdit
00077         bool           mReadOnly;
00078 };
00079 
00080 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys