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 QHBox;
00029 class ComboBox;
00030 class PushButton;
00031
00032
00033 class SoundPicker : public QFrame
00034 {
00035 Q_OBJECT
00036 public:
00043 enum Type { NONE = 0, BEEP, PLAY_FILE, SPEAK };
00048 SoundPicker(QWidget* parent, const char* name = 0);
00067 void set(Type type, const QString& filename, float volume, float fadeVolume, int fadeSeconds, bool repeat);
00069 bool isReadOnly() const { return mReadOnly; }
00073 void setReadOnly(bool readOnly);
00077 void showSpeak(bool show);
00079 Type sound() const;
00083 QString file() const;
00089 float volume(float& fadeVolume, int& fadeSeconds) const;
00093 bool repeat() const;
00095 QString fileSetting() const { return mFile; }
00097 bool repeatSetting() const { return mRepeat; }
00106 static QString browseFile(QString& initialDir, const QString& initialFile = QString::null);
00107
00108 static QString i18n_Sound();
00109 static QString i18n_None();
00110 static QString i18n_Beep();
00111 static QString i18n_Speak();
00112 static QString i18n_File();
00113
00114
00115 private slots:
00116 void slotTypeSelected(int id);
00117 void slotPickFile();
00118
00119 private:
00120
00121 ComboBox* mTypeCombo;
00122 QHBox* mTypeBox;
00123 PushButton* mFilePicker;
00124 QString mDefaultDir;
00125 QString mFile;
00126 float mVolume;
00127 float mFadeVolume;
00128 int mFadeSeconds;
00129 Type mLastType;
00130 bool mSpeakShowing;
00131 bool mRepeat;
00132 bool mReadOnly;
00133 };
00134
00135 #endif // SOUNDPICKER_H
|