#pragma once #include #include #include class QColor; namespace TopicEditorBase { enum class TopicType { Invalid, SituationMap, SituationReplay, Image, Text, Pdf, Xml, TacticalPlan, MSOffice, OpenOffice, Audio, Video, Building, SituationMapFilter, Snapshot, Evaluation, Report, Situation }; typedef QVector 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; 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); }