mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 15:39:02 +00:00
77 lines
2.4 KiB
C++
77 lines
2.4 KiB
C++
#ifndef OPENCS_VIEW_PAGEDWORLDSPACEWIDGET_H
|
|
#define OPENCS_VIEW_PAGEDWORLDSPACEWIDGET_H
|
|
|
|
#include <map>
|
|
|
|
#include "../../model/world/cellselection.hpp"
|
|
|
|
#include "worldspacewidget.hpp"
|
|
#include "cell.hpp"
|
|
|
|
namespace CSVRender
|
|
{
|
|
class PagedWorldspaceWidget : public WorldspaceWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
CSMDoc::Document& mDocument;
|
|
CSMWorld::CellSelection mSelection;
|
|
std::map<CSMWorld::CellCoordinates, Cell *> mCells;
|
|
std::string mWorldspace;
|
|
|
|
private:
|
|
|
|
std::pair<int, int> getCoordinatesFromId(const std::string& record) const;
|
|
|
|
/// Bring mCells into sync with mSelection again.
|
|
///
|
|
/// \return Any cells added or removed?
|
|
bool adjustCells();
|
|
|
|
virtual void referenceableDataChanged (const QModelIndex& topLeft,
|
|
const QModelIndex& bottomRight);
|
|
|
|
virtual void referenceableAboutToBeRemoved (const QModelIndex& parent, int start, int end);
|
|
|
|
virtual void referenceableAdded (const QModelIndex& index, int start, int end);
|
|
|
|
virtual void referenceDataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
|
|
|
virtual void referenceAboutToBeRemoved (const QModelIndex& parent, int start, int end);
|
|
|
|
virtual void referenceAdded (const QModelIndex& index, int start, int end);
|
|
|
|
public:
|
|
|
|
PagedWorldspaceWidget (QWidget *parent, CSMDoc::Document& document);
|
|
///< \note Sets the cell area selection to an invalid value to indicate that currently
|
|
/// no cells are displayed. The cells to be displayed will be specified later through
|
|
/// hint system.
|
|
|
|
virtual ~PagedWorldspaceWidget();
|
|
|
|
void useViewHint (const std::string& hint);
|
|
|
|
void setCellSelection (const CSMWorld::CellSelection& selection);
|
|
|
|
virtual void handleDrop(const std::vector<CSMWorld::UniversalId>& data);
|
|
|
|
virtual dropRequirments getDropRequirements(dropType type) const;
|
|
|
|
signals:
|
|
|
|
void cellSelectionChanged (const CSMWorld::CellSelection& selection);
|
|
|
|
private slots:
|
|
|
|
virtual void cellDataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
|
|
|
virtual void cellRemoved (const QModelIndex& parent, int start, int end);
|
|
|
|
virtual void cellAdded (const QModelIndex& index, int start, int end);
|
|
|
|
};
|
|
}
|
|
|
|
#endif
|