summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kmymoneytitlelabel.h
blob: e3010aae26997abca085945d5120b1398b6d0977 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/***************************************************************************
                          kmymoneytitlelabel.h
                             -------------------
    begin                : Sun Feb 05 2005
    copyright            : (C) 2005 by Ace Jones
    email                : acejones@users.sourceforge.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KTITLELABEL_H
#define KTITLELABEL_H

// ----------------------------------------------------------------------------
// TQt Includes

#include <tqlabel.h>
#include <tqimage.h>
#include <tqcolor.h>
class TQPixmap;

// ----------------------------------------------------------------------------
// TDE Includes

// ----------------------------------------------------------------------------
// Project Includes

/**
  * @author ace jones
  */
class KMyMoneyTitleLabel : public TQLabel
{
  TQ_OBJECT
  
  TQ_PROPERTY( TQString leftImageFile READ leftImageFile WRITE setLeftImageFile DESIGNABLE true )
  TQ_PROPERTY( TQString rightImageFile READ rightImageFile WRITE setRightImageFile DESIGNABLE true )
  TQ_PROPERTY( TQColor bgColor READ bgColor WRITE setBgColor DESIGNABLE true )
  TQ_PROPERTY( TQString text READ text WRITE setText DESIGNABLE true )

public:
  KMyMoneyTitleLabel(TQWidget *parent = 0, const char *name = 0);
  ~KMyMoneyTitleLabel();

  void setBgColor(const TQColor& _color) { m_bgColor = _color; }
  void setLeftImageFile(const TQString& _file);
  void setRightImageFile(const TQString& _file);

  const TQString& leftImageFile(void) const { return m_leftImageFile; }
  const TQString& rightImageFile(void) const { return m_rightImageFile; }
  TQColor bgColor(void) const { return m_bgColor; }
  TQString text(void) const { return m_text; }

public slots:
  virtual void setText(const TQString& txt);

protected:
  void updatePixmap(void);
  virtual void resizeEvent ( TQResizeEvent * );
  void drawContents(TQPainter *);

private:
  TQImage m_leftImage;
  TQImage m_rightImage;
  TQColor m_bgColor;
  TQColor m_textColor;
  TQString m_text;

  TQString m_leftImageFile;
  TQString m_rightImageFile;
};

#endif