60 lines
1.5 KiB
C++
Executable File
60 lines
1.5 KiB
C++
Executable File
// TODO: hdr
|
|
|
|
#pragma once
|
|
|
|
#include "lts_notification_export.h"
|
|
|
|
#include <QList>
|
|
#include <QObject>
|
|
#include <memory>
|
|
#include <functional>
|
|
|
|
|
|
namespace LtsSession
|
|
{
|
|
class LtsSession;
|
|
}
|
|
|
|
|
|
namespace LtsNotification
|
|
{
|
|
class LtsNotificationController;
|
|
|
|
/**
|
|
* @brief The LtsNotification class provides a Notification Icon which is automatically added, when created, to (and deleted from) the BaseLayout.
|
|
* >>> !! Do not use by yourself! Call 'createNotification' from LtsSession to create a new LtsNotification !! <<<
|
|
*/
|
|
class LTSNOTIFICATION_EXPORT LtsNotification : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
// Attn: LtsNotification takes ownership of ctl!
|
|
explicit LtsNotification(LtsNotificationController *ctl);
|
|
~LtsNotification();
|
|
|
|
void setIcon(const QIcon &icon);
|
|
void setAction(const std::function<void(void)> &action);
|
|
void setToolTip(const QString &toolTip);
|
|
void setCount(const int count);
|
|
void setEnabled(bool enable);
|
|
void setBackground(const int r, const int g, const int b);
|
|
|
|
const QString &tooltip() const;
|
|
|
|
// TODO: add these
|
|
// void setVisible();
|
|
// void setMenu();
|
|
|
|
private:
|
|
LtsNotificationController *m_controller; // TODO: connect to destroyed to set this to nullptr ! but needed?
|
|
//QList<LtsNotificationIconWidget *> m_notiList; // all notis on all blws of one session
|
|
//LtsSession::LtsSession *m_session; // the selected session FIXME: ShdPtr ?! but there can't be a LNI without a Session, so I think this is okay
|
|
|
|
private slots:
|
|
void slotCtlDestroyed(QObject *obj);
|
|
|
|
};
|
|
|
|
} // namespace LtsWidgets
|