refactor: Move Message type enum to separate header

This commit is contained in:
Petr Mironychev
2025-09-30 19:37:28 +02:00
parent f8b87da2ca
commit 8aa37c5c8c
5 changed files with 48 additions and 22 deletions

View File

@ -19,33 +19,24 @@
#pragma once
#include <qobject.h>
#include <qqmlintegration.h>
#include <QObject>
#include <QtQmlIntegration>
#include "ChatData.hpp"
namespace QodeAssist::Chat {
Q_NAMESPACE
class MessagePart
{
Q_GADGET
Q_PROPERTY(PartType type MEMBER type CONSTANT FINAL)
Q_PROPERTY(MessagePartType type MEMBER type CONSTANT FINAL)
Q_PROPERTY(QString text MEMBER text CONSTANT FINAL)
Q_PROPERTY(QString language MEMBER language CONSTANT FINAL)
QML_VALUE_TYPE(messagePart)
public:
enum PartType { Code, Text };
Q_ENUM(PartType)
PartType type;
MessagePartType type;
QString text;
QString language;
};
class MessagePartType : public MessagePart
{
Q_GADGET
};
QML_NAMED_ELEMENT(MessagePart)
QML_FOREIGN_NAMESPACE(QodeAssist::Chat::MessagePartType)
} // namespace QodeAssist::Chat