Files
qt5-legatus-legacy/Lts/Common/TopicEditorBase/topic_editor_utils.h
T
2026-08-13 18:33:10 +02:00

92 lines
2.0 KiB
C++
Executable File

#pragma once
#include <TopicEditorBase/topiceditorbase_export.h>
#include <LtsScriptTimeline/track_entry.h>
#include <QVector>
class QColor;
namespace TopicEditorBase
{
enum class TopicType
{
Invalid,
SituationMap,
SituationReplay, // Replay
Image,
Text,
Pdf,
Xml,
TacticalPlan, // Filter
MSOffice,
OpenOffice,
Audio,
Video,
Building,
SituationMapFilter, // Filter
Snapshot, // Replay
Evaluation,
Report,
Situation // Situation Replay including Situation and Filter Settings
};
typedef QVector<TopicType> TopicTypes;
TOPICEDITORBASE_EXPORT QString topicTypeTranslation(TopicType topicType);
TOPICEDITORBASE_EXPORT QString topicTypeString(TopicType topicType);
TOPICEDITORBASE_EXPORT TopicType topicTypeFromString(const QString &topicName);
TOPICEDITORBASE_EXPORT QIcon topicIcon(TopicType topicType);
TOPICEDITORBASE_EXPORT QColor topicTypeColor(TopicType topicType);
TOPICEDITORBASE_EXPORT std::ostream& operator<<(std::ostream& stream, TopicType topicType);
struct TOPICEDITORBASE_EXPORT TopicData
{
static const QString mime;
TopicType topicType{TopicType::Invalid};
int id{-1};
int startTime{-1};
int duration{0};
bool state{false};
int index{-1};
QJsonObject properties;
QString description;
QString channel;
QString parentChannel;
// relative position (in %)
double x{0.};
double y{0.};
double h{0.};
double w{0.};
TopicData() = default;
TopicData(const TopicData &data) = default;
explicit TopicData(TopicType topicType);
explicit TopicData(TopicType topicType, int duration);
explicit TopicData(
int id, TopicType topicType, int startTime, int duration, const QString &description, const QString &channel,
const QJsonObject &properties
);
void fromJson(const QJsonObject &obj);
QJsonObject toJson() const;
};
TOPICEDITORBASE_EXPORT QDataStream &operator<<(QDataStream &stream, const TopicData &data);
TOPICEDITORBASE_EXPORT QDataStream &operator>>(QDataStream &stream, TopicData &data);
} // namespace PresentationManagement