org.kde.koala

Class KPassivePopup

public class KPassivePopup extends QFrame

The simplest uses of KPassivePopup are by using the various message() static methods. The position the popup appears at depends on the type of the parent window:
  • Normal Windows: The popup is placed adjacent to the icon of the window.
  • System Tray Windows: The popup is placed adjact to the system tray window itself.
  • Skip Taskbar Windows: The popup is placed adjact to the window itself if it is visible, and at the edge of the desktop otherwise.
  • You also have the option of calling show with a QPoint as a parameter that removes the automatic placing of KPassivePopup and shows it in the point you want. The most basic use of KPassivePopup displays a popup containing a piece of text:
        KPassivePopup.message( "This is the message", this );
     
    We can create popups with titles and icons too, as this example shows:
        QPixmap px;
        px.load( "hi32-app-logtracker.png" );
        KPassivePopup.message( "Some title", "This is the main text", px, this );
     
    For more control over the popup, you can use the setView(QWidget ) method to create a custom popup.
        KPassivePopup pop = new KPassivePopup( parent );
        QVBox vb = new QVBox( pop );
         new QLabel( vb, "Isn't this great?" );
        QHBox box = new QHBox( vb );
         new QPushButton( box, "Yes" );
         new QPushButton( box, "No" );
        pop.setView( vb );
        pop.show();
     
    See KPassivePopupSignals for signals emitted by KPassivePopup

    Version: $Id: KPassivePopup.java 473384 2005-10-23 14:17:09Z rdale $

    Author: Sascha Cunz, sascha.cunz@tiscali.de

    UNKNOWN: A dialog-like popup that displays messages without interupting the user.

    Field Summary
    static intBalloon
    static intBoxed
    Styles that a KPassivePopup can have.
    static intCustomStyle
    Constructor Summary
    protected KPassivePopup(Class dummy)
    KPassivePopup(QWidget parent, String name, int f)
    Creates a popup for the specified widget.
    KPassivePopup(QWidget parent, String name)
    KPassivePopup(QWidget parent)
    KPassivePopup()
    KPassivePopup(long parent, String name, int f)
    Creates a popup for the specified window.
    KPassivePopup(long parent, String name)
    KPassivePopup(long parent)
    KPassivePopup(int popupStyle, QWidget parent, String name, int f)
    Creates a popup for the specified widget.
    KPassivePopup(int popupStyle, QWidget parent, String name)
    KPassivePopup(int popupStyle, QWidget parent)
    KPassivePopup(int popupStyle)
    KPassivePopup(int popupStyle, long parent, String name, int f)
    Creates a popup for the specified window.
    KPassivePopup(int popupStyle, long parent, String name)
    KPassivePopup(int popupStyle, long parent)
    Method Summary
    booleanautoDelete()
    StringclassName()
    protected QRectdefaultArea()
    If no relative window (eg taskbar button, system tray window) is available, use this rectangle (pass it to moveNear()).
    voiddispose()
    Delete the wrapped C++ instance ahead of finalize()
    protected voidfinalize()
    Deletes the wrapped C++ instance
    protected voidhideEvent(QHideEvent arg1)
    Reimplemented to destroy the object when autoDelete() is enabled.
    booleanisDisposed()
    Has the wrapped C++ instance been deleted?
    static KPassivePopupmessage(String text, QWidget parent, String name)
    Convenience method that displays popup with the specified message beside the icon of the specified widget.
    static KPassivePopupmessage(String text, QWidget parent)
    static KPassivePopupmessage(String caption, String text, QWidget parent, String name)
    Convenience method that displays popup with the specified caption and message beside the icon of the specified widget.
    static KPassivePopupmessage(String caption, String text, QWidget parent)
    static KPassivePopupmessage(String caption, String text, QPixmap icon, QWidget parent, String name, int timeout)
    Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified widget.
    static KPassivePopupmessage(String caption, String text, QPixmap icon, QWidget parent, String name)
    static KPassivePopupmessage(String caption, String text, QPixmap icon, QWidget parent)
    static KPassivePopupmessage(String caption, String text, QPixmap icon, long parent, String name, int timeout)
    Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified window.
    static KPassivePopupmessage(String caption, String text, QPixmap icon, long parent, String name)
    static KPassivePopupmessage(String caption, String text, QPixmap icon, long parent)
    static KPassivePopupmessage(int popupStyle, String text, QWidget parent, String name)
    Convenience method that displays popup with the specified popup-style and message beside the icon of the specified widget.
    static KPassivePopupmessage(int popupStyle, String text, QWidget parent)
    static KPassivePopupmessage(int popupStyle, String caption, String text, QWidget parent, String name)
    Convenience method that displays popup with the specified popup-style, caption and message beside the icon of the specified widget.
    static KPassivePopupmessage(int popupStyle, String caption, String text, QWidget parent)
    static KPassivePopupmessage(int popupStyle, String caption, String text, QPixmap icon, QWidget parent, String name, int timeout)
    Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified widget.
    static KPassivePopupmessage(int popupStyle, String caption, String text, QPixmap icon, QWidget parent, String name)
    static KPassivePopupmessage(int popupStyle, String caption, String text, QPixmap icon, QWidget parent)
    static KPassivePopupmessage(int popupStyle, String caption, String text, QPixmap icon, long parent, String name, int timeout)
    Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified window.
    static KPassivePopupmessage(int popupStyle, String caption, String text, QPixmap icon, long parent, String name)
    static KPassivePopupmessage(int popupStyle, String caption, String text, QPixmap icon, long parent)
    QMetaObjectmetaObject()
    protected voidmouseReleaseEvent(QMouseEvent e)
    Reimplemented to detect mouse clicks.
    protected voidmoveNear(QRect target)
    Moves the popup to be adjacent to the icon of the specified rectangle.
    protected voidpaintEvent(QPaintEvent pe)
    Overwrite to paint the border when PopupStyle == Balloon.
    protected voidpositionSelf()
    This method positions the popup.
    voidsetAnchor(QPoint anchor)
    Sets the anchor of this balloon.
    voidsetAutoDelete(boolean autoDelete)
    Enables / disables auto-deletion of this widget when the timeout occurs.
    voidsetTimeout(int delay)
    Sets the delay for the popup is removed automatically.
    voidsetView(QWidget child)
    Sets the main view to be the specified widget (which must be a child of the popup).
    voidsetView(String caption, String text)
    Creates a standard view then calls setView(QWidget) .
    voidsetView(String caption)
    voidsetView(String caption, String text, QPixmap icon)
    Creates a standard view then calls setView(QWidget) .
    voidshow()
    Reimplemented to reposition the popup.
    voidshow(QPoint p)
    Shows the popup in the given point
    QVBoxstandardView(String caption, String text, QPixmap icon, QWidget parent)
    Returns a widget that is used as standard view if one of the setView() methods taking the String arguments is used.
    QVBoxstandardView(String caption, String text, QPixmap icon)
    inttimeout()
    Returns the delay before the popup is removed automatically.
    protected voidupdateMask()
    Updates the transparency mask.
    QWidgetview()
    Returns the main view.

    Field Detail

    Balloon

    public static final int Balloon

    Boxed

    public static final int Boxed
    Styles that a KPassivePopup can have.

    UNKNOWN: Styles that a KPassivePopup can have.

    CustomStyle

    public static final int CustomStyle

    Constructor Detail

    KPassivePopup

    protected KPassivePopup(Class dummy)

    KPassivePopup

    public KPassivePopup(QWidget parent, String name, int f)
    Creates a popup for the specified widget.

    UNKNOWN: Creates a popup for the specified widget.

    KPassivePopup

    public KPassivePopup(QWidget parent, String name)

    KPassivePopup

    public KPassivePopup(QWidget parent)

    KPassivePopup

    public KPassivePopup()

    KPassivePopup

    public KPassivePopup(long parent, String name, int f)
    Creates a popup for the specified window.

    UNKNOWN: Creates a popup for the specified window.

    KPassivePopup

    public KPassivePopup(long parent, String name)

    KPassivePopup

    public KPassivePopup(long parent)

    KPassivePopup

    public KPassivePopup(int popupStyle, QWidget parent, String name, int f)
    Creates a popup for the specified widget.

    UNKNOWN: Creates a popup for the specified widget.

    KPassivePopup

    public KPassivePopup(int popupStyle, QWidget parent, String name)

    KPassivePopup

    public KPassivePopup(int popupStyle, QWidget parent)

    KPassivePopup

    public KPassivePopup(int popupStyle)

    KPassivePopup

    public KPassivePopup(int popupStyle, long parent, String name, int f)
    Creates a popup for the specified window.

    UNKNOWN: Creates a popup for the specified window.

    KPassivePopup

    public KPassivePopup(int popupStyle, long parent, String name)

    KPassivePopup

    public KPassivePopup(int popupStyle, long parent)

    Method Detail

    autoDelete

    public boolean autoDelete()

    Returns: true if the widget auto-deletes itself when the timeout occurs.

    See Also: KPassivePopup

    UNKNOWN:

    className

    public String className()

    defaultArea

    protected QRect defaultArea()
    If no relative window (eg taskbar button, system tray window) is available, use this rectangle (pass it to moveNear()). Basically KWinModule.workArea() with width and height set to 0 so that moveNear uses the upper-left position.

    Returns: The QRect to be passed to moveNear() if no other is available.

    UNKNOWN: If no relative window (eg taskbar button, system tray window) is available, use this rectangle (pass it to moveNear()).

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    finalize

    protected void finalize()
    Deletes the wrapped C++ instance

    hideEvent

    protected void hideEvent(QHideEvent arg1)
    Reimplemented to destroy the object when autoDelete() is enabled.

    UNKNOWN: Reimplemented to destroy the object when autoDelete() is enabled.

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    message

    public static KPassivePopup message(String text, QWidget parent, String name)
    Convenience method that displays popup with the specified message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.

    See Also: KPassivePopup

    UNKNOWN: Convenience method that displays popup with the specified message beside the icon of the specified widget.

    message

    public static KPassivePopup message(String text, QWidget parent)

    message

    public static KPassivePopup message(String caption, String text, QWidget parent, String name)
    Convenience method that displays popup with the specified caption and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.

    See Also: KPassivePopup

    UNKNOWN: Convenience method that displays popup with the specified caption and message beside the icon of the specified widget.

    message

    public static KPassivePopup message(String caption, String text, QWidget parent)

    message

    public static KPassivePopup message(String caption, String text, QPixmap icon, QWidget parent, String name, int timeout)
    Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.

    See Also: KPassivePopup

    UNKNOWN: Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified widget.

    message

    public static KPassivePopup message(String caption, String text, QPixmap icon, QWidget parent, String name)

    message

    public static KPassivePopup message(String caption, String text, QPixmap icon, QWidget parent)

    message

    public static KPassivePopup message(String caption, String text, QPixmap icon, long parent, String name, int timeout)
    Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified window. Note that the returned object is destroyed when it is hidden.

    See Also: KPassivePopup

    UNKNOWN: Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified window.

    message

    public static KPassivePopup message(String caption, String text, QPixmap icon, long parent, String name)

    message

    public static KPassivePopup message(String caption, String text, QPixmap icon, long parent)

    message

    public static KPassivePopup message(int popupStyle, String text, QWidget parent, String name)
    Convenience method that displays popup with the specified popup-style and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.

    See Also: KPassivePopup

    UNKNOWN: Convenience method that displays popup with the specified popup-style and message beside the icon of the specified widget.

    message

    public static KPassivePopup message(int popupStyle, String text, QWidget parent)

    message

    public static KPassivePopup message(int popupStyle, String caption, String text, QWidget parent, String name)
    Convenience method that displays popup with the specified popup-style, caption and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.

    See Also: KPassivePopup

    UNKNOWN: Convenience method that displays popup with the specified popup-style, caption and message beside the icon of the specified widget.

    message

    public static KPassivePopup message(int popupStyle, String caption, String text, QWidget parent)

    message

    public static KPassivePopup message(int popupStyle, String caption, String text, QPixmap icon, QWidget parent, String name, int timeout)
    Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.

    See Also: KPassivePopup

    UNKNOWN: Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified widget.

    message

    public static KPassivePopup message(int popupStyle, String caption, String text, QPixmap icon, QWidget parent, String name)

    message

    public static KPassivePopup message(int popupStyle, String caption, String text, QPixmap icon, QWidget parent)

    message

    public static KPassivePopup message(int popupStyle, String caption, String text, QPixmap icon, long parent, String name, int timeout)
    Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified window. Note that the returned object is destroyed when it is hidden.

    See Also: KPassivePopup

    UNKNOWN: Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified window.

    message

    public static KPassivePopup message(int popupStyle, String caption, String text, QPixmap icon, long parent, String name)

    message

    public static KPassivePopup message(int popupStyle, String caption, String text, QPixmap icon, long parent)

    metaObject

    public QMetaObject metaObject()

    mouseReleaseEvent

    protected void mouseReleaseEvent(QMouseEvent e)
    Reimplemented to detect mouse clicks.

    UNKNOWN: Reimplemented to detect mouse clicks.

    moveNear

    protected void moveNear(QRect target)
    Moves the popup to be adjacent to the icon of the specified rectangle.

    UNKNOWN: Moves the popup to be adjacent to the icon of the specified rectangle.

    paintEvent

    protected void paintEvent(QPaintEvent pe)
    Overwrite to paint the border when PopupStyle == Balloon. Unused if PopupStyle == Boxed

    UNKNOWN: Overwrite to paint the border when PopupStyle == Balloon.

    positionSelf

    protected void positionSelf()
    This method positions the popup.

    UNKNOWN: This method positions the popup.

    setAnchor

    public void setAnchor(QPoint anchor)
    Sets the anchor of this balloon. The balloon tries automatically to adjust itself somehow around the point.

    UNKNOWN: Sets the anchor of this balloon.

    setAutoDelete

    public void setAutoDelete(boolean autoDelete)
    Enables / disables auto-deletion of this widget when the timeout occurs. The default is false. If you use the class-methods message(), auto-delection is turned on by default.

    UNKNOWN: Enables / disables auto-deletion of this widget when the timeout occurs.

    setTimeout

    public void setTimeout(int delay)
    Sets the delay for the popup is removed automatically. Setting the delay to 0 disables the timeout, if you're doing this, you may want to connect the clicked() signal to the hide() slot. Setting the delay to -1 makes it use the default value.

    See Also: KPassivePopup

    UNKNOWN: Sets the delay for the popup is removed automatically.

    setView

    public void setView(QWidget child)
    Sets the main view to be the specified widget (which must be a child of the popup).

    UNKNOWN: Sets the main view to be the specified widget (which must be a child of the popup).

    setView

    public void setView(String caption, String text)
    Creates a standard view then calls setView(QWidget) .

    UNKNOWN: Creates a standard view then calls setView(QWidget ) .

    setView

    public void setView(String caption)

    setView

    public void setView(String caption, String text, QPixmap icon)
    Creates a standard view then calls setView(QWidget) .

    UNKNOWN: Creates a standard view then calls setView(QWidget ) .

    show

    public void show()
    Reimplemented to reposition the popup.

    UNKNOWN: Reimplemented to reposition the popup.

    show

    public void show(QPoint p)
    Shows the popup in the given point

    UNKNOWN: Shows the popup in the given point

    standardView

    public QVBox standardView(String caption, String text, QPixmap icon, QWidget parent)
    Returns a widget that is used as standard view if one of the setView() methods taking the String arguments is used. You can use the returned widget to customize the passivepopup while keeping the look similar to the "standard" passivepopups. After customizing the widget, pass it to setView( QWidget )

    Parameters: caption The window caption (title) on the popup text The text for the popup icon The icon to use for the popup parent The parent widget used for the returned QVBox. If left null, then "this", i.e. the passive popup object will be used.

    Returns: a QVBox containing the given arguments, looking like the standard passivepopups.

    See Also: ( org.kde.qt.QWidget ( KPassivePopup KPassivePopup ( KPassivePopup KPassivePopup KPassivePopup org.kde.qt.QPixmap&

    UNKNOWN: Returns a widget that is used as standard view if one of the setView() methods taking the String arguments is used.

    standardView

    public QVBox standardView(String caption, String text, QPixmap icon)

    timeout

    public int timeout()
    Returns the delay before the popup is removed automatically.

    UNKNOWN: Returns the delay before the popup is removed automatically.

    updateMask

    protected void updateMask()
    Updates the transparency mask. Unused if PopupStyle == Boxed

    UNKNOWN: Updates the transparency mask.

    view

    public QWidget view()
    Returns the main view.

    UNKNOWN: Returns the main view.