1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:49:56 +00:00
openmw-tes3mp/apps/opencs/model/world/tablemimedata.hpp

46 lines
1.5 KiB
C++
Raw Normal View History

#ifndef TABLEMIMEDATA_H
#define TABLEMIMEDATA_H
#include <vector>
2014-02-09 14:33:00 +00:00
#include <QtCore/QMimeData>
2014-02-04 10:40:48 +00:00
#include <QStringList>
#include "universalid.hpp"
2014-02-13 09:21:49 +00:00
#include "columnbase.hpp"
2014-02-04 10:40:48 +00:00
namespace CSMWorld
{
2014-02-14 13:04:36 +00:00
/// \brief Subclass of QmimeData, augmented to contain and transport UniversalIds.
///
/// This class provides way to construct mimedata object holding the universalid copy
/// Universalid is used in the majority of the tables to store type, id, argument types.
/// This way universalid grants a way to retrive record from the concrete table.
/// Please note, that tablemimedata object can hold multiple universalIds in the vector.
class TableMimeData : public QMimeData
{
public:
2014-02-04 10:40:48 +00:00
TableMimeData(UniversalId id);
TableMimeData(std::vector<UniversalId>& id);
~TableMimeData();
virtual QStringList formats() const;
std::string getIcon() const;
std::vector<UniversalId> getData() const;
2014-02-13 09:21:49 +00:00
bool holdsType(UniversalId::Type type) const;
bool holdsType(CSMWorld::ColumnBase::Display type) const;
2014-02-13 09:21:49 +00:00
UniversalId returnMatching(UniversalId::Type type) const;
UniversalId returnMatching(CSMWorld::ColumnBase::Display type) const;
private:
std::vector<UniversalId> mUniversalId;
QStringList mObjectsFormats;
2014-02-13 09:21:49 +00:00
CSMWorld::UniversalId::Type convertEnums(CSMWorld::ColumnBase::Display type) const;
};
}
2014-02-13 09:21:49 +00:00
#endif // TABLEMIMEDATA_H