• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kpassivepopup.h
1 // -*- c++ -*-
2 
3 /*
4  * Copyright : (C) 2001-2002 by Richard Moore
5  * Copyright : (C) 2004-2005 by Sascha Cunz
6  * License : This file is released under the terms of the LGPL, version 2.
7  * Email : rich@kde.org
8  * Email : sascha.cunz@tiscali.de
9  */
10 
11 #ifndef KPASSIVEPOPUP_H
12 #define KPASSIVEPOPUP_H
13 
14 #include <tqframe.h>
15 
16 #include <tdelibs_export.h>
17 
18 class TQBoxLayout;
19 class TQTimer;
20 class TQLabel;
21 class TQVBox;
22 
68 class TDEUI_EXPORT KPassivePopup : public TQFrame
69 {
70  Q_OBJECT
71  TQ_PROPERTY (bool autoDelete READ autoDelete WRITE setAutoDelete )
72  TQ_PROPERTY (int timeout READ timeout WRITE setTimeout )
73 
74 public:
79  enum PopupStyle
80  {
81  Boxed,
82  Balloon,
83  CustomStyle=128
84  };
85 
89  KPassivePopup( TQWidget *parent=0, const char *name=0, WFlags f=0 );
90 
94  KPassivePopup( WId parent, const char *name=0, WFlags f=0 );
95 
100  KPassivePopup( int popupStyle, TQWidget *parent=0, const char *name=0, WFlags f=0 );
101 
106  KPassivePopup( int popupStyle, WId parent, const char *name=0, WFlags f=0 );
107 
111  virtual ~KPassivePopup();
112 
116  void setView( TQWidget *child );
117 
121  void setView( const TQString &caption, const TQString &text = TQString::null );
122 
126  virtual void setView( const TQString &caption, const TQString &text, const TQPixmap &icon );
127 
148  TQVBox * standardView( const TQString& caption, const TQString& text,
149  const TQPixmap& icon, TQWidget *parent = 0L );
150 
154  TQWidget *view() const { return msgView; }
155 
159  int timeout() const { return hideDelay; }
160 
167  virtual void setAutoDelete( bool autoDelete );
168 
173  bool autoDelete() const { return m_autoDelete; }
174 
180  void setAnchor( const TQPoint& anchor );
181 
182  // TODO KDE4: give all the statics method a const TQPoint p = TQPoint() that in
183  // case the point is not null calls the show(cosnt TQPoint &p) method instead
184  // the show() one.
191  static KPassivePopup *message( const TQString &text, TQWidget *parent, const char *name=0 );
192 
199  static KPassivePopup *message( const TQString &caption, const TQString &text,
200  TQWidget *parent, const char *name=0 );
201 
208  static KPassivePopup *message( const TQString &caption, const TQString &text,
209  const TQPixmap &icon,
210  TQWidget *parent, const char *name=0, int timeout = -1 );
211 
218  static KPassivePopup *message( const TQString &caption, const TQString &text,
219  const TQPixmap &icon,
220  WId parent, const char *name=0, int timeout = -1 );
221 
228  static KPassivePopup *message( int popupStyle, const TQString &text, TQWidget *parent,
229  const char *name=0 );
230 
237  static KPassivePopup *message( int popupStyle, const TQString &caption, const TQString &text,
238  TQWidget *parent, const char *name=0 );
239 
246  static KPassivePopup *message( int popupStyle, const TQString &caption, const TQString &text,
247  const TQPixmap &icon,
248  TQWidget *parent, const char *name=0, int timeout = -1 );
249 
256  static KPassivePopup *message( int popupStyle, const TQString &caption, const TQString &text,
257  const TQPixmap &icon,
258  WId parent, const char *name=0, int timeout = -1 );
259 
260 
261 public slots:
270  void setTimeout( int delay );
271 
275  virtual void show();
276 
281  void show(const TQPoint &p);
282 
283 signals:
287  void clicked();
288 
292  void clicked( TQPoint pos );
293 
297  void hidden(KPassivePopup*);
298 
299 protected:
303  virtual void positionSelf();
304 
309  virtual void hideEvent( TQHideEvent * );
310 
314  void moveNear( TQRect target );
315 
319  virtual void mouseReleaseEvent( TQMouseEvent *e );
320 
329  TQRect defaultArea() const;
330 
335  void updateMask();
336 
341  virtual void paintEvent( TQPaintEvent* pe );
342 
343 private:
344  void init( int popupStyle );
345 
346  WId window;
347  TQWidget *msgView;
348  TQBoxLayout *topLayout;
349  int hideDelay;
350  TQTimer *hideTimer;
351 
352  TQLabel *ttlIcon;
353  TQLabel *ttl;
354  TQLabel *msg;
355 
356  bool m_autoDelete;
357 
358  /* @internal */
359  class Private;
360  Private *d;
361 };
362 
363 #endif // KPASSIVEPOPUP_H
364 
365 // Local Variables:
366 // c-basic-offset: 4
367 // End:
368 
KPassivePopup::PopupStyle
PopupStyle
Styles that a KPassivePopup can have.
Definition: kpassivepopup.h:79
KPassivePopup::Balloon
Information will appear in a comic-alike balloon.
Definition: kpassivepopup.h:82
KPassivePopup::view
TQWidget * view() const
Returns the main view.
Definition: kpassivepopup.h:154
KPassivePopup::autoDelete
bool autoDelete() const
Definition: kpassivepopup.h:173
KPassivePopup
A dialog-like popup that displays messages without interupting the user.
Definition: kpassivepopup.h:68
KPassivePopup::Boxed
Information will appear in a framed box (default)
Definition: kpassivepopup.h:81
KPassivePopup::timeout
int timeout() const
Returns the delay before the popup is removed automatically.
Definition: kpassivepopup.h:159

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.13
This website is maintained by Timothy Pearson.