20#include <KNotification>
28void NotifyAction::setText(
const QString& text)
39QString NotifyAction::text()
const
45,m_defaultAction(nullptr)
61void Notify::appendAction(NotifyAction* action)
66int Notify::actionsCount()
const
68 return m_actions.
count();
71NotifyAction * Notify::action(
int index)
const
73 return m_actions.
at(index);
76void Notify::clearActions()
81void Notify::replaceAction(
int index, NotifyAction* action)
83 m_actions[index] = action;
86void Notify::removeLastAction()
113 reinterpret_cast< Notify*
>(
list->
data)->replaceAction(index, action);
146 notification->setComponentName (m_componentName);
147 notification->setText (m_message);
148 notification->setTitle (m_title);
149 notification->setIconName (m_iconName);
151 notification->setUrls (m_urls);
153 qDebug() << notification->eventId ();
164 notification->sendEvent();
167const QString &Notify::componentName()
const
169 return m_componentName;
172void Notify::setComponentName(
const QString &newComponentName)
174 if (m_componentName == newComponentName)
176 m_componentName = newComponentName;
177 Q_EMIT componentNameChanged(m_componentName);
180void Notify::actionActivated(
int index)
182 qDebug() <<
"notify action was activated at <<" << index;
188 if(index >= 1 && index-1 < m_actions.
count ())
190 Q_EMIT m_actions.
at (index-1)->triggered (
this);
194const QString &Notify::eventId()
const
199void Notify::setEventId(
const QString &newEventId)
201 m_eventId = newEventId;
204const QString &Notify::title()
const
209void Notify::setTitle(
const QString &newTitle)
211 if (m_title == newTitle)
214 Q_EMIT titleChanged(m_title);
217const QString &Notify::message()
const
222void Notify::setMessage(
const QString &newMessage)
224 if (m_message == newMessage)
226 m_message = newMessage;
227 Q_EMIT messageChanged(m_message);
230const QString &Notify::iconName()
const
235void Notify::setIconName(
const QString &newIconName)
237 if (m_iconName == newIconName)
239 m_iconName = newIconName;
240 Q_EMIT iconNameChanged(m_iconName);
243const QUrl &Notify::imageSource()
const
245 return m_imageSource;
248void Notify::setImageSource(
const QUrl &newImageSource)
250 if (m_imageSource == newImageSource)
252 m_imageSource = newImageSource;
253 Q_EMIT imageSourceChanged(m_imageSource);
256NotifyAction *Notify::defaultAction()
const
258 return m_defaultAction;
261void Notify::setDefaultAction(NotifyAction *newDefaultAction)
263 if (m_defaultAction == newDefaultAction)
265 m_defaultAction = newDefaultAction;
266 Q_EMIT defaulActionChanged();
276 if (m_urls == newUrls)
279 Q_EMIT urlsChanged(m_urls);
KIOCORE_EXPORT QStringList list(const QString &fileClass)
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
qsizetype count() const const
QString toString(FormattingOptions options) const const