2013-07-30 10:53:03 +00:00
|
|
|
#ifndef CSV_WORLD_REFERENCECREATOR_H
|
|
|
|
#define CSV_WORLD_REFERENCECREATOR_H
|
|
|
|
|
|
|
|
#include "genericcreator.hpp"
|
|
|
|
|
2015-06-19 08:50:02 +00:00
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class IdCompletionManager;
|
|
|
|
}
|
|
|
|
|
2015-06-25 08:20:35 +00:00
|
|
|
namespace CSVWidget
|
|
|
|
{
|
|
|
|
class DropLineEdit;
|
|
|
|
}
|
|
|
|
|
2013-07-30 10:53:03 +00:00
|
|
|
namespace CSVWorld
|
|
|
|
{
|
2015-06-19 08:50:02 +00:00
|
|
|
|
2013-07-30 10:53:03 +00:00
|
|
|
class ReferenceCreator : public GenericCreator
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2015-06-25 08:20:35 +00:00
|
|
|
CSVWidget::DropLineEdit *mCell;
|
2013-07-30 10:53:03 +00:00
|
|
|
std::string mId;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
virtual std::string getId() const;
|
|
|
|
|
|
|
|
virtual void configureCreateCommand (CSMWorld::CreateCommand& command) const;
|
|
|
|
|
2014-09-20 10:37:25 +00:00
|
|
|
virtual void pushCommand (std::auto_ptr<CSMWorld::CreateCommand> command,
|
2014-09-18 10:25:17 +00:00
|
|
|
const std::string& id);
|
|
|
|
|
2014-09-18 11:41:29 +00:00
|
|
|
int getRefNumCount() const;
|
|
|
|
|
2013-07-30 10:53:03 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
ReferenceCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
2015-06-19 08:50:02 +00:00
|
|
|
const CSMWorld::UniversalId& id, CSMWorld::IdCompletionManager &completionManager);
|
2013-07-30 10:53:03 +00:00
|
|
|
|
2014-09-18 10:25:17 +00:00
|
|
|
virtual void cloneMode(const std::string& originId,
|
2014-01-27 12:08:14 +00:00
|
|
|
const CSMWorld::UniversalId::Type type);
|
2014-01-27 18:40:05 +00:00
|
|
|
|
2013-07-30 10:53:03 +00:00
|
|
|
virtual void reset();
|
|
|
|
|
|
|
|
virtual std::string getErrors() const;
|
|
|
|
///< Return formatted error descriptions for the current state of the creator. if an empty
|
|
|
|
/// string is returned, there is no error.
|
|
|
|
|
2015-05-02 11:20:42 +00:00
|
|
|
/// Focus main input widget
|
|
|
|
virtual void focus();
|
|
|
|
|
2013-07-30 10:53:03 +00:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void cellChanged();
|
|
|
|
};
|
2015-06-19 08:50:02 +00:00
|
|
|
|
|
|
|
class ReferenceCreatorFactory : public CreatorFactoryBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual Creator *makeCreator (CSMDoc::Document& document, const CSMWorld::UniversalId& id) const;
|
|
|
|
///< The ownership of the returned Creator is transferred to the caller.
|
|
|
|
};
|
2013-07-30 10:53:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|