aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/designer/editorwidget.h
blob: b367def96f950db2cd9c201d4e1c4b78e9b2914d (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
52
53
54
55
56
// 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 "designerconstants.h"

#include <utils/fancymainwindow.h>

QT_BEGIN_NAMESPACE
class QDesignerFormWindowInterface;
QT_END_NAMESPACE

namespace SharedTools { class WidgetHost; }
namespace Core {
class EditorToolBar;
class IEditor;
} // namespace Core

namespace Designer {

class FormWindowEditor;

namespace Internal {

class EditorData;
class FormEditorStack;

// Design mode main view.
class EditorWidget : public Utils::FancyMainWindow
{
    Q_OBJECT

public:
    explicit EditorWidget(Core::EditorToolBar *toolBar, QWidget *parent = nullptr);

    QDockWidget* const* designerDockWidgets() const;

    // Form editor stack API
    void add(SharedTools::WidgetHost *widgetHost, FormWindowEditor *formWindowEditor);
    void removeFormWindowEditor(Core::IEditor *xmlEditor);
    bool setVisibleEditor(Core::IEditor *xmlEditor);
    SharedTools::WidgetHost *formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const;
    SharedTools::WidgetHost *formWindowEditorForFormWindow(const QDesignerFormWindowInterface *fw) const;

    EditorData activeEditor() const;
    void resetToDefaultLayout();

private:
    FormEditorStack *m_stack = nullptr;
    QDockWidget *m_designerDockWidgets[Designer::Constants::DesignerSubWindowCount];
    Core::EditorToolBar *m_toolBar = nullptr;
};

} // namespace Internal
} // namespace Designer