summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/components/componentcore/actioninterface.h
blob: 9a8076d2d976481fe4fc6d7058278b8598b71676 (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
42
43
44
45
46
47
48
49
50
51
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "componentcore_constants.h"
#include "selectioncontext.h"

QT_BEGIN_NAMESPACE
class QAction;
QT_END_NAMESPACE

namespace QmlDesigner {

class QMLDESIGNERCOMPONENTS_EXPORT ActionInterface
{
public:
    enum Type {
        ContextMenu,
        ContextMenuAction,
        ToolBarAction,
        Action,
        FormEditorAction,
        Edit3DAction
    };

    enum Priorities {
        HighestPriority = ComponentCoreConstants::Priorities::Top,
        CustomActionsPriority = ComponentCoreConstants::Priorities::CustomActionsSection,
        RefactoringActionsPriority = ComponentCoreConstants::Priorities::Refactoring,
        LowestPriority = ComponentCoreConstants::Priorities::Last
    };

    enum class TargetView {
        Undefined,
        ConnectionEditor
    };

    virtual ~ActionInterface() = default;

    virtual QAction *action() const = 0;
    virtual QByteArray category() const = 0;
    virtual QByteArray menuId() const = 0;
    virtual int priority() const = 0;
    virtual Type type() const = 0;
    virtual void currentContextChanged(const SelectionContext &selectionState) = 0;
    virtual TargetView targetView() const { return TargetView::Undefined; }

};

} //QmlDesigner