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 <tqframe.h>
00025 #include <tqstring.h>
00026 #include <kurl.h>
00027
00028 class TQHBox;
00029 class ComboBox;
00030 class PushButton;
00031
00032
00033 class SoundPicker : public TQFrame
00034 {
00035 Q_OBJECT
00036
00037 public:
00044 enum Type { NONE = 0, BEEP, PLAY_FILE, SPEAK };
00049 explicit SoundPicker(TQWidget* parent, const char* name = 0);
00068 void set(Type type, const TQString& 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 Type sound() const;
00084 TQString file() const;
00090 float volume(float& fadeVolume, int& fadeSeconds) const;
00094 bool repeat() const;
00096 TQString fileSetting() const { return mFile; }
00098 bool repeatSetting() const { return mRepeat; }
00107 static TQString browseFile(TQString& initialDir, const TQString& initialFile = TQString());
00108
00109 static TQString i18n_Sound();
00110 static TQString i18n_None();
00111 static TQString i18n_Beep();
00112 static TQString i18n_Speak();
00113 static TQString i18n_File();
00114
00115
00116 private slots:
00117 void slotTypeSelected(int id);
00118 void slotPickFile();
00119
00120 private:
00121
00122 ComboBox* mTypeCombo;
00123 TQHBox* mTypeBox;
00124 PushButton* mFilePicker;
00125 TQString mDefaultDir;
00126 TQString mFile;
00127 float mVolume;
00128 float mFadeVolume;
00129 int mFadeSeconds;
00130 Type mLastType;
00131 bool mSpeakShowing;
00132 bool mRepeat;
00133 bool mReadOnly;
00134 };
00135
00136 #endif // SOUNDPICKER_H
|