1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 21:23:52 +00:00
openmw/apps/opencs/view/render/editmode.hpp

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

107 lines
3.1 KiB
C++
Raw Normal View History

#ifndef CSV_RENDER_EDITMODE_H
#define CSV_RENDER_EDITMODE_H
#include <osg/ref_ptr>
#include "../widget/modebutton.hpp"
class QDragEnterEvent;
class QDropEvent;
class QDragMoveEvent;
class QPoint;
namespace CSVRender
{
class WorldspaceWidget;
struct WorldspaceHitResult;
class TagBase;
class EditMode : public CSVWidget::ModeButton
{
Q_OBJECT
WorldspaceWidget* mWorldspaceWidget;
unsigned int mMask;
protected:
WorldspaceWidget& getWorldspaceWidget();
2022-09-22 18:26:05 +00:00
public:
EditMode(WorldspaceWidget* worldspaceWidget, const QIcon& icon, unsigned int mask, const QString& tooltip = "",
QWidget* parent = nullptr);
unsigned int getInteractionMask() const;
2020-11-13 07:39:47 +00:00
void activate(CSVWidget::SceneToolbar* toolbar) override;
/// Default-implementation: Ignored.
virtual void setEditLock(bool locked);
/// Default-implementation: Ignored.
virtual void primaryOpenPressed(const WorldspaceHitResult& hit);
/// Default-implementation: Ignored.
virtual void primaryEditPressed(const WorldspaceHitResult& hit);
/// Default-implementation: Ignored.
virtual void secondaryEditPressed(const WorldspaceHitResult& hit);
/// Default-implementation: Ignored.
virtual void primarySelectPressed(const WorldspaceHitResult& hit);
/// Default-implementation: Ignored.
virtual void secondarySelectPressed(const WorldspaceHitResult& hit);
/// Default-implementation: ignore and return false
2022-09-22 18:26:05 +00:00
///
/// \return Drag accepted?
virtual bool primaryEditStartDrag(const QPoint& pos);
/// Default-implementation: ignore and return false
2022-09-22 18:26:05 +00:00
///
/// \return Drag accepted?
virtual bool secondaryEditStartDrag(const QPoint& pos);
2015-10-01 10:46:01 +00:00
/// Default-implementation: ignore and return false
///
/// \return Drag accepted?
virtual bool primarySelectStartDrag(const QPoint& pos);
2015-10-01 10:46:01 +00:00
/// Default-implementation: ignore and return false
///
/// \return Drag accepted?
virtual bool secondarySelectStartDrag(const QPoint& pos);
2015-10-01 10:46:01 +00:00
/// Default-implementation: ignored
virtual void drag(const QPoint& pos, int diffX, int diffY, double speedFactor);
/// Default-implementation: ignored
virtual void dragCompleted(const QPoint& pos);
2015-10-01 10:46:01 +00:00
/// Default-implementation: ignored
2022-09-22 18:26:05 +00:00
///
/// \note dragAborted will not be called, if the drag is aborted via changing
/// editing mode
virtual void dragAborted();
2015-10-01 10:46:01 +00:00
/// Default-implementation: ignored
virtual void dragWheel(int diff, double speedFactor);
2015-10-01 10:46:01 +00:00
/// Default-implementation: ignored
void dragEnterEvent(QDragEnterEvent* event) override;
/// Default-implementation: ignored
2015-10-01 11:42:21 +00:00
void dropEvent(QDropEvent* event) override;
/// Default-implementation: ignored
void dragMoveEvent(QDragMoveEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override;
2016-03-01 14:48:34 +00:00
/// Default: return -1
virtual int getSubMode() const;
};
}
#endif