122 lines
2.4 KiB
C++
122 lines
2.4 KiB
C++
|
|
|
|
#pragma once
|
|
|
|
#include "lts_widgets_export.h"
|
|
|
|
#include <QEvent>
|
|
#include <QObject>
|
|
#include <QPixmap>
|
|
#include <QPointer>
|
|
#include <QUrl>
|
|
#include <QWidget>
|
|
|
|
namespace LtsWidgets
|
|
{
|
|
class LTSWIDGETS_EXPORT LtsLinkEvent : public QEvent
|
|
{
|
|
public:
|
|
explicit LtsLinkEvent(QUrl url, QWidget* sourceBaseLayoutWidget)
|
|
: QEvent(eventTypeId()), m_url(std::move(url)), m_sourceBaseLayoutWidget(sourceBaseLayoutWidget)
|
|
{
|
|
}
|
|
|
|
static QEvent::Type eventTypeId();
|
|
|
|
QWidget* sourceBaseLayoutWidget() const
|
|
{
|
|
return m_sourceBaseLayoutWidget.data();
|
|
}
|
|
|
|
QUrl url() const
|
|
{
|
|
return m_url;
|
|
}
|
|
|
|
private:
|
|
QUrl m_url;
|
|
QPointer<QWidget> m_sourceBaseLayoutWidget;
|
|
};
|
|
|
|
class LTSWIDGETS_EXPORT SaveImageEvent : public QEvent
|
|
{
|
|
public:
|
|
SaveImageEvent(QWidget* w, QPixmap&& pm) : QEvent(saveImageEventId()), m_widget(w), m_pix(std::move(pm)) {}
|
|
|
|
const QPixmap& pixmap() const
|
|
{
|
|
return m_pix;
|
|
}
|
|
|
|
QWidget* widget() const
|
|
{
|
|
return m_widget.data();
|
|
}
|
|
|
|
static QEvent::Type saveImageEventId();
|
|
|
|
private:
|
|
QPointer<QWidget> m_widget;
|
|
QPixmap m_pix;
|
|
};
|
|
|
|
class LTSWIDGETS_EXPORT AddMarkerEvent : public QEvent
|
|
{
|
|
public:
|
|
AddMarkerEvent() : QEvent(addMarkerEventId()) {}
|
|
|
|
static QEvent::Type addMarkerEventId();
|
|
};
|
|
|
|
class LTSWIDGETS_EXPORT SetMarkerEvent : public QEvent
|
|
{
|
|
public:
|
|
SetMarkerEvent(const QString& description) : QEvent(setMarkerEventId()), m_description(description) {}
|
|
|
|
const QString& getDescription() const
|
|
{
|
|
return m_description;
|
|
}
|
|
|
|
void setDescription(const QString& description)
|
|
{
|
|
m_description = description;
|
|
}
|
|
|
|
static QEvent::Type setMarkerEventId();
|
|
|
|
private:
|
|
QString m_description;
|
|
};
|
|
|
|
class LTSWIDGETS_EXPORT AddSnapshotEvent : public QEvent
|
|
{
|
|
public:
|
|
AddSnapshotEvent() : QEvent(addSnapshotEventId()) {}
|
|
|
|
static QEvent::Type addSnapshotEventId();
|
|
};
|
|
|
|
class LTSWIDGETS_EXPORT SaveSnapshotEvent : public QEvent
|
|
{
|
|
public:
|
|
SaveSnapshotEvent(const QString& description) : QEvent(saveSnapshotEventId()), m_description(description) {}
|
|
|
|
const QString& getDescription() const
|
|
{
|
|
return m_description;
|
|
}
|
|
|
|
void setDescription(const QString& description)
|
|
{
|
|
m_description = description;
|
|
}
|
|
|
|
static QEvent::Type saveSnapshotEventId();
|
|
|
|
private:
|
|
QString m_description;
|
|
};
|
|
|
|
} // namespace LtsWidgets
|