| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef RS_EVENTHANDLER_H |
| | #define RS_EVENTHANDLER_H |
| |
|
| | #include <QObject> |
| |
|
| | #include "rs.h" |
| |
|
| | class LC_CoordinatesParser; |
| | class RS_ActionInterface; |
| | class QAction; |
| | class QMouseEvent; |
| | class QKeyEvent; |
| | class RS_CommandEvent; |
| | class RS_Vector; |
| | class RS_GraphicView; |
| |
|
| | struct RS_SnapMode; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | class RS_EventHandler : public QObject { |
| | Q_OBJECT |
| | public: |
| | explicit RS_EventHandler(RS_GraphicView* parent = 0); |
| | ~RS_EventHandler() override; |
| | void uncheckQAction(); |
| | void setQAction(QAction* action, bool forceKillOtherActions); |
| | QAction* getQAction(); |
| |
|
| | void back(); |
| | void enter(); |
| |
|
| | void mousePressEvent(QMouseEvent *e); |
| | void mouseReleaseEvent(QMouseEvent *e); |
| | void mouseMoveEvent(QMouseEvent *e); |
| | void mouseLeaveEvent(); |
| | void mouseEnterEvent(); |
| |
|
| | void keyPressEvent(QKeyEvent* e); |
| | void keyReleaseEvent(QKeyEvent* e); |
| |
|
| | void commandEvent(RS_CommandEvent* e); |
| | void enableCoordinateInput(); |
| | void disableCoordinateInput(); |
| |
|
| | void setDefaultAction(RS_ActionInterface* action); |
| | RS_ActionInterface* getDefaultAction() const; |
| |
|
| | bool setCurrentAction(std::shared_ptr<RS_ActionInterface> action); |
| | RS_ActionInterface* getCurrentAction(); |
| | bool isValid(RS_ActionInterface* action) const; |
| |
|
| | void killSelectActions(); |
| | void killAllActions(); |
| |
|
| | bool hasAction(); |
| | void cleanUp(); |
| | void debugActions() const; |
| | void setSnapMode(RS_SnapMode sm); |
| | void setSnapRestriction(RS2::SnapRestriction sr); |
| | |
| | bool inSelectionMode(); |
| |
|
| | void notifyLastActionFinished(); |
| | private: |
| | std::unique_ptr<LC_CoordinatesParser> m_coordinatesParser; |
| | RS_GraphicView* m_graphicView; |
| | QAction* m_QAction{nullptr}; |
| | std::shared_ptr<RS_ActionInterface> m_defaultAction{nullptr}; |
| | QList<std::shared_ptr<RS_ActionInterface>> m_currentActions; |
| | bool m_coordinateInputEnabled{true}; |
| | void checkLastActionCompletedAndUncheckQAction(const std::shared_ptr<RS_ActionInterface> &lastAction); |
| | }; |
| |
|
| | #endif |
| |
|