ACF $AcfVersion:0$
IShapeView.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// Qt includes
6#include <QtCore/QVector>
7
8// ACF includes
9#include <i2d/CRect.h>
10#include <i2d/CAffine2d.h>
11
12#include <iview/IDisplay.h>
13#include <iview/ISelectable.h>
15
16
17namespace iview
18{
19
20
21class IViewEventObserver;
22
23
28 virtual public IDisplay,
29 virtual public ISelectable
30{
31public:
33
37 virtual void AddViewEventObserver(iview::IViewEventObserver* listenerPtr) = 0;
38 virtual void RemoveViewEventObserver(iview::IViewEventObserver* listenerPtr) = 0;
39
43 virtual void SetFitArea(const i2d::CRectangle& area) = 0;
44
49 virtual void SetTransform(const i2d::CAffine2d& transform) = 0;
50
54 virtual void SetEditMode(int mode) = 0;
55
59 virtual void SetDisplayMode(int mode) = 0;
60
65 virtual bool IsViewDraggable() const = 0;
66
70 virtual bool IsMultiselectable() const = 0;
71
75 virtual void Update() = 0;
76
80 virtual void UpdateMousePointer() = 0;
81
90 virtual int InsertLayer(IViewLayer* layerPtr, int index = -1, int layerType = IViewLayer::LT_NONE) = 0;
91
96 virtual int GetLayerIndex(const IViewLayer& layer) const = 0;
97
102 virtual int GetLayerIndex(int layerType) const = 0;
103
107 virtual void RemoveLayer(int index) = 0;
108
112 virtual int GetLayersCount() const = 0;
113
117 virtual IViewLayer& GetLayer(int index) const = 0;
118
124 virtual bool ConnectShape(IShape* shapePtr) = 0;
125
130
134 virtual void OnLayerShapeFocused(IInteractiveShape* shapePtr, ISelectableLayer* layerPtr) = 0;
135
139 virtual void OnLayerShapeDefocused(IInteractiveShape* shapePtr, ISelectableLayer* layerPtr) = 0;
140
144 virtual void OnLayerInvalidated(const IViewLayer& layer, const i2d::CRect& prevArea, const i2d::CRect& newArea) = 0;
145};
146
147
148} // namespace iview
149
150
151
152
This class defines an affine 2D-transformation.
Definition CAffine2d.h:18
Simple rectangle with integer bounds.
Definition CRect.h:22
Definition of rectangle area orthogonal to axis of coordination system.
Definition CRectangle.h:27
Common interface for all display console shapes which can interacts with user.
Common interface for all display console shapes.
Definition IShape.h:32
Common interface for all objects informed about shapes state changes.
Common interface for a general shape view implementations.
Definition IShapeView.h:30
virtual ISelectableLayer * GetFocusedLayerPtr() const =0
Get focused layer.
virtual void OnLayerShapeDefocused(IInteractiveShape *shapePtr, ISelectableLayer *layerPtr)=0
Called when shape in layer loose focus.
virtual void SetTransform(const i2d::CAffine2d &transform)=0
Set a screen transformation.
virtual int GetLayerIndex(int layerType) const =0
Get index of layer by type.
virtual bool ConnectShape(IShape *shapePtr)=0
Connect shape object to view.
virtual void SetEditMode(int mode)=0
Changes the edit mode.
virtual void UpdateMousePointer()=0
Update mouse pointer.
virtual IViewLayer & GetLayer(int index) const =0
Get layer with the given index.
virtual void SetFitArea(const i2d::CRectangle &area)=0
Set area used for fitting of the view contents.
virtual bool IsViewDraggable() const =0
Check if is draggable mode.
virtual void AddViewEventObserver(iview::IViewEventObserver *listenerPtr)=0
Add/remove external event observers.
virtual int GetLayerIndex(const IViewLayer &layer) const =0
Get index of layer.
virtual void OnLayerShapeFocused(IInteractiveShape *shapePtr, ISelectableLayer *layerPtr)=0
Called when shape in layer get focus.
virtual void OnLayerInvalidated(const IViewLayer &layer, const i2d::CRect &prevArea, const i2d::CRect &newArea)=0
Inform that layer was invalidated.
virtual int InsertLayer(IViewLayer *layerPtr, int index=-1, int layerType=IViewLayer::LT_NONE)=0
Insert layer to view.
virtual void RemoveLayer(int index)=0
Remove layer from view.
virtual void RemoveViewEventObserver(iview::IViewEventObserver *listenerPtr)=0
virtual int GetLayersCount() const =0
Get count of layer in this view.
virtual void SetDisplayMode(int mode)=0
Changes the display mode.
virtual void Update()=0
Updates all invalidates shapes.
virtual bool IsMultiselectable() const =0
Check, if it is possible to select more than one shape.
IShapeObserver BaseClass
Definition IShapeView.h:32
Interface for external view event observer.
Interface for a logical layer in the console view.
Definition IViewLayer.h:27
@ LT_NONE
Layer type is not set.
Definition IViewLayer.h:34
In this library is defined 2D view concept and standard visualisation objects.