compile
[kdegraphics.git] / okular / core / audioplayer.h
blob3090805fb4dfa08eb35b23da378923a9a6f4f82c
1 /***************************************************************************
2 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef _OKULAR_AUDIOPLAYER_H_
11 #define _OKULAR_AUDIOPLAYER_H_
13 #include <okular/core/okular_export.h>
15 #include <QtCore/QObject>
17 namespace Okular {
19 class AudioPlayerPrivate;
20 class Document;
21 class Sound;
22 class SoundAction;
24 /**
25 * @short An audio player.
27 * Singleton utility class to play sounds in documents using the KDE sound
28 * system.
30 class OKULAR_EXPORT AudioPlayer : public QObject
32 Q_OBJECT
34 public:
35 ~AudioPlayer();
37 /**
38 * Gets the instance of the audio player.
40 static AudioPlayer * instance();
42 /**
43 * Enqueue the specified @p sound for playing, optionally taking more
44 * information about the playing from the @p soundlink .
46 void playSound( const Sound * sound, const SoundAction * linksound = 0 );
48 /**
49 * Tell the AudioPlayer to stop all the playbacks.
51 void stopPlaybacks();
53 private:
54 AudioPlayer();
56 friend class AudioPlayerPrivate;
57 AudioPlayerPrivate * const d;
58 friend class Document;
60 Q_DISABLE_COPY( AudioPlayer )
61 Q_PRIVATE_SLOT( d, void finished( int ) )
66 #endif