/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsmapmouseevent.h                                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsMapMouseEvent : QMouseEvent
{
%Docstring(signature="appended")
A :py:class:`QgsMapMouseEvent` is the result of a user interaction with
the mouse on a :py:class:`QgsMapCanvas`. It is sent whenever the user
moves, clicks, releases or double clicks the mouse. In addition to the
coordinates in pixel space it also knows the coordinates in the
mapcanvas' CRS as well as it knows the concept of snapping.
%End

%TypeHeaderCode
#include "qgsmapmouseevent.h"
%End
%ConvertToSubClassCode
    if ( dynamic_cast<QgsMapMouseEvent *>( sipCpp ) )
      sipType = sipType_QgsMapMouseEvent;
    else
      sipType = 0;
%End
  public:
    QgsMapMouseEvent( QgsMapCanvas *mapCanvas, QMouseEvent *event );
%Docstring
Creates a new QgsMapMouseEvent. Should only be required to be called
from the QgsMapCanvas.

:param mapCanvas: The map canvas on which the event occurred
:param event: The original mouse event
%End

    QgsMapMouseEvent( QgsMapCanvas *mapCanvas, QEvent::Type type, QPoint pos, Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = Qt::NoButton, Qt::KeyboardModifiers modifiers = Qt::NoModifier );
%Docstring
Creates a new QgsMapMouseEvent. Should only be required to be called
from the QgsMapCanvas.

:param mapCanvas: The map canvas on which the event occurred
:param type: The type of the event
:param pos: The pixel position of the mouse
:param button: The pressed button
:param buttons: Further buttons that are pressed
:param modifiers: Keyboard modifiers
%End

    QgsPointXY snapPoint();
%Docstring
snapPoint will snap the points using the map canvas snapping utils
configuration

.. note::

   if snapping did not succeeded, the map point will be reset to its original position
%End

    bool isSnapped() const;
%Docstring
Returns ``True`` if there is a snapped point cached. Will only be useful
after snapPoint has previously been called.

:return: ``True`` if there is a snapped point cached.
%End

    QgsPointXY mapPoint() const;
%Docstring
mapPoint returns the point in coordinates

:return: the point in map coordinates, after snapping if requested in
         the event.
%End

    QgsPointLocator::Match mapPointMatch() const;
%Docstring
Returns the matching data from the most recently snapped point.

:return: the snapping data structure

.. note::

   This method returns the most recent snap match. It must
   follow a call to :py:func:`~QgsMapMouseEvent.snapPoint` in order to have a recent snap result available.
%End

    void setMapPoint( const QgsPointXY &point );
%Docstring
Set the (snapped) point this event points to in map coordinates. The
point in pixel coordinates will be calculated accordingly.

:param point: The point in map coordinates
%End

    QgsPointXY originalMapPoint() const;
%Docstring
Returns the original, unmodified map point of the mouse cursor.

:return: The cursor position in map coordinates.
%End

    QPoint pixelPoint() const;
%Docstring
The snapped mouse cursor in pixel coordinates.

:return: The snapped mouse cursor position in pixel coordinates.
%End

    QPoint originalPixelPoint() const;
%Docstring
The unsnapped, real mouse cursor position in pixel coordinates. Alias to
:py:func:`~QgsMapMouseEvent.pos`

:return: Mouse position in pixel coordinates
%End

    void snapToGrid( double precision, const QgsCoordinateReferenceSystem &crs );
%Docstring
Snaps the mapPoint to a grid with the given ``precision``. The snapping
will be done in the specified ``crs``. If this crs is different from the
mapCanvas crs, it will be reprojected on the fly.

.. versionadded:: 3.4
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsmapmouseevent.h                                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/
