• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kalarm

  • sources
  • kde-4.12
  • kdepim
  • kalarm
soundpicker.h
Go to the documentation of this file.
1 /*
2  * soundpicker.h - widget to select a sound file or a beep
3  * Program: kalarm
4  * Copyright © 2002,2004-2012 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef SOUNDPICKER_H
22 #define SOUNDPICKER_H
23 
24 #include "preferences.h"
25 
26 #include <kurl.h>
27 #include <QFrame>
28 #include <QString>
29 
30 class KHBox;
31 class ComboBox;
32 class PushButton;
33 
34 
35 class SoundPicker : public QFrame
36 {
37  Q_OBJECT
38  public:
42  explicit SoundPicker(QWidget* parent);
61  void set(Preferences::SoundType type, const QString& filename, float volume, float fadeVolume, int fadeSeconds, int repeatPause);
63  bool isReadOnly() const { return mReadOnly; }
67  void setReadOnly(bool readOnly);
71  void showSpeak(bool show);
73  Preferences::SoundType sound() const;
77  KUrl file() const;
83  float volume(float& fadeVolume, int& fadeSeconds) const;
87  int repeatPause() const;
89  KUrl fileSetting() const { return mFile; }
91  bool repeatPauseSetting() const { return mRepeatPause; }
100  static QString browseFile(QString& initialDir, const QString& initialFile = QString());
101 
102  static QString i18n_label_Sound(); // text of Sound label
103  static QString i18n_combo_None(); // text of None combo box item
104  static QString i18n_combo_Beep(); // text of Beep combo box item
105  static QString i18n_combo_Speak(); // text of Speak combo box item
106  static QString i18n_combo_File(); // text of File combo box item
107 
108  signals:
109  void changed(); // emitted when any contents change
110 
111  private slots:
112  void slotTypeSelected(int id);
113  void slotPickFile();
114  void setLastType();
115 
116  private:
117  ComboBox* mTypeCombo;
118  KHBox* mTypeBox;
119  PushButton* mFilePicker;
120  KUrl mFile; // sound file to play when alarm is triggered
121  float mVolume; // volume for file, or < 0 to not set volume
122  float mFadeVolume; // initial volume for file, or < 0 for no fading
123  int mFadeSeconds; // fade interval in seconds
124  int mRepeatPause; // seconds to pause between repetitions of the sound file, or -1 if no repeat
125  Preferences::SoundType mLastType; // last selected sound option
126  bool mSpeakShowing; // Speak option is shown in combo box
127  bool mRevertType; // reverting to last selected sound option
128  bool mReadOnly;
129 };
130 
131 #endif // SOUNDPICKER_H
132 
133 // vim: et sw=4:
SoundPicker::changed
void changed()
SoundPicker::isReadOnly
bool isReadOnly() const
Returns true if the widget is read only for the user.
Definition: soundpicker.h:63
SoundPicker::sound
Preferences::SoundType sound() const
Returns the selected option.
Definition: soundpicker.cpp:160
SoundPicker::file
KUrl file() const
If the 'file' option is selected, returns the URL of the chosen file.
Definition: soundpicker.cpp:173
SoundPicker::fileSetting
KUrl fileSetting() const
Returns the current file URL regardless of whether the 'file' option is selected. ...
Definition: soundpicker.h:89
SoundPicker::repeatPauseSetting
bool repeatPauseSetting() const
Returns the current file repetition setting regardless of whether the 'file' option is selected...
Definition: soundpicker.h:91
SoundPicker::setReadOnly
void setReadOnly(bool readOnly)
Sets whether the widget can be changed the user.
Definition: soundpicker.cpp:111
QWidget
SoundPicker::i18n_label_Sound
static QString i18n_label_Sound()
Definition: soundpicker.cpp:50
SoundPicker::volume
float volume(float &fadeVolume, int &fadeSeconds) const
Returns the volume and fade characteristics for playing a sound file.
Definition: soundpicker.cpp:182
SoundPicker::i18n_combo_Speak
static QString i18n_combo_Speak()
Definition: soundpicker.cpp:53
SoundPicker::browseFile
static QString browseFile(QString &initialDir, const QString &initialFile=QString())
Display a dialog to choose a sound file, initially highlighting initialFile if non-null.
Definition: soundpicker.cpp:321
PushButton
SoundPicker::set
void set(Preferences::SoundType type, const QString &filename, float volume, float fadeVolume, int fadeSeconds, int repeatPause)
Initialises the widget's state.
Definition: soundpicker.cpp:210
SoundPicker::i18n_combo_None
static QString i18n_combo_None()
Definition: soundpicker.cpp:51
preferences.h
SoundPicker::repeatPause
int repeatPause() const
Returns pause in seconds between repetitions of the sound file, or -1 if no repeat or 'file' option i...
Definition: soundpicker.cpp:202
PreferencesBase::SoundType
SoundType
Definition: kalarmconfig.h:22
SoundPicker
Definition: soundpicker.h:35
SoundPicker::i18n_combo_Beep
static QString i18n_combo_Beep()
Definition: soundpicker.cpp:52
KHBox
ComboBox
SoundPicker::SoundPicker
SoundPicker(QWidget *parent)
Constructor.
Definition: soundpicker.cpp:57
SoundPicker::i18n_combo_File
static QString i18n_combo_File()
Definition: soundpicker.cpp:54
SoundPicker::showSpeak
void showSpeak(bool show)
Show or hide the 'speak' option.
Definition: soundpicker.cpp:122
QFrame
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm

Skip menu "kalarm"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal