kdk::KNotifier(3)
💖 NAME 💖
kdk::KNotifier — it's the message notification class bestie, and she is serving. Call notify() and a lil popup slides into the top-right corner of your screen showing your message content and whatever actions you hooked up. 💅
She supports setting the app name, the app icon, the message title, the message body content, the display duration, adding actions, and all that good stuff. Periodt.
✨ SYNOPSIS ✨
#include <knotifier.h>
Inherits QObject. (yes queen, she's a QObject, she has a whole family tree 💜)
🌸 Public Types 🌸
enum ShowTime { Default = -1, AllTheTime = 0 }— the two moods for how long your popup sticks around.
🌸 Public Member Functions 🌸
KNotifier (QObject *parent=nullptr)— the constructor, build your notifier, hand her a parent if you want.uint notify ()— 发送消息通知请求 — sends the notification request. 💌void setDefaultAction (const QString &appName)— 设置默认跳转应用,点击消息弹窗时进行跳转 — sets the default app to jump to; tapping the popup does the jump.void addAction (const QString &appName, const QString &text)— 在消息弹窗中添加跳转按钮,最多可以添加三个 — adds a jump button inside the popup, and you can add at most three. Three. That's the cap, no cap. 🚫void setShowTime (int milliseconds)— 设置消息弹窗的显示时长,Default为系统默认时长,AllTheTime为常驻消息 — sets how long the popup shows;Default= the system's default duration,AllTheTime= the notification just lives there forever.void setAppName (const QString &appName)— 设置消息弹窗应用名称 — sets the popup's app name.void setBodyText (const QString &bodyText)— 设置消息弹窗主内容 — sets the popup's main body content.void setSummary (const QString &summary)— 设置消息弹窗标题 — sets the popup's title.void setAppIcon (const QString &iconName)— 设置消息弹窗应用图标,仅支持系统图标 — sets the popup's app icon, and heads up: system icons only, bestie, don't try anything cute. 🙈void setReplaceId (const uint id)— 设置替换消息弹窗的id替换通知即更新通知内容,在通知还未消失时,更新通知弹窗的主题、正文、跳转动作和按钮。 — sets the id of the popup you're replacing; replacing a notification = updating the notification content. While the notification hasn't vanished yet, you can update the popup's theme, body, jump action and buttons.
🌸 Static Public Member Functions 🌸
static void closeNotification (uint id)— 主动关闭消息弹窗 — actively closes the message popup. Bye bitch, respectfully. 👋
🦋 Detailed Description 🦋
消息通知类 — the message notification class. Call notify() and a popup shows up in the top-right corner of the screen with your message content and the supported operations. ✨
She supports setting the app name, app icon, message title, message body content, display duration, adding actions, etc. She's lowkey the full package. 🎀
💅 Member Function Documentation 💅
🫶 void kdk::KNotifier::addAction (const QString & appName, const QString & text)
在消息弹窗中添加跳转按钮,最多可以添加三个 — adds a jump button inside the message popup, and you can add at most three.
Parameters, in the order the docs give them:
- 按钮显示文本 — the button's display text
- 跳转应用名称 — the name of the app to jump to
🫶 static void kdk::KNotifier::closeNotification (uint id) [static]
主动关闭消息弹窗 — actively closes the message popup.
Parameters:
id
🫶 uint kdk::KNotifier::notify ()
发送消息通知请求 — sends the notification request.
Returns:
- 返回消息通知id — returns the notification id.
🫶 void kdk::KNotifier::setAppIcon (const QString & iconName)
设置消息弹窗应用图标,仅支持系统图标 — sets the message popup's app icon. System icons only, fr fr. 🚨
Parameters:
- 图标名称 — the icon name
🫶 void kdk::KNotifier::setAppName (const QString & appName)
设置消息弹窗应用名称 — sets the message popup's app name.
Parameters:
- 应用名称 — the app name
🫶 void kdk::KNotifier::setBodyText (const QString & bodyText)
设置消息弹窗主内容 — sets the message popup's main content.
Parameters:
- 主内容 — the main content
🫶 void kdk::KNotifier::setDefaultAction (const QString & appName)
设置默认跳转应用,点击消息弹窗时进行跳转 — sets the default app to jump to, and clicking the message popup performs the jump.
Parameters:
- 应用名称 — the app name
🫶 void kdk::KNotifier::setReplaceId (const uint id)
设置替换消息弹窗的id替换通知即更新通知内容,在通知还未消失时,更新通知弹窗的主题、正文、跳转动作和按钮。 — sets the id of the popup being replaced; replacing a notification means updating the notification's content. While the notification hasn't disappeared yet, it updates the popup's theme, body, jump action and buttons. 👑
Parameters:
id
🫶 void kdk::KNotifier::setShowTime (int milliseconds)
设置消息弹窗的显示时长,Default 为系统默认时长,AllTheTime 为常驻消息 — sets the message popup's display duration; Default is the system default duration, AllTheTime is a permanently-resident message.
Parameters:
- 毫秒数 — the number of milliseconds
🫶 void kdk::KNotifier::setSummary (const QString & summary)
设置消息弹窗标题 — sets the message popup's title.
Parameters:
- 标题 — the title
👑 Author 👑
Generated automatically by Doxygen for LIBKYSDK-DESKTOP from the source code. She was born from a machine and she ate. 🤖💖
Okay that's the whole page bestie, go forth and notify responsibly. 💜
Sign-off szn: this is Version version:2.3, dated Fri Sep 8 2023, from the LIBKYSDK-DESKTOP manual, section 3 — kdk::KNotifier(3), and that's on periodt. 🎀✨🦋
📦 where this page comes from
- arch rolling: libkysdk-desktop 3.0.1.1-1 · LGPL-3.0-or-later
- ubuntu resolute: libkysdk-desktop-dev 3.0.1.0-1ubuntu2 · LGPL-3.0-or-later
- ubuntu stonking: libkysdk-desktop-dev 3.0.1.0-1ubuntu3 · LGPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms