• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • util
kpassivepopup.h
Go to the documentation of this file.
1// -*- c++ -*-
2
3/*
4 * Copyright (C) 2001-2006 by Richard Moore <rich@kde.org>
5 * Copyright (C) 2004-2005 by Sascha Cunz <sascha.cunz@tiscali.de>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef KPASSIVEPOPUP_H
23#define KPASSIVEPOPUP_H
24
25#include <kdeui_export.h>
26
27#include <QtGui/QFrame>
28
29class KVBox;
30class QSystemTrayIcon;
31
79class KDEUI_EXPORT KPassivePopup : public QFrame
80{
81 Q_OBJECT
82 Q_PROPERTY (bool autoDelete READ autoDelete WRITE setAutoDelete )
83 Q_PROPERTY (int timeout READ timeout WRITE setTimeout )
84 Q_PROPERTY (QRect defaultArea READ defaultArea )
85
86public:
90 enum PopupStyle
91 {
92 Boxed,
93 Balloon,
94 CustomStyle=128
95 };
96
100 explicit KPassivePopup( QWidget *parent=0, Qt::WindowFlags f = 0 );
101
105 explicit KPassivePopup( WId parent );
106
107#if 0 // These break macos and win32 where the definition of WId makes them ambiguous
112 explicit KPassivePopup( int popupStyle, QWidget *parent=0, Qt::WindowFlags f=0 ) KDE_DEPRECATED;
113
118 KPassivePopup( int popupStyle, WId parent, Qt::WindowFlags f=0 ) KDE_DEPRECATED;
119#endif
120
124 virtual ~KPassivePopup();
125
129 void setView( QWidget *child );
130
134 void setView( const QString &caption, const QString &text = QString() );
135
139 virtual void setView( const QString &caption, const QString &text, const QPixmap &icon );
140
161 KVBox * standardView( const QString& caption, const QString& text,
162 const QPixmap& icon, QWidget *parent = 0L );
163
167 QWidget *view() const;
168
172 int timeout() const;
173
180 virtual void setAutoDelete( bool autoDelete );
181
186 bool autoDelete() const;
187
196 QRect defaultArea() const;
197
201 QPoint anchor() const;
202
207 void setAnchor( const QPoint& anchor );
208
209 // TODO KDE4: give all the static methods a const QPoint p = QPoint() that in
210 // case the point is not null calls the show(const QPoint &p) method instead
211 // of the show() one.
218 static KPassivePopup *message( const QString &text, QWidget *parent );
219
226 static KPassivePopup *message( const QString &text, QSystemTrayIcon *parent );
227
234 static KPassivePopup *message( const QString &caption, const QString &text,
235 QWidget *parent );
236
243 static KPassivePopup *message( const QString &caption, const QString &text,
244 QSystemTrayIcon *parent );
245
252 static KPassivePopup *message( const QString &caption, const QString &text,
253 const QPixmap &icon,
254 QWidget *parent, int timeout = -1 );
255
262 static KPassivePopup *message( const QString &caption, const QString &text,
263 const QPixmap &icon,
264 QSystemTrayIcon *parent, int timeout = -1 );
265
272 static KPassivePopup *message( const QString &caption, const QString &text,
273 const QPixmap &icon,
274 WId parent, int timeout = -1 );
275
282 static KPassivePopup *message( int popupStyle, const QString &text, QWidget *parent );
283
290 static KPassivePopup *message( int popupStyle, const QString &text, QSystemTrayIcon *parent );
291
298 static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
299 QSystemTrayIcon *parent );
300
307 static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
308 QWidget *parent );
309
316 static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
317 const QPixmap &icon,
318 QWidget *parent, int timeout = -1 );
319
326 static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
327 const QPixmap &icon,
328 QSystemTrayIcon *parent, int timeout = -1 );
329
336 static KPassivePopup *message( int popupStyle, const QString &caption, const QString &text,
337 const QPixmap &icon,
338 WId parent, int timeout = -1 );
339
340
341public Q_SLOTS:
350 void setTimeout( int delay );
351
356 void setPopupStyle( int popupstyle );
357
361 void show();
362
366 void show(const QPoint &p);
367
368 virtual void setVisible(bool visible);
369
370Q_SIGNALS:
374 void clicked();
375
379 void clicked( const QPoint &pos );
380
381protected:
385 virtual void positionSelf();
386
391 virtual void hideEvent( QHideEvent * );
392
396 void moveNear( const QRect &target );
397
401 QPoint calculateNearbyPoint( const QRect &target);
402
406 virtual void mouseReleaseEvent( QMouseEvent *e );
407
411 void updateMask();
412
417 virtual void paintEvent( QPaintEvent* pe );
418
419private:
420 void init( WId window );
421
422 /* @internal */
423 class Private;
424 Private *const d;
425};
426
427#endif // KPASSIVEPOPUP_H
428
429// Local Variables:
430// c-basic-offset: 4
431// End:
432
KPassivePopup
A dialog-like popup that displays messages without interrupting the user.
Definition: kpassivepopup.h:80
KPassivePopup::clicked
void clicked(const QPoint &pos)
Emitted when the popup is clicked.
KPassivePopup::PopupStyle
PopupStyle
Styles that a KPassivePopup can have.
Definition: kpassivepopup.h:91
KPassivePopup::Boxed
@ Boxed
Information will appear in a framed box (default)
Definition: kpassivepopup.h:92
KPassivePopup::Balloon
@ Balloon
Information will appear in a comic-alike balloon.
Definition: kpassivepopup.h:93
KPassivePopup::clicked
void clicked()
Emitted when the popup is clicked.
KVBox
A container widget which arranges its children vertically.
Definition: kvbox.h:37
QFrame
QSystemTrayIcon
QWidget
kdeui_export.h
timeout
int timeout
message
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal