aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/formeditor/rotationindicator.h
blob: 49552ff25d727ba6eb17773e24a703ef6791d38f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once

#include "rotationcontroller.h"

#include <QHash>
#include <QPair>

namespace QmlDesigner {

class FormEditorItem;
class LayerItem;

class RotationIndicator
{
public:
    enum Orientation {
        Top = 1,
        Right = 2,
        Bottom = 4,
        Left = 8
    };

    explicit RotationIndicator(LayerItem *layerItem);
    ~RotationIndicator();

    void show();
    void hide();
    void clear();

    void setItems(const QList<FormEditorItem*> &itemList);
    void updateItems(const QList<FormEditorItem*> &itemList);

private:
    QHash<FormEditorItem*, RotationController> m_itemControllerHash;
    LayerItem *m_layerItem;
};

} // namespace QmlDesigner