kmymoneytitlelabel.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           kmymoneytitlelabel.h
00003                              -------------------
00004     begin                : Sun Feb 05 2005
00005     copyright            : (C) 2005 by Ace Jones
00006     email                : acejones@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef KTITLELABEL_H
00019 #define KTITLELABEL_H
00020 
00021 // ----------------------------------------------------------------------------
00022 // QT Includes
00023 
00024 #include <qlabel.h>
00025 #include <qimage.h>
00026 #include <qcolor.h>
00027 class QPixmap;
00028 
00029 // ----------------------------------------------------------------------------
00030 // KDE Includes
00031 
00032 // ----------------------------------------------------------------------------
00033 // Project Includes
00034 
00038 class KMyMoneyTitleLabel : public QLabel
00039 {
00040   Q_OBJECT
00041   Q_PROPERTY( QString leftImageFile READ leftImageFile WRITE setLeftImageFile DESIGNABLE true )
00042   Q_PROPERTY( QString rightImageFile READ rightImageFile WRITE setRightImageFile DESIGNABLE true )
00043   Q_PROPERTY( QColor bgColor READ bgColor WRITE setBgColor DESIGNABLE true )
00044   Q_PROPERTY( QString text READ text WRITE setText DESIGNABLE true )
00045 
00046 public:
00047   KMyMoneyTitleLabel(QWidget *parent = 0, const char *name = 0);
00048   ~KMyMoneyTitleLabel();
00049 
00050   void setBgColor(const QColor& _color) { m_bgColor = _color; }
00051   void setLeftImageFile(const QString& _file);
00052   void setRightImageFile(const QString& _file);
00053 
00054   const QString& leftImageFile(void) const { return m_leftImageFile; }
00055   const QString& rightImageFile(void) const { return m_rightImageFile; }
00056   QColor bgColor(void) const { return m_bgColor; }
00057   QString text(void) const { return m_text; }
00058 
00059 public slots:
00060   virtual void setText(const QString& txt);
00061 
00062 protected:
00063   void updatePixmap(void);
00064   virtual void resizeEvent ( QResizeEvent * );
00065   void drawContents(QPainter *);
00066 
00067 private:
00068   QImage m_leftImage;
00069   QImage m_rightImage;
00070   QColor m_bgColor;
00071   QColor m_textColor;
00072   QString m_text;
00073 
00074   QString m_leftImageFile;
00075   QString m_rightImageFile;
00076 };
00077 
00078 #endif

Generated on Wed Jan 26 13:03:17 2011 for KMyMoney by  doxygen 1.5.6