2023-02-23 19:46:41 +02:00
|
|
|
/*
|
|
|
|
* MapViewActions.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../../lib/int3.h"
|
2023-03-01 18:15:42 +02:00
|
|
|
#include "../gui/CIntObject.h"
|
2023-02-23 19:46:41 +02:00
|
|
|
|
|
|
|
class IMapRendererContext;
|
|
|
|
class MapViewModel;
|
|
|
|
class MapView;
|
|
|
|
|
|
|
|
class MapViewActions : public CIntObject
|
|
|
|
{
|
|
|
|
MapView & owner;
|
|
|
|
std::shared_ptr<MapViewModel> model;
|
|
|
|
std::shared_ptr<IMapRendererContext> context;
|
|
|
|
|
2023-07-16 11:00:40 +02:00
|
|
|
Point dragDistance;
|
2023-05-31 15:15:15 +02:00
|
|
|
double pinchZoomFactor;
|
|
|
|
|
2023-02-23 19:46:41 +02:00
|
|
|
void handleHover(const Point & cursorPosition);
|
|
|
|
|
|
|
|
public:
|
2023-03-01 18:15:42 +02:00
|
|
|
MapViewActions(MapView & owner, const std::shared_ptr<MapViewModel> & model);
|
2023-02-23 19:46:41 +02:00
|
|
|
|
|
|
|
void setContext(const std::shared_ptr<IMapRendererContext> & context);
|
|
|
|
|
2023-07-08 13:33:04 +02:00
|
|
|
void clickPressed(const Point & cursorPosition) override;
|
2023-07-16 11:00:40 +02:00
|
|
|
void clickReleased(const Point & cursorPosition) override;
|
|
|
|
void clickCancel(const Point & cursorPosition) override;
|
2023-07-08 13:33:04 +02:00
|
|
|
void showPopupWindow(const Point & cursorPosition) override;
|
2023-05-30 23:33:10 +02:00
|
|
|
void gesturePanning(const Point & initialPosition, const Point & currentPosition, const Point & lastUpdateDistance) override;
|
2023-05-31 15:15:15 +02:00
|
|
|
void gesturePinch(const Point & centerPosition, double lastUpdateFactor) override;
|
2023-02-23 19:46:41 +02:00
|
|
|
void hover(bool on) override;
|
2023-06-16 11:54:07 +02:00
|
|
|
void gesture(bool on, const Point & initialPosition, const Point & finalPosition) override;
|
2023-06-22 21:11:48 +02:00
|
|
|
void mouseMoved(const Point & cursorPosition, const Point & lastUpdateDistance) override;
|
2023-07-16 11:00:40 +02:00
|
|
|
void mouseDragged(const Point & cursorPosition, const Point & lastUpdateDistance) override;
|
2023-05-29 12:08:08 +02:00
|
|
|
void wheelScrolled(int distance) override;
|
2023-08-26 19:53:36 +02:00
|
|
|
|
|
|
|
bool dragActive;
|
2023-02-23 19:46:41 +02:00
|
|
|
};
|