1 #ifndef STATUSPROVIDER_H 2 #define STATUSPROVIDER_H 24 bool hasNotifications()
const;
25 bool hasCriticalNotifications()
const;
27 const std::string ¤tStatus()
const;
28 double currentPercentage()
const;
30 void unregisterCallback(
size_t id);
31 void unregisterAllCallbacks();
35 bool isAborted()
const;
36 void invalidateStatus();
37 void invalidateNotifications();
38 void updateStatus(
const std::string &status);
39 void updateStatus(
const std::string &status,
double percentage);
40 void updatePercentage(
double percentage);
42 void addNotification(
NotificationType type,
const std::string &message,
const std::string &context);
44 void addNotifications(
const std::string &higherContext,
const StatusProvider &from);
51 inline void invokeCallbacks();
81 m_percentage = percentage;
92 m_percentage = percentage;
111 return m_notifications;
119 return !m_notifications.empty();
135 return m_worstNotificationType;
143 if(m_status.empty() && m_forward) {
154 if(m_percentage == 0.0 && m_forward) {
168 return m_abort || (m_forward && m_forward->
isAborted());
179 if(
id < m_callbacks.size()) {
180 m_callbacks[id] =
nullptr;
254 m_notifications.clear();
261 inline void StatusProvider::invokeCallbacks()
273 inline void StatusProvider::updateWorstNotificationType(
NotificationType notificationType)
275 if(static_cast<int>(m_worstNotificationType) < static_cast<int>(notificationType)) {
276 m_worstNotificationType = notificationType;
286 void StatusProvider::transferNotifications(StatusProvider &from)
288 m_notifications.splice(m_notifications.end(), from.m_notifications);
289 m_worstNotificationType |= from.worstNotificationType();
295 #endif // STATUSPROVIDER_H
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.