kalarm
soundpicker.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SOUNDPICKER_H
00022 #define SOUNDPICKER_H
00023
00024 #include <qframe.h>
00025 #include <qstring.h>
00026 #include <kurl.h>
00027
00028 class ButtonGroup;
00029 class CheckBox;
00030 class PushButton;
00031 class RadioButton;
00032
00033
00034 class SoundPicker : public QFrame
00035 {
00036 Q_OBJECT
00037 public:
00043 enum Type { BEEP = 1, SPEAK, PLAY_FILE };
00048 SoundPicker(QWidget* parent, const char* name = 0);
00068 void set(bool sound, Type defaultType, const QString& filename, float volume, float fadeVolume, int fadeSeconds, bool repeat);
00070 bool isReadOnly() const { return mReadOnly; }
00074 void setReadOnly(bool readOnly);
00078 void showSpeak(bool show);
00080 bool sound() const;
00082 Type type() const;
00084 bool beep() const;
00086 bool speak() const;
00090 QString file() const;
00096 float volume(float& fadeVolume, int& fadeSeconds) const;
00100 bool repeat() const;
00102 QString fileSetting() const { return mFile; }
00104 bool repeatSetting() const { return mRepeat; }
00113 static QString browseFile(QString& initialDir, const QString& initialFile = QString::null);
00114
00115 static QString i18n_Sound();
00116 static QString i18n_s_Sound();
00117 static QString i18n_Beep();
00118 static QString i18n_b_Beep();
00119 static QString i18n_Speak();
00120 static QString i18n_p_Speak();
00121 static QString i18n_File();
00122
00123
00124 private slots:
00125 void slotSoundToggled(bool on);
00126 void slotTypeChanged(int id);
00127 void slotPickFile();
00128 void setLastType();
00129
00130 private:
00131
00132 CheckBox* mCheckbox;
00133 ButtonGroup* mTypeGroup;
00134 RadioButton* mBeepRadio;
00135 RadioButton* mSpeakRadio;
00136 RadioButton* mFileRadio;
00137 PushButton* mFilePicker;
00138 QString mDefaultDir;
00139 QString mFile;
00140 float mVolume;
00141 float mFadeVolume;
00142 int mFadeSeconds;
00143 Type mLastType;
00144 bool mRevertType;
00145 bool mRepeat;
00146 bool mReadOnly;
00147 };
00148
00149 #endif // SOUNDPICKER_H
|