summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/skin.h
blob: ee19f4b32fb24d5a622200e728be9c42e6d83b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef SKIN_H
#define SKIN_H

#include <qstring.h>
#include <qimage.h>
#include <qmap.h>

#include "mediawidget.h"

class Skin
{
public:
    Skin( const QString &name, const QString &fileNameInfix );

    void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount );

    QImage backgroundImage() const;
    QImage buttonUpImage() const;
    QImage buttonDownImage() const;

    QImage buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) const;

    QImage buttonMaskImage( const QString &fileName ) const;

private:
    void addButtonToMask( int tag, const QImage &maskImage ) const;

    QString m_name;
    QString m_fileNameInfix;
    QString m_skinPath;

    typedef QMap<QString, QImage> ButtonMaskImageMap;

    mutable QImage m_backgroundImage;
    mutable QImage m_buttonUpImage;
    mutable QImage m_buttonDownImage;
    mutable QImage m_buttonMask;
    mutable ButtonMaskImageMap m_buttonMasks;

    Skin( const Skin & );
    Skin &operator=( const Skin & );
};

#endif // SKIN_H
/* vim: et sw=4 ts=4
 */