summaryrefslogtreecommitdiffstats
path: root/src/knutmessage.h
blob: a4a25112fff4440c7c3c2d1ed3c1ef0de0a78b39 (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/***************************************************************************
                          knutmessage.h  -  description
                             -------------------
    begin                : So led 24 2004
    copyright            : (C) 2004 by Daniel Prynych
    email                : Daniel.Prynych@alo.cz
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 KNUTMESSAGE_H
#define KNUTMESSAGE_H

#include <kdialogbase.h>

//#include <tqpixmap.h>
//#include <tqtimer.h>


/**
  *@author Daniel Prynych
  */


class TQTimer;
class TQPixmap;

/**
 * Tato trida zobrazi okno zpravy v modeless rezimu.
 * Okno pracuje nezavisle na ostatnich oknech a NEPOZASTAVUJE jejich cinnost.
 *
 * @author Daniel Prynych
 * @short window message
 * @version 0.1
  */
class KNutMessage : public KDialogBase  {
    Q_OBJECT
  TQ_OBJECT
public: 

enum typeOfMessage {
  infoMess,
  warningMess,
  criticalMess
  };


/**
 * Constructor - makes window of message.
 * Konstruktor - vytvori okno zpravy.
 * @param  messageText  is text of message 
 * @param  type is type of message see on enum typeOfMessage
 * @param  timeValidity maximal time for showing window, if it is equal zere, time is unlimited.
 *
 * @param  messageText je text zpravu.
 * @param  type je typ zpravy blize enum typeOfMessage
 * @param  timeValidity maximalni doba zobrazeni okna, je-li rovna nule je neomezena.
 * @since  0.2
 */
  KNutMessage(const TQString messageText, const typeOfMessage type=infoMess, const long int timeValidity=0, TQWidget *tqparent=0, const char *name=0);

/**
 * Destruktor.
 *
 * @since  0.1.2
 **/
  ~KNutMessage();

signals:
/**
 * Je emitovan kdyz dojde ke stisku tlacitka OK, nebo vyprsi doba platnosti (timeValidity).
 * Is emited, when button OK is pressed or time of validity is stopped.
 *
 * @since  0.1
 **/
  void endMessage(void);

/**
 * Is emited when window of message is moved;
 * Je emitovan kdyz dojde presunu okna.
 *
 * @since  0.1
 **/

  void messageMoved (int, int);

private slots:

/**
 * @internal
 * Je aktivivan, kdyz vyprsi doba platnosti (timeValidity).
 *
 * @since  0.1
 **/
  void timeout(void);

/**
 * @internal
 * Is activated when button OK was pressed
 * Je aktivovan kdyz se stiskne tlacitko OK
 *
 * @since  0.1
 **/
  virtual void slotOk (void);


private:
  // max rime for message window is 3600 sec or 60 min
  static const int maxTime = 3600;

  TQPixmap m_ret;
  TQTimer* m_messageTimer;

protected:
  void moveEvent ( TQMoveEvent * e);


};

#endif