KDEUI
kstatusnotifieritem.cpp
Go to the documentation of this file.
60 KDBusMenuExporter(const QString &dbusObjectPath, QMenu *menu, const QDBusConnection &dbusConnection)
161 emit d->statusNotifierItemDBus->NewStatus(metaObject()->enumerator(metaObject()->indexOfEnumerator("ItemStatus")).valueToKey(d->status));
221 QPixmap iconPixmap = KIcon(d->iconName).pixmap(KIconLoader::SizeSmallMedium, KIconLoader::SizeSmallMedium);
223 QPixmap overlayPixmap = KIcon(d->overlayIconName).pixmap(KIconLoader::SizeSmallMedium/2, KIconLoader::SizeSmallMedium/2);
225 p.drawPixmap(iconPixmap.width()-overlayPixmap.width(), iconPixmap.height()-overlayPixmap.height(), overlayPixmap);
249 QPixmap iconPixmap = d->icon.pixmap(KIconLoader::SizeSmallMedium, KIconLoader::SizeSmallMedium);
250 QPixmap overlayPixmap = d->overlayIcon.pixmap(KIconLoader::SizeSmallMedium/2, KIconLoader::SizeSmallMedium/2);
253 p.drawPixmap(iconPixmap.width()-overlayPixmap.width(), iconPixmap.height()-overlayPixmap.height(), overlayPixmap);
325 void KStatusNotifierItem::setToolTip(const QString &iconName, const QString &title, const QString &subTitle)
345 void KStatusNotifierItem::setToolTip(const QIcon &icon, const QString &title, const QString &subTitle)
551 void KStatusNotifierItem::showMessage(const QString & title, const QString & message, const QString &icon, int timeout)
554 d->notificationsClient = new org::freedesktop::Notifications("org.freedesktop.Notifications", "/org/freedesktop/Notifications",
559 d->notificationsClient->Notify(d->title, id, icon, title, message, QStringList(), QVariantMap(), timeout);
575 emit d->statusNotifierItemDBus->NewStatus(metaObject()->enumerator(metaObject()->indexOfEnumerator("ItemStatus")).valueToKey(d->status));
612 KWindowInfo info1 = KWindowSystem::windowInfo(associatedWidget->winId(), NET::XAWMState | NET::WMState | NET::WMDesktop);
696 (event->type() == QEvent::WindowDeactivate || (event->type() == QEvent::MouseButtonRelease && static_cast<QMouseEvent*>(event)->button() == Qt::LeftButton))) {
773 statusNotifierWatcher = new org::kde::StatusNotifierWatcher(s_statusNotifierWatcherServiceName, "/StatusNotifierWatcher",
792 void KStatusNotifierItemPrivate::serviceChange(const QString &name, const QString &oldOwner, const QString &newOwner)
854 QObject::connect(systemTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), q, SLOT(legacyActivated(QSystemTrayIcon::ActivationReason)));
962 KWindowInfo info = KWindowSystem::windowInfo(associatedWidget->winId(), NET::WMDesktop | NET::WMFrameExtents);
void setText(const QString &text)
qint64 cacheKey() const
QString caption()
QString i18n(const char *text)
void setCategory(const ItemCategory category)
Sets the category for this icon, usually it's needed to call this function only once.
Definition: kstatusnotifieritem.cpp:134
QImage convertToFormat(Format format, QFlags< Qt::ImageConversionFlag > flags) const
indicates that a window should on top of most windows (but below fullscreen windows).
Definition: netwm_def.h:462
QString & append(QChar ch)
Definition: netwm_def.h:394
Type type() const
void setAttentionMovieByName(const QString &name)
Sets a movie as the requesting attention icon.
Definition: kstatusnotifieritem.cpp:299
Definition: kmessagebox.h:74
int width() const
int width() const
bool eventFilter(QObject *watched, QEvent *event)
Definition: kstatusnotifieritem.cpp:691
bool end()
void setOverlayIconByName(const QString &name)
Sets an icon to be used as overlay for the main one.
Definition: kstatusnotifieritem.cpp:212
void setIconByName(const QString &name)
Sets a new main icon for the system tray.
Definition: kstatusnotifieritem.cpp:172
NET::WindowType windowType(int supported_types) const
Returns the window type of this window (see NET::WindowType).
Definition: kwindowinfo_mac.cpp:210
Definition: netwm_def.h:386
QWidget * window() const
Definition: netwm_def.h:393
QRect frameGeometry() const
Returns the frame geometry of the window, i.e.
Definition: kwindowinfo_mac.cpp:283
QStringList findDirs(const char *type, const QString &reldir) const
bool standardActionsEnabled() const
Definition: kstatusnotifieritem.cpp:546
slightly larger small icons for toolbars, panels, etc
Definition: kiconloader.h:157
Definition: kstandardaction.h:130
Definition: netwm_def.h:642
icon
static KWindowInfo windowInfo(WId win, unsigned long properties, unsigned long properties2=0)
Returns information about window win.
Definition: kwindowsystem_mac.cpp:330
virtual void activate(const QPoint &pos=QPoint())
Shows the main widget and try to position it on top of the other windows, if the widget is already vi...
Definition: kstatusnotifieritem.cpp:569
KStandardDirs * dirs()
bool isEmpty() const
QString iconName() const
bool intersects(const QRect &rectangle) const
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
void setAssociatedWidget(QWidget *parent)
Sets the main widget associated with this StatusNotifierItem.
Definition: kstatusnotifieritem.cpp:471
virtual const QMetaObject * metaObject() const
Definition: netwm_def.h:385
bool hasState(unsigned long s) const
Returns true if the window has the given state flag set (see the NET::State enum for details)...
Definition: kwindowinfo_mac.cpp:180
KMenu * contextMenu() const
Access the context menu associated to this status notifier item.
Definition: kstatusnotifieritem.cpp:466
QDBusConnection sessionBus()
const KAboutData * aboutData() const
void setStandardActionsEnabled(bool enabled)
Sets whether to show the standard items in the menu, such as Quit.
Definition: kstatusnotifieritem.cpp:522
The application requests the attention of the user, for instance battery running out or a new IM mess...
Definition: kstatusnotifieritem.h:103
static void forceActiveWindow(WId win, long time=0)
Sets window win to be the active window.
Definition: kwindowsystem_mac.cpp:366
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QString toolTipIconName() const
QIcon attentionIconPixmap() const
Definition: kstatusnotifieritem.cpp:294
void ref()
void setToolTipIconByName(const QString &name)
Set a new icon for the toolTip.
Definition: kstatusnotifieritem.cpp:366
int x() const
int y() const
QPixmap pixmap(const QSize &size, Mode mode, State state) const
QWidget * associatedWidget() const
Access the main widget associated with this StatusNotifierItem.
Definition: kstatusnotifieritem.cpp:512
void setToolTip(const QString &iconName, const QString &title, const QString &subTitle)
Sets a new toolTip or this icon, a toolTip is composed of an icon, a title ad a text, all fields are optional.
Definition: kstatusnotifieritem.cpp:325
bool isMinimized() const
Returns true if the window is minimized.
Definition: kwindowinfo_mac.cpp:185
void setIconByPixmap(const QIcon &icon)
Sets a new main icon for the system tray.
Definition: kstatusnotifieritem.cpp:191
QIcon toolTipIconPixmap() const
Definition: kstatusnotifieritem.cpp:394
virtual bool event(QEvent *e)
void setToolTipIconByPixmap(const QIcon &icon)
Set a new icon for the toolTip.
Definition: kstatusnotifieritem.cpp:382
ItemCategory category() const
Definition: netwm_def.h:390
bool onAllDesktops() const
Returns true if the window is on all desktops (equal to desktop()==NET::OnAllDesktops).
Definition: kwindowinfo_mac.cpp:268
static void activateWindow(WId win, long time=0)
Requests that window win is activated.
Definition: kwindowsystem_mac.cpp:355
const char * name() const
NET::MappingState mappingState() const
Returns the mapping state of the window (see NET::MappingState).
Definition: kwindowinfo_mac.cpp:199
ItemCategory
Different kinds of applications announce their type to the systemtray, so can be drawn in a different...
Definition: kstatusnotifieritem.h:110
void deref()
void setToolTipSubTitle(const QString &subTitle)
Sets a new subtitle for the toolTip.
Definition: kstatusnotifieritem.cpp:417
void installEventFilter(QObject *filterObj)
Definition: netwm_def.h:388
void setOverlayIconByPixmap(const QIcon &icon)
Sets an icon to be used as overlay for the main one setOverlayIconByPixmap(QIcon()) will remove the o...
Definition: kstatusnotifieritem.cpp:237
QString overlayIconName() const
void setAttentionIconByPixmap(const QIcon &icon)
Sets the pixmap of the requesting attention icon.
Definition: kstatusnotifieritem.cpp:282
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
bool isEmpty() const
bool isEmpty() const
ItemStatus status() const
QIcon overlayIconPixmap() const
Definition: kstatusnotifieritem.cpp:259
void setStatus(const ItemStatus status)
Sets a new status for this icon.
Definition: kstatusnotifieritem.cpp:154
void setContextMenu(KMenu *menu)
Sets a new context menu for this StatusNotifierItem.
Definition: kstatusnotifieritem.cpp:432
virtual bool open(QFlags< QIODevice::OpenModeFlag > flags)
T & first()
The application is doing something, or it is important that the icon is always reachable from the use...
Definition: kstatusnotifieritem.h:100
static void setCurrentDesktop(int desktop)
Convenience function to set the current desktop to desktop.
Definition: kwindowsystem_mac.cpp:394
void setToolTipTitle(const QString &title)
Sets a new title for the toolTip.
Definition: kstatusnotifieritem.cpp:399
QString attentionMovieName() const
Definition: kstatusnotifieritem.cpp:318
const QByteArray & data() const
Definition: netwm_def.h:643
QString attentionIconName() const
Definition: netwm_def.h:634
int height() const
ItemStatus
All the possible status this icon can have, depending on the importance of the events that happens in...
Definition: kstatusnotifieritem.h:95
int numBytes() const
void setTitle(const QString &title)
Sets a title for this icon.
Definition: kstatusnotifieritem.cpp:149
void activateRequested(bool active, const QPoint &pos)
Inform the host application that an activation has been requested, for instance left mouse click...
QRect geometry() const
Returns the position and size of the window contents.
Definition: kwindowinfo_mac.cpp:278
QString programName() const
virtual void close()
KActionCollection * actionCollection() const
All the actions present in the menu.
Definition: kstatusnotifieritem.cpp:517
QString toolTipTitle() const
bool isNull() const
static void setOnAllDesktops(WId win, bool b)
Sets window win to be present on all virtual desktops if is true.
Definition: kwindowsystem_mac.cpp:400
Definition: netwm_def.h:387
int height() const
QPoint topLeft() const
const KComponentData & mainComponent()
QSize size() const
~KStatusNotifierItem()
Definition: kstatusnotifieritem.cpp:116
uchar * bits()
KDE Status notifier Item protocol implementation
Definition: kstatusnotifieritem.h:72
Definition: netwm_def.h:391
Definition: netwm_def.h:392
KStatusNotifierItem(QObject *parent=0)
Construct a new status notifier item.
Definition: kstatusnotifieritem.cpp:101
KAction * quit(const QObject *recvr, const char *slot, QObject *parent)
Quit the program.
Definition: kstandardaction.cpp:279
int desktop() const
Returns the virtual desktop this window is on (NET::OnAllDesktops if the window is on all desktops)...
Definition: kwindowinfo_mac.cpp:273
QImage toImage() const
bool isOnCurrentDesktop() const
Returns true if the window is on the currently active virtual desktop.
Definition: kwindowinfo_mac.cpp:258
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Definition: netwm_def.h:389
static const QString s_statusNotifierWatcherServiceName("org.kde.StatusNotifierWatcher")
static QList< WId > stackingOrder()
Returns the list of all toplevel windows currently managed by the window manager in the current stack...
Definition: kwindowsystem_mac.cpp:340
Definition: netwm_def.h:633
void showMessage(const QString &title, const QString &message, const QString &icon, int timeout=10000)
Shows the user a notification.
Definition: kstatusnotifieritem.cpp:551
QString toolTipSubTitle() const
Format format() const
static int warningContinueCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
Display a "warning" dialog.
Definition: kmessagebox.cpp:644
Definition: netwm_def.h:635
void setAttentionIconByName(const QString &name)
Sets a new icon that should be used when the application wants to request attention (usually the syst...
Definition: kstatusnotifieritem.cpp:266
QFuture< T > mapped(const Sequence &sequence, MapFunction function)
QString title() const
QAction * addTitle(const QString &text, QAction *before=0L)
Inserts a title item with no icon.
Definition: kmenu.cpp:170
Definition: netwm_def.h:648
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.