1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 01:23:52 +00:00
openmw/apps/opencs/view/world/regionmap.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

96 lines
2.1 KiB
C++
Raw Normal View History

#ifndef CSV_WORLD_REGIONMAP_H
#define CSV_WORLD_REGIONMAP_H
2022-10-19 17:02:00 +00:00
#include <QModelIndexList>
#include <string>
#include <vector>
#include "./dragrecordtable.hpp"
class QAction;
2022-10-19 17:02:00 +00:00
class QContextMenuEvent;
class QDropEvent;
class QMouseEvent;
class QObject;
class QWidget;
namespace CSMDoc
{
class Document;
}
namespace CSMWorld
{
class UniversalId;
}
namespace CSVWorld
{
class RegionMap : public DragRecordTable
{
Q_OBJECT
QAction* mSelectAllAction;
QAction* mClearSelectionAction;
QAction* mSelectRegionsAction;
QAction* mCreateCellsAction;
QAction* mSetRegionAction;
QAction* mUnsetRegionAction;
2014-04-13 13:46:31 +00:00
QAction* mViewAction;
QAction* mViewInTableAction;
std::string mRegionId;
private:
void contextMenuEvent(QContextMenuEvent* event) override;
QModelIndexList getUnselectedCells() const;
///< \note Non-existent cells are not listed.
QModelIndexList getSelectedCells(bool existent = true, bool nonExistent = false) const;
///< \param existent Include existent cells.
/// \param nonExistent Include non-existent cells.
QModelIndexList getMissingRegionCells() const;
2016-12-14 15:39:33 +00:00
///< Unselected cells within all regions that have at least one selected cell.
void setRegion(const std::string& regionId);
///< Set region Id of selected cells.
void mouseMoveEvent(QMouseEvent* event) override;
void dragMoveEvent(QDragMoveEvent* event) override;
void dropEvent(QDropEvent* event) override;
2022-09-22 18:26:05 +00:00
public:
RegionMap(const CSMWorld::UniversalId& universalId, CSMDoc::Document& document, QWidget* parent = nullptr);
std::vector<CSMWorld::UniversalId> getDraggedRecords() const override;
signals:
void editRequest(const CSMWorld::UniversalId& id, const std::string& hint);
2014-04-13 13:46:31 +00:00
private slots:
void selectAll() override;
void clearSelection();
void selectRegions();
void createCells();
void setRegion();
void unsetRegion();
void view();
void viewInTable();
};
}
#endif