.TH "KPassivePopup" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KPassivePopup \- A dialog-like popup that displays messages without interupting the user.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kpassivepopup.h>\fP
.PP
Inherits \fBQFrame\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetTimeout\fP (int delay)"
.br
.ti -1c
.RI "virtual void \fBshow\fP ()"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBclicked\fP ()"
.br
.ti -1c
.RI "void \fBclicked\fP (\fBQPoint\fP pos)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKPassivePopup\fP (\fBQWidget\fP *parent=0, const char *name=0, WFlags f=0)"
.br
.ti -1c
.RI "\fBKPassivePopup\fP (WId parent, const char *name=0, WFlags f=0)"
.br
.ti -1c
.RI "virtual \fB~KPassivePopup\fP ()"
.br
.ti -1c
.RI "void \fBsetView\fP (\fBQWidget\fP *child)"
.br
.ti -1c
.RI "void \fBsetView\fP (const \fBQString\fP &caption, const \fBQString\fP &text=QString::null)"
.br
.ti -1c
.RI "virtual void \fBsetView\fP (const \fBQString\fP &caption, const \fBQString\fP &text, const \fBQPixmap\fP &icon)"
.br
.ti -1c
.RI "\fBQVBox\fP * \fBstandardView\fP (const \fBQString\fP &caption, const \fBQString\fP &text, const \fBQPixmap\fP &icon, \fBQWidget\fP *parent=0L)"
.br
.ti -1c
.RI "\fBQWidget\fP * \fBview\fP () const "
.br
.ti -1c
.RI "int \fBtimeout\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetAutoDelete\fP (bool autoDelete)"
.br
.ti -1c
.RI "bool \fBautoDelete\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKPassivePopup\fP * \fBmessage\fP (const \fBQString\fP &text, \fBQWidget\fP *parent, const char *name=0)"
.br
.ti -1c
.RI "static \fBKPassivePopup\fP * \fBmessage\fP (const \fBQString\fP &caption, const \fBQString\fP &text, \fBQWidget\fP *parent, const char *name=0)"
.br
.ti -1c
.RI "static \fBKPassivePopup\fP * \fBmessage\fP (const \fBQString\fP &caption, const \fBQString\fP &text, const \fBQPixmap\fP &icon, \fBQWidget\fP *parent, const char *name=0, int timeout=-1)"
.br
.ti -1c
.RI "static \fBKPassivePopup\fP * \fBmessage\fP (const \fBQString\fP &caption, const \fBQString\fP &text, const \fBQPixmap\fP &icon, WId parent, const char *name=0, int timeout=-1)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBpositionSelf\fP ()"
.br
.ti -1c
.RI "virtual void \fBhideEvent\fP (\fBQHideEvent\fP *)"
.br
.ti -1c
.RI "void \fBmoveNear\fP (\fBQRect\fP target)"
.br
.ti -1c
.RI "virtual void \fBmouseReleaseEvent\fP (\fBQMouseEvent\fP *e)"
.br
.ti -1c
.RI "\fBQRect\fP \fBdefaultArea\fP () const "
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "bool \fBautoDelete\fP"
.br
.ti -1c
.RI "int \fBtimeout\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A dialog-like popup that displays messages without interupting the user. 

The simplest uses of KPassivePopup are by using the various \fBmessage()\fP static methods. The position the popup appears at depends on the type of the parent window:
.PP
.PD 0
.IP "\(bu" 2
Normal Windows: The popup is placed adjacent to the icon of the window. 
.IP "\(bu" 2
System Tray Windows: The popup is placed adjact to the system tray window itself. 
.IP "\(bu" 2
Skip Taskbar Windows: The popup is placed adjact to the window itself if it is visible, and at the edge of the desktop otherwise.
.PP
The most basic use of KPassivePopup displays a popup containing a piece of text: 
.PP
.nf
    KPassivePopup::message( 'This is the message', this );

.fi
.PP
 We can create popups with titles and icons too, as this example shows: 
.PP
.nf
    QPixmap px;
    px.load( 'hi32-app-logtracker.png' );
    KPassivePopup::message( 'Some title', 'This is the main text', px, this );

.fi
.PP
 For more control over the popup, you can use the \fBsetView(QWidget *)\fP method to create a custom popup. 
.PP
.nf
    KPassivePopup *pop = new KPassivePopup( parent );

    QVBox *vb = new QVBox( pop );
    (void) new QLabel( vb, '<b>Isn't this great?</b>' );

    QHBox *box = new QHBox( vb );
    (void) new QPushButton( box, 'Yes' );
    (void) new QPushButton( box, 'No' );

    pop->setView( vb );
    pop->show();

.fi
.PP
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkpassivepopup.h\fP 345236 2004-09-09 15:23:55Z dfaure 
.RE
.PP
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fBAuthor:\fP
.RS 4
Richard Moore, rich@kde.org 
.RE
.PP

.PP
Definition at line 62 of file kpassivepopup.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPassivePopup::KPassivePopup (\fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP, WFlags f = \fC0\fP)"
.PP
Creates a popup for the specified widget. 
.PP
Definition at line 34 of file kpassivepopup.cpp.
.PP
Referenced by message().
.SS "KPassivePopup::KPassivePopup (WId parent, const char * name = \fC0\fP, WFlags f = \fC0\fP)"
.PP
Creates a popup for the specified window. 
.PP
Definition at line 42 of file kpassivepopup.cpp.
.SS "KPassivePopup::~\fBKPassivePopup\fP ()\fC [virtual]\fP"
.PP
Cleans up. 
.PP
Definition at line 58 of file kpassivepopup.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KPassivePopup::setView (\fBQWidget\fP * child)"
.PP
Sets the main view to be the specified widget (which must be a child of the popup). 
.PP
Definition at line 62 of file kpassivepopup.cpp.
.PP
References QBoxLayout::addWidget().
.PP
Referenced by message(), and setView().
.SS "void KPassivePopup::setView (const \fBQString\fP & caption, const \fBQString\fP & text = \fCQString::null\fP)"
.PP
Creates a standard view then calls \fBsetView(QWidget*)\fP . 
.PP
Definition at line 116 of file kpassivepopup.cpp.
.PP
References setView().
.SS "void KPassivePopup::setView (const \fBQString\fP & caption, const \fBQString\fP & text, const \fBQPixmap\fP & icon)\fC [virtual]\fP"
.PP
Creates a standard view then calls \fBsetView(QWidget*)\fP . 
.PP
Definition at line 73 of file kpassivepopup.cpp.
.PP
References setView(), and standardView().
.SS "\fBQVBox\fP * KPassivePopup::standardView (const \fBQString\fP & caption, const \fBQString\fP & text, const \fBQPixmap\fP & icon, \fBQWidget\fP * parent = \fC0L\fP)"
.PP
Returns a widget that is used as standard view if one of the \fBsetView()\fP methods taking the \fBQString\fP arguments is used. 
.PP
You can use the returned widget to customize the passivepopup while keeping the look similar to the 'standard' passivepopups.
.PP
After customizing the widget, pass it to \fBsetView( QWidget* )\fP
.PP
\fBParameters:\fP
.RS 4
\fIcaption\fP The window caption (title) on the popup 
.br
\fItext\fP The text for the popup 
.br
\fIicon\fP The icon to use for the popup 
.br
\fIparent\fP The parent widget used for the returned \fBQVBox\fP. If left 0L, then 'this', i.e. the passive popup object will be used.
.RE
.PP
\fBReturns:\fP
.RS 4
a \fBQVBox\fP containing the given arguments, looking like the standard passivepopups. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetView( QWidget * )\fP 
.PP
\fBsetView( const QString&, const QString& )\fP 
.PP
\fBsetView( const QString&, const QString&, const QPixmap& )\fP 
.RE
.PP

.PP
Definition at line 80 of file kpassivepopup.cpp.
.PP
References QLabel::setAlignment(), QFont::setBold(), QLabel::setFont(), QLabel::setPixmap(), QHBox::setSpacing(), and QHBox::setStretchFactor().
.PP
Referenced by setView().
.SS "\fBQWidget\fP* KPassivePopup::view () const\fC [inline]\fP"
.PP
Returns the main view. 
.PP
Definition at line 125 of file kpassivepopup.h.
.SS "int KPassivePopup::timeout () const\fC [inline]\fP"
.PP
Returns the delay before the popup is removed automatically. 
.PP
Definition at line 130 of file kpassivepopup.h.
.SS "void KPassivePopup::setAutoDelete (bool autoDelete)\fC [virtual]\fP"
.PP
Enables / disables auto-deletion of this widget when the \fBtimeout\fP occurs. 
.PP
The default is false. If you use the class-methods \fBmessage()\fP, auto-delection is turned on by default. 
.PP
Definition at line 128 of file kpassivepopup.cpp.
.PP
Referenced by message().
.SS "bool KPassivePopup::autoDelete () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
true if the widget auto-deletes itself when the \fBtimeout\fP occurs. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetAutoDelete\fP 
.RE
.PP

.PP
Definition at line 144 of file kpassivepopup.h.
.SS "\fBKPassivePopup\fP * KPassivePopup::message (const \fBQString\fP & text, \fBQWidget\fP * parent, const char * name = \fC0\fP)\fC [static]\fP"
.PP
Convenience method that displays popup with the specified message beside the icon of the specified widget. 
.PP
Note that the returned object is destroyed when it is hidden. 
.PP
\fBSee also:\fP
.RS 4
\fBsetAutoDelete\fP 
.RE
.PP

.PP
Definition at line 276 of file kpassivepopup.cpp.
.PP
Referenced by message().
.SS "\fBKPassivePopup\fP * KPassivePopup::message (const \fBQString\fP & caption, const \fBQString\fP & text, \fBQWidget\fP * parent, const char * name = \fC0\fP)\fC [static]\fP"
.PP
Convenience method that displays popup with the specified caption and message beside the icon of the specified widget. 
.PP
Note that the returned object is destroyed when it is hidden. 
.PP
\fBSee also:\fP
.RS 4
\fBsetAutoDelete\fP 
.RE
.PP

.PP
Definition at line 281 of file kpassivepopup.cpp.
.PP
References message().
.SS "\fBKPassivePopup\fP * KPassivePopup::message (const \fBQString\fP & caption, const \fBQString\fP & text, const \fBQPixmap\fP & icon, \fBQWidget\fP * parent, const char * name = \fC0\fP, int timeout = \fC-1\fP)\fC [static]\fP"
.PP
Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified widget. 
.PP
Note that the returned object is destroyed when it is hidden. 
.PP
\fBSee also:\fP
.RS 4
\fBsetAutoDelete\fP 
.RE
.PP

.PP
Definition at line 263 of file kpassivepopup.cpp.
.PP
References hideDelay, KPassivePopup(), setAutoDelete(), setView(), and show().
.SS "\fBKPassivePopup\fP * KPassivePopup::message (const \fBQString\fP & caption, const \fBQString\fP & text, const \fBQPixmap\fP & icon, WId parent, const char * name = \fC0\fP, int timeout = \fC-1\fP)\fC [static]\fP"
.PP
Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified window. 
.PP
Note that the returned object is destroyed when it is hidden. 
.PP
\fBSee also:\fP
.RS 4
\fBsetAutoDelete\fP 
.RE
.PP

.PP
Definition at line 287 of file kpassivepopup.cpp.
.PP
References hideDelay, KPassivePopup(), setAutoDelete(), setView(), and show().
.SS "void KPassivePopup::setTimeout (int delay)\fC [slot]\fP"
.PP
Sets the delay for the popup is removed automatically. 
.PP
Setting the delay to 0 disables the \fBtimeout\fP, if you're doing this, you may want to connect the \fBclicked()\fP signal to the hide() slot. Setting the delay to -1 makes it use the default value. 
.PP
Definition at line 121 of file kpassivepopup.cpp.
.PP
References QTimer::changeInterval(), and QTimer::isActive().
.SS "void KPassivePopup::show ()\fC [virtual, slot]\fP"
.PP
Reimplemented to reposition the popup. 
.PP
Definition at line 143 of file kpassivepopup.cpp.
.PP
References positionSelf(), and QTimer::start().
.PP
Referenced by message().
.SS "void KPassivePopup::clicked ()\fC [signal]\fP"
.PP
Emitted when the popup is clicked. 
.PP
Referenced by mouseReleaseEvent().
.SS "void KPassivePopup::clicked (\fBQPoint\fP pos)\fC [signal]\fP"
.PP
Emitted when the popup is clicked. 
.PP
.SS "void KPassivePopup::positionSelf ()\fC [protected, virtual]\fP"
.PP
This method positions the popup. 
.PP
Definition at line 187 of file kpassivepopup.cpp.
.PP
References defaultArea(), NETSize::height, NETWinInfo::iconGeometry(), QRect::isNull(), NETWinInfo::kdeGeometry(), NETWinInfo::kdeSystemTrayWinFor(), moveNear(), NETRect::pos, QRect::setRect(), NETRect::size, NETWinInfo::state(), NETSize::width, NETPoint::x, and NETPoint::y.
.PP
Referenced by show().
.SS "void KPassivePopup::hideEvent (\fBQHideEvent\fP *)\fC [protected, virtual]\fP"
.PP
Reimplemented to destroy the object when \fBautoDelete()\fP is enabled. 
.PP
Definition at line 160 of file kpassivepopup.cpp.
.PP
References QTimer::stop().
.SS "void KPassivePopup::moveNear (\fBQRect\fP target)\fC [protected]\fP"
.PP
Moves the popup to be adjacent to the icon of the specified rectangle. 
.PP
Definition at line 228 of file kpassivepopup.cpp.
.PP
References KGlobalSettings::desktopGeometry(), QRect::height(), QRect::topLeft(), QRect::width(), QPoint::x(), and QPoint::y().
.PP
Referenced by positionSelf().
.SS "void KPassivePopup::mouseReleaseEvent (\fBQMouseEvent\fP * e)\fC [protected, virtual]\fP"
.PP
Reimplemented to detect mouse clicks. 
.PP
Definition at line 133 of file kpassivepopup.cpp.
.PP
References clicked().
.SS "\fBQRect\fP KPassivePopup::defaultArea () const\fC [protected]\fP"
.PP
If no relative window (eg taskbar button, system tray window) is available, use this rectangle (pass it to \fBmoveNear()\fP). 
.PP
Basically KWinModule::workArea() with width and height set to 0 so that moveNear uses the upper-left position. 
.PP
\fBReturns:\fP
.RS 4
The \fBQRect\fP to be passed to \fBmoveNear()\fP if no other is available. 
.RE
.PP

.PP
Definition at line 167 of file kpassivepopup.cpp.
.PP
References NETRootInfo::activate(), NETRootInfo::currentDesktop(), NETRect::pos, QRect::setRect(), NETRootInfo::workArea(), NETPoint::x, and NETPoint::y.
.PP
Referenced by positionSelf().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
