summaryrefslogtreecommitdiffstats
path: root/ksirc/KSTicker/ksticker.h
blob: 0ded7da993b2ab2d86a93f3a583b9b8044e6ebce (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef KSTICKER_H
#define KSTICKER_H

#include <tqobject.h>
#include <tqframe.h>
#include <tqstring.h>
#include <tqptrlist.h>
#include <tqpopupmenu.h>

class SInfo {
public:
  int length;
};

class KSTicker : public TQFrame
{
  Q_OBJECT
  TQ_OBJECT

public:
  KSTicker(TQWidget * tqparent=0, const char * name=0, WFlags f=0);
  virtual ~KSTicker();

  void setString(TQString);
  void mergeString(TQString);
  void mergeString(TQString, TQColor);

  virtual void show();
  virtual void hide();

  void speed(int *, int *);

  virtual void setBackgroundColor ( const TQColor & );
  virtual void setPalette ( const TQPalette & p );

signals:
  void doubleClick();
  void closing();

public slots:
  virtual void setSpeed(int, int);

protected slots:
  virtual void fontSelector();
  virtual void scrollRate();
  virtual void updateFont(const TQFont &font);
  virtual void scrollConstantly();

protected:
  virtual void timerEvent ( TQTimerEvent * );
  virtual void paintEvent ( TQPaintEvent * );
  virtual void resizeEvent( TQResizeEvent * );
  virtual void closeEvent( TQCloseEvent * );
  virtual void mouseDoubleClickEvent( TQMouseEvent * );
  virtual void mousePressEvent ( TQMouseEvent * );
  virtual void iconify();


private:

    TQString stripCols(TQString);

    TQStringList strlist;   /* everything left to parse */
    TQStringList strbuffer; /* fifo of the last 10 lines to scroll in scroll constantly mode */
    TQStringList tipbuffer; /* 5 lines for the tooltip */
    TQString currentStr;   /* the string we are currently parsing */

    TQFont ourFont;

    int onechar;
    int chars;
    int descent;

    int tickStep;
    int cOffset;

    int tickRate;

    int pHeight;

    int currentChar;

    void startTicker();
    void stopTicker();

    bool bScrollConstantly;
    int iScrollItem;
    bool bAtEnd;

    TQPixmap *pic;

    TQPopupMenu *popup;

    /*
     * Drawing settings and variables
     */
    bool bold;
    bool underline;
    bool italics;
    TQColor defbg;
    TQColor deffg;
    TQColor bg;
    TQColor fg;
};

#endif // KSTICKER_H