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);
325void KStatusNotifierItem::setToolTip(const QString &iconName, const QString &title, const QString &subTitle)
345void KStatusNotifierItem::setToolTip(const QIcon &icon, const QString &title, const QString &subTitle)
551void 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",
792void 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);
QString programName() const
const KAboutData * aboutData() const
QAction * addTitle(const QString &text, QAction *before=0L)
Inserts a title item with no icon.
Definition: kmenu.cpp:170
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
QStringList findDirs(const char *type, const QString &reldir) const
KDE Status notifier Item protocol implementation
Definition: kstatusnotifieritem.h:73
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
void setAssociatedWidget(QWidget *parent)
Sets the main widget associated with this StatusNotifierItem.
Definition: kstatusnotifieritem.cpp:471
void setStatus(const ItemStatus status)
Sets a new status for this icon.
Definition: kstatusnotifieritem.cpp:154
KActionCollection * actionCollection() const
All the actions present in the menu.
Definition: kstatusnotifieritem.cpp:517
bool eventFilter(QObject *watched, QEvent *event)
Definition: kstatusnotifieritem.cpp:691
QIcon overlayIconPixmap() const
Definition: kstatusnotifieritem.cpp:259
ItemCategory
Different kinds of applications announce their type to the systemtray, so can be drawn in a different...
Definition: kstatusnotifieritem.h:110
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
void activateRequested(bool active, const QPoint &pos)
Inform the host application that an activation has been requested, for instance left mouse click,...
void setToolTipIconByName(const QString &name)
Set a new icon for the toolTip.
Definition: kstatusnotifieritem.cpp:366
void setToolTipSubTitle(const QString &subTitle)
Sets a new subtitle for the toolTip.
Definition: kstatusnotifieritem.cpp:417
~KStatusNotifierItem()
Definition: kstatusnotifieritem.cpp:116
ItemStatus
All the possible status this icon can have, depending on the importance of the events that happens in...
Definition: kstatusnotifieritem.h:95
@ Active
The application is doing something, or it is important that the icon is always reachable from the use...
Definition: kstatusnotifieritem.h:100
@ NeedsAttention
The application requests the attention of the user, for instance battery running out or a new IM mess...
Definition: kstatusnotifieritem.h:103
KMenu * contextMenu() const
Access the context menu associated to this status notifier item.
Definition: kstatusnotifieritem.cpp:466
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,...
Definition: kstatusnotifieritem.cpp:325
void setStandardActionsEnabled(bool enabled)
Sets whether to show the standard items in the menu, such as Quit.
Definition: kstatusnotifieritem.cpp:522
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
QWidget * associatedWidget() const
Access the main widget associated with this StatusNotifierItem.
Definition: kstatusnotifieritem.cpp:512
void setContextMenu(KMenu *menu)
Sets a new context menu for this StatusNotifierItem.
Definition: kstatusnotifieritem.cpp:432
void showMessage(const QString &title, const QString &message, const QString &icon, int timeout=10000)
Shows the user a notification.
Definition: kstatusnotifieritem.cpp:551
void setIconByName(const QString &name)
Sets a new main icon for the system tray.
Definition: kstatusnotifieritem.cpp:172
QIcon toolTipIconPixmap() const
Definition: kstatusnotifieritem.cpp:394
void setIconByPixmap(const QIcon &icon)
Sets a new main icon for the system tray.
Definition: kstatusnotifieritem.cpp:191
QIcon attentionIconPixmap() const
Definition: kstatusnotifieritem.cpp:294
QString attentionMovieName() const
Definition: kstatusnotifieritem.cpp:318
KStatusNotifierItem(QObject *parent=0)
Construct a new status notifier item.
Definition: kstatusnotifieritem.cpp:101
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
void setAttentionMovieByName(const QString &name)
Sets a movie as the requesting attention icon.
Definition: kstatusnotifieritem.cpp:299
void setTitle(const QString &title)
Sets a title for this icon.
Definition: kstatusnotifieritem.cpp:149
void setAttentionIconByPixmap(const QIcon &icon)
Sets the pixmap of the requesting attention icon.
Definition: kstatusnotifieritem.cpp:282
void setToolTipTitle(const QString &title)
Sets a new title for the toolTip.
Definition: kstatusnotifieritem.cpp:399
bool standardActionsEnabled() const
Definition: kstatusnotifieritem.cpp:546
void setOverlayIconByName(const QString &name)
Sets an icon to be used as overlay for the main one.
Definition: kstatusnotifieritem.cpp:212
void setToolTipIconByPixmap(const QIcon &icon)
Set a new icon for the toolTip.
Definition: kstatusnotifieritem.cpp:382
NET::WindowType windowType(int supported_types) const
Returns the window type of this window (see NET::WindowType).
Definition: kwindowinfo_mac.cpp:210
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
bool isOnCurrentDesktop() const
Returns true if the window is on the currently active virtual desktop.
Definition: kwindowinfo_mac.cpp:258
bool onAllDesktops() const
Returns true if the window is on all desktops (equal to desktop()==NET::OnAllDesktops).
Definition: kwindowinfo_mac.cpp:268
QRect geometry() const
Returns the position and size of the window contents.
Definition: kwindowinfo_mac.cpp:278
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
NET::MappingState mappingState() const
Returns the mapping state of the window (see NET::MappingState).
Definition: kwindowinfo_mac.cpp:199
QRect frameGeometry() const
Returns the frame geometry of the window, i.e.
Definition: kwindowinfo_mac.cpp:283
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
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
static void activateWindow(WId win, long time=0)
Requests that window win is activated.
Definition: kwindowsystem_mac.cpp:355
static KWindowInfo windowInfo(WId win, unsigned long properties, unsigned long properties2=0)
Returns information about window win.
Definition: kwindowsystem_mac.cpp:330
static void setCurrentDesktop(int desktop)
Convenience function to set the current desktop to desktop.
Definition: kwindowsystem_mac.cpp:394
static void forceActiveWindow(WId win, long time=0)
Sets window win to be the active window.
Definition: kwindowsystem_mac.cpp:366
@ KeepAbove
indicates that a window should on top of most windows (but below fullscreen windows).
Definition: netwm_def.h:462
#define kDebug
int timeout
QString i18n(const char *text)
static const QString s_statusNotifierWatcherServiceName("org.kde.StatusNotifierWatcher")
const KComponentData & mainComponent()
KStandardDirs * dirs()
void deref()
void ref()
QString caption()
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
KAction * quit(const QObject *recvr, const char *slot, QObject *parent)
Quit the program.
Definition: kstandardaction.cpp:279
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
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
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.