delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / phonon / tests / mediacontrols_p.h
blob4d7d9d8ce81c39c12c0b51ceb7805fc7bbe96472
1 /* This file is part of the KDE project
2 Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
20 #ifndef PHONON_MEDIACONTROLS_P_H
21 #define PHONON_MEDIACONTROLS_P_H
23 #include "mediacontrols.h"
24 #include <kicon.h>
25 #include <klocale.h>
26 #include <Phonon/VolumeSlider>
27 #include <Phonon/SeekSlider>
28 #include <QtGui/QToolButton>
29 #include <QtGui/QBoxLayout>
31 namespace Phonon
33 class MediaControlsPrivate
35 Q_DECLARE_PUBLIC(MediaControls)
36 protected:
37 MediaControlsPrivate(MediaControls *parent)
38 : q_ptr(parent),
39 layout(parent),
40 playButton(parent),
41 pauseButton(parent),
42 stopButton(parent),
43 loopButton(parent),
44 seekSlider(parent),
45 volumeSlider(parent),
46 media(0)
48 playButton.setIconSize(QSize(32, 32));
49 playButton.setIcon(KIcon("media-playback-start"));
50 playButton.setToolTip(i18n("start playback"));
51 playButton.setAutoRaise(true);
53 pauseButton.setIconSize(QSize(32, 32));
54 pauseButton.setIcon(KIcon("media-playback-pause"));
55 pauseButton.setToolTip(i18n("pause playback"));
56 pauseButton.hide();
57 pauseButton.setAutoRaise(true);
59 stopButton.setIconSize(QSize(32, 32));
60 stopButton.setIcon(KIcon("media-playback-stop"));
61 stopButton.setToolTip(i18n("stop playback"));
62 stopButton.setAutoRaise(true);
64 loopButton.setIconSize(QSize(32, 32));
65 loopButton.setIcon(KIcon("player_loop"));
66 loopButton.setToolTip(i18n("loop: restarts playback at end"));
67 loopButton.setAutoRaise(true);
68 loopButton.setCheckable(true);
70 volumeSlider.setOrientation(Qt::Horizontal);
71 volumeSlider.setFixedWidth(80);
72 volumeSlider.hide();
74 layout.setMargin(0);
75 layout.setSpacing(0);
76 layout.addWidget(&playButton);
77 layout.addWidget(&pauseButton);
78 layout.addWidget(&stopButton);
79 layout.addWidget(&loopButton);
80 layout.addSpacing(8);
81 layout.addWidget(&seekSlider, 1);
82 layout.addSpacing(4);
83 layout.addWidget(&volumeSlider);
84 layout.addStretch();
87 MediaControls *q_ptr;
88 QHBoxLayout layout;
89 QToolButton playButton;
90 QToolButton pauseButton;
91 QToolButton stopButton;
92 QToolButton loopButton;
93 SeekSlider seekSlider;
94 VolumeSlider volumeSlider;
95 MediaObject *media;
97 private:
98 void _k_stateChanged(Phonon::State, Phonon::State);
99 void _k_mediaDestroyed();
100 void _k_finished();
102 } // namespace Phonon
104 #endif // PHONON_MEDIACONTROLS_P_H
105 // vim: sw=4 sts=4 et tw=100