+ }
+ if (!variant.isValid())
+ return MessageModelItem::data(column, role);
+ return variant;
+}
+
+
+QVariant ChatLineModelItem::timestampData(int role) const
+{
+ switch (role) {
+ case ChatLineModel::DisplayRole:
+ return _styledMsg.decoratedTimestamp();
+ case ChatLineModel::EditRole:
+ return _styledMsg.timestamp();
+ case ChatLineModel::BackgroundRole:
+ return backgroundBrush(UiStyle::FormatType::Timestamp);
+ case ChatLineModel::SelectedBackgroundRole:
+ return backgroundBrush(UiStyle::FormatType::Timestamp, true);
+ case ChatLineModel::FormatRole:
+ return QVariant::fromValue<UiStyle::FormatList>({std::make_pair(quint16{0}, UiStyle::Format{UiStyle::formatType(_styledMsg.type()) | UiStyle::FormatType::Timestamp, {}, {}})});
+ }
+ return QVariant();
+}
+
+
+QVariant ChatLineModelItem::senderData(int role) const
+{
+ switch (role) {
+ case ChatLineModel::DisplayRole:
+ return _styledMsg.decoratedSender();
+ case ChatLineModel::EditRole:
+ return _styledMsg.plainSender();
+ case ChatLineModel::BackgroundRole:
+ return backgroundBrush(UiStyle::FormatType::Sender);
+ case ChatLineModel::SelectedBackgroundRole:
+ return backgroundBrush(UiStyle::FormatType::Sender, true);
+ case ChatLineModel::FormatRole:
+ return QVariant::fromValue<UiStyle::FormatList>({std::make_pair(quint16{0}, UiStyle::Format{UiStyle::formatType(_styledMsg.type()) | UiStyle::FormatType::Sender, {}, {}})});
+ }
+ return QVariant();
+}
+
+
+QVariant ChatLineModelItem::contentsData(int role) const
+{
+ switch (role) {
+ case ChatLineModel::DisplayRole:
+ case ChatLineModel::EditRole:
+ return _styledMsg.plainContents();
+ case ChatLineModel::BackgroundRole:
+ return backgroundBrush(UiStyle::FormatType::Contents);
+ case ChatLineModel::SelectedBackgroundRole:
+ return backgroundBrush(UiStyle::FormatType::Contents, true);
+ case ChatLineModel::FormatRole:
+ return QVariant::fromValue<UiStyle::FormatList>(_styledMsg.contentsFormatList());
+ case ChatLineModel::WrapListRole:
+ if (_wrapList.isEmpty())
+ computeWrapList();
+ return QVariant::fromValue<ChatLineModel::WrapList>(_wrapList);