aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scxmleditor/plugin_interface/eventitem.h
blob: cf8ff3a9e34152bbec53f99c3ee057870035eccb (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
41
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "baseitem.h"
#include "textitem.h"

namespace ScxmlEditor::PluginInterface {

class EventItem : public BaseItem
{
public:
    explicit EventItem(const QPointF &pos = QPointF(), BaseItem *parent = nullptr);

    void updateAttributes() override;
    void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override {}

private:
    TextItem *m_eventNameItem;
};

class OnEntryExitItem : public BaseItem
{
public:
    explicit OnEntryExitItem(BaseItem *parent = nullptr);

    int type() const override { return StateWarningType; }

    void updateAttributes() override;
    void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override {}
    void finalizeCreation() override;
    void addChild(ScxmlTag *tag) override;

    QRectF childBoundingRect() const;

private:
    TextItem *m_eventNameItem;
};

} // namespace ScxmlEditor::PluginInterface