mirror of https://github.com/Qortal/Brooklyn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1021 B
50 lines
1021 B
/* |
|
SPDX-FileCopyrightText: 2004 Esben Mose Hansen <[email protected]> |
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later |
|
*/ |
|
#pragma once |
|
|
|
#include <QMimeData> |
|
|
|
#include "historyitem.h" |
|
|
|
/** |
|
* A string entry in the clipboard history. |
|
*/ |
|
class HistoryStringItem : public HistoryItem |
|
{ |
|
public: |
|
explicit HistoryStringItem(const QString &data); |
|
~HistoryStringItem() override |
|
{ |
|
} |
|
|
|
HistoryItemType type() const override |
|
{ |
|
return HistoryItemType::Text; |
|
} |
|
|
|
QString text() const override; |
|
bool operator==(const HistoryItem &rhs) const override |
|
{ |
|
if (const HistoryStringItem *casted_rhs = dynamic_cast<const HistoryStringItem *>(&rhs)) { |
|
return casted_rhs->m_data == m_data; |
|
} |
|
return false; |
|
} |
|
QMimeData *mimeData() const override; |
|
|
|
/** |
|
* Write object on datastream |
|
*/ |
|
void write(QDataStream &stream) const override; |
|
|
|
private: |
|
QString m_data; |
|
}; |
|
|
|
inline QString HistoryStringItem::text() const |
|
{ |
|
return m_data; |
|
}
|
|
|