ACF $AcfVersion:0$
ISelectableLayer.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
6#include <i2d/CVector2d.h>
7
8#include <iview/IViewLayer.h>
9#include <iview/ISelectable.h>
10#include <iview/IDraggable.h>
12
13
14namespace iview
15{
16
17
18class IInteractiveShape;
19
20
22 virtual public IViewLayer,
23 virtual public ISelectable,
24 virtual public IDraggable
25{
26public:
30 virtual bool ConnectInteractiveShape(IInteractiveShape* shapePtr) = 0;
31
35 virtual int GetUnselectedShapesCount() const = 0;
36
40 virtual void DrawFocusedShape(QPainter& drawContext) = 0;
41
46 virtual bool OnKeyPress(int key, Qt::KeyboardModifiers modifiers) = 0;
47
52 virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) = 0;
53
58 virtual bool OnFocusedMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) = 0;
59
64 virtual bool OnFocusedMouseMove(istd::CIndex2d position) = 0;
65
72 virtual TouchState IsTouched(istd::CIndex2d position, IInteractiveShape** shapePtrPtr = NULL) const = 0;
73
74 // reimplemented (iview::ITouchable)
75 virtual TouchState IsTouched(istd::CIndex2d position) const override;
76};
77
78
79// inline methods
80
81// reimplemented (iview::ITouchable)
82
84{
85 return IsTouched(position, NULL);
86}
87
88
89} // namespace iview
90
91
92
93
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:21
Common interface for all, you can drag.
Definition IDraggable.h:18
Common interface for all display console shapes which can interacts with user.
virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag)=0
Called, when mouse button was pushed down or up.
virtual bool OnFocusedMouseMove(istd::CIndex2d position)=0
Called, when this layer has focus, and mouse was moved.
virtual int GetUnselectedShapesCount() const =0
Get number of unselected shapes.
virtual bool OnFocusedMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag)=0
Called, when this layer has focus, and mouse button was pushed down or up on this object.
virtual bool OnKeyPress(int key, Qt::KeyboardModifiers modifiers)=0
Called, when key has been pressed.
virtual TouchState IsTouched(istd::CIndex2d position, IInteractiveShape **shapePtrPtr=NULL) const =0
Check, if any shape is touched.
virtual bool ConnectInteractiveShape(IInteractiveShape *shapePtr)=0
Connect active shape object.
virtual void DrawFocusedShape(QPainter &drawContext)=0
Draw only focused shape.
TouchState
Enumeration for possible shape touch states.
Definition ITouchable.h:25
Interface for a logical layer in the console view.
Definition IViewLayer.h:27
#define NULL
Definition istd.h:74
In this library is defined 2D view concept and standard visualisation objects.