ginebra2/ScaleThreePainter.h
author hgs
Fri, 15 Oct 2010 17:30:59 -0400
changeset 16 3c88a81ff781
permissions -rw-r--r--
201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
hgs
parents:
diff changeset
     1
#ifndef ScaleThreePainter_H
hgs
parents:
diff changeset
     2
#define ScaleThreePainter_H
hgs
parents:
diff changeset
     3
hgs
parents:
diff changeset
     4
#include <QPixmap>
hgs
parents:
diff changeset
     5
hgs
parents:
diff changeset
     6
class QPainter;
hgs
parents:
diff changeset
     7
class QString;
hgs
parents:
diff changeset
     8
class QStyleOptionGraphicsItem;
hgs
parents:
diff changeset
     9
class QWidget;
hgs
parents:
diff changeset
    10
hgs
parents:
diff changeset
    11
namespace GVA {
hgs
parents:
diff changeset
    12
hgs
parents:
diff changeset
    13
/*!
hgs
parents:
diff changeset
    14
 * This class paints a resizable window background using separate images for its' left, middle and right areas.
hgs
parents:
diff changeset
    15
 */
hgs
parents:
diff changeset
    16
class ScaleThreePainter
hgs
parents:
diff changeset
    17
{
hgs
parents:
diff changeset
    18
public:
hgs
parents:
diff changeset
    19
    ScaleThreePainter(const QString &leftFilename,
hgs
parents:
diff changeset
    20
                      const QString &middleFilename,
hgs
parents:
diff changeset
    21
                      const QString &rightFilename
hgs
parents:
diff changeset
    22
                     );
hgs
parents:
diff changeset
    23
    ~ScaleThreePainter();
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
    void paint(QPainter* painter, const QRect &rect, QWidget* widget);
hgs
parents:
diff changeset
    26
    void unloadPixmaps();
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
private:
hgs
parents:
diff changeset
    29
    void loadPixmaps();
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
private:
hgs
parents:
diff changeset
    32
    QString m_leftFilename;
hgs
parents:
diff changeset
    33
    QString m_middleFilename;
hgs
parents:
diff changeset
    34
    QString m_rightFilename;
hgs
parents:
diff changeset
    35
    QPixmap *m_leftPixmap;
hgs
parents:
diff changeset
    36
    QPixmap *m_middlePixmap;
hgs
parents:
diff changeset
    37
    QPixmap *m_rightPixmap;
hgs
parents:
diff changeset
    38
    bool m_pixmapsLoaded;
hgs
parents:
diff changeset
    39
};
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
}  // GVA namespace
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
#endif // ScaleThreePainter_H