~ubuntu-branches/ubuntu/natty/kdemultimedia/natty-proposed

« back to all changes in this revision

Viewing changes to kmix/osdwidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers
  • Date: 2011-05-26 02:41:36 UTC
  • mfrom: (0.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 108.
  • Revision ID: james.westby@ubuntu.com-20110526024136-jjwsigfy402jhupm
Tags: upstream-4.6.3
Import upstream version 4.6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*******************************************************************
2
 
* osdwidget.h
3
 
* Copyright  2009    Aurélien Gâteau <agateau@kde.org>
4
 
* Copyright  2009    Dario Andres Rodriguez <andresbajotierra@gmail.com>
5
 
* Copyright  2009    Christian Esken <christian.esken@arcor.de>
6
 
*
7
 
* This program is free software; you can redistribute it and/or
8
 
* modify it under the terms of the GNU General Public License as
9
 
* published by the Free Software Foundation; either version 2 of
10
 
* the License, or (at your option) any later version.
11
 
*
12
 
* This program is distributed in the hope that it will be useful,
13
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
* GNU General Public License for more details.
16
 
*
17
 
* You should have received a copy of the GNU General Public License
18
 
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 
*
20
 
******************************************************************/
21
 
 
22
 
#ifndef OSDWIDGET__H
23
 
#define OSDWIDGET__H
24
 
 
25
 
#include <QGraphicsView>
26
 
 
27
 
#include <QPixmap>
28
 
 
29
 
class QTimer;
30
 
class QGraphicsWidget;
31
 
 
32
 
namespace Plasma
33
 
{
34
 
class FrameSvg;
35
 
class Label;
36
 
class Meter;
37
 
}
38
 
 
39
 
class OSDWidget : public QGraphicsView
40
 
{
41
 
Q_OBJECT
42
 
public:
43
 
    OSDWidget(QWidget * parent = 0);
44
 
 
45
 
    void setCurrentVolume(int volumeLevel, bool muted);
46
 
    void activateOSD();
47
 
 
48
 
    virtual QSize sizeHint() const;
49
 
 
50
 
protected:
51
 
    virtual void drawBackground(QPainter *painter, const QRectF &rectF);
52
 
    virtual void resizeEvent(QResizeEvent *);
53
 
 
54
 
private:
55
 
    Plasma::FrameSvg *m_background;
56
 
    QGraphicsScene *m_scene;
57
 
    QGraphicsWidget *m_container;
58
 
    Plasma::Label *m_iconLabel;
59
 
    Plasma::Label *m_volumeLabel;
60
 
    Plasma::Meter *m_meter;
61
 
    QTimer *m_hideTimer;
62
 
 
63
 
    QPixmap m_volumeHighPixmap;
64
 
    QPixmap m_volumeMediumPixmap;
65
 
    QPixmap m_volumeLowPixmap;
66
 
    QPixmap m_volumeMutedPixmap;
67
 
};
68
 
 
69
 
#endif