summaryrefslogtreecommitdiff
path: root/src/plugins/scxmleditor/plugin_interface/scxmltagutils.h
blob: 644ceab035b9e57787d54be075c49f724e2fd4f3 (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
// Copyright (C) 2016 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 "scxmltag.h"
#include <QMenu>
#include <QVector>

namespace ScxmlEditor {

namespace PluginInterface {

namespace TagUtils {

enum MenuAction {
    AddChild = 0,
    SetAsInitial,
    Relayout,
    ZoomToState,
    RemovePoint,
    Remove
};

bool checkPaste(const QString &copiedTagType, const ScxmlTag *currentTag);
QVector<TagType> allowedChildTypes(TagType tagType);
QVector<TagType> childTypes(TagType type);
void createChildMenu(const ScxmlTag *tag, QMenu *menu, bool addRemove = true);
void initChildMenu(TagType tagType, QMenu *menu);
ScxmlTag *findChild(const ScxmlTag *tag, TagType childType);
ScxmlTag *metadataTag(ScxmlTag *tag, const QString &tagname, bool blockUpdates = false);
void findAllChildren(const ScxmlTag *tag, QVector<ScxmlTag*> &children);
void findAllTransitionChildren(const ScxmlTag *tag, QVector<ScxmlTag*> &children);
void modifyPosition(ScxmlTag *tag, const QPointF &minPos, const QPointF &targetPos);

} // namespace TagUtils
} // namespace PluginInterface
} // namespace ScxmlEditor