aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/mockup/qmldesigner/designercore/include/rewriterview.h
blob: 39c19e4e2dddfddadb633271c3a27c7ebe00ee1c (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/

#pragma once

#include "qmldesignercorelib_global.h"
#include "abstractview.h"

namespace QmlJS {
class Document;
class ScopeChain;
}

namespace QmlDesigner {

class TextModifier;

namespace Internal {

class TextToModelMerger;
class ModelToTextMerger;
class ModelNodePositionStorage;

} //Internal

struct CppTypeData
{
    QString superClassName;
    QString importUrl;
    QString versionString;
    QString cppClassName;
    QString typeName;
    bool isSingleton = false;
};

class RewriterView : public AbstractView
{
    Q_OBJECT

public:
    enum DifferenceHandling {
        Validate,
        Amend
    };

public:
    RewriterView(DifferenceHandling, QObject *) {}
    ~RewriterView() override {}

    void modelAttached(Model *) override {}
    void modelAboutToBeDetached(Model *) override {}
    void nodeCreated(const ModelNode &) override {}
    void nodeRemoved(const ModelNode &, const NodeAbstractProperty &, PropertyChangeFlags) override
    {}
    void propertiesAboutToBeRemoved(const QList<AbstractProperty> &) override {}
    void propertiesRemoved(const QList<AbstractProperty> &) override {}
    void variantPropertiesChanged(const QList<VariantProperty> &, PropertyChangeFlags) override {}
    void bindingPropertiesChanged(const QList<BindingProperty> &, PropertyChangeFlags) override {}
    void signalHandlerPropertiesChanged(const QVector<SignalHandlerProperty> &,
                                        PropertyChangeFlags) override
    {}
    void nodeReparented(const ModelNode &,
                        const NodeAbstractProperty &,
                        const NodeAbstractProperty &,
                        AbstractView::PropertyChangeFlags) override
    {}
    void nodeIdChanged(const ModelNode &, const QString &, const QString &) override {}
    void nodeOrderChanged(const NodeListProperty &, const ModelNode &, int) override {}
    void rootNodeTypeChanged(const QString &, int, int) override {}
    void nodeTypeChanged(const ModelNode &, const TypeName &, int, int) override {}
    void customNotification(const AbstractView *,
                            const QString &,
                            const QList<ModelNode> &,
                            const QList<QVariant> &) override
    {}

    void rewriterBeginTransaction() override {}
    void rewriterEndTransaction() override {}

    void importsChanged(const QList<Import> &, const QList<Import> &) override {}

    TextModifier *textModifier() const { return {}; }
    void setTextModifier(TextModifier *) {}
    QString textModifierContent() const { return {}; }

    void reactivateTextMofifierChangeSignals() {}
    void deactivateTextMofifierChangeSignals() {}

    void auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data) override
    {}

    Internal::ModelNodePositionStorage *positionStorage() const {}

    QList<DocumentMessage> warnings() const { return {}; }
    QList<DocumentMessage> errors() const { return {}; }
    void clearErrorAndWarnings() {}
    void setErrors(const QList<DocumentMessage> &) {}
    void setWarnings(const QList<DocumentMessage> &) {}
    void setIncompleteTypeInformation(bool) {}
    bool hasIncompleteTypeInformation() const { return false; }
    void addError(const DocumentMessage &) {}

    void enterErrorState(const QString &) {}
    bool inErrorState() const { return false; }
    void leaveErrorState() {}
    void resetToLastCorrectQml() {}

    QMap<ModelNode, QString> extractText(const QList<ModelNode> &) const;
    int nodeOffset(const ModelNode &) const;
    int nodeLength(const ModelNode &) const;
    int firstDefinitionInsideOffset(const ModelNode &) const { return {}; }
    int firstDefinitionInsideLength(const ModelNode &) const { return {}; }
    bool modificationGroupActive() { return {}; }
    ModelNode nodeAtTextCursorPosition(int) const { return {}; }

    bool renameId(const QString &, const QString &) { return {}; }

    const QmlJS::Document *document() const { return {}; }
    const QmlJS::ScopeChain *scopeChain() const { return {}; }

    QString convertTypeToImportAlias(const QString &) const { return {}; }

    bool checkSemanticErrors() const { return {}; }

    void setCheckSemanticErrors(bool) {}

    QString pathForImport(const Import &) { return {}; }

    QStringList importDirectories() const { return {}; }

    QSet<QPair<QString, QString>> qrcMapping() const { return {}; }

    void moveToComponent(const ModelNode &) {}

    QStringList autoComplete(const QString &, int, bool = true) { return {}; }

    QList<CppTypeData> getCppTypes() { return {}; }

    void setWidgetStatusCallback(std::function<void(bool)> setWidgetStatusCallback);

    void qmlTextChanged() {}
    void delayedSetup() {}

    void writeAuxiliaryData() {}
    void restoreAuxiliaryData() {}

    QString getRawAuxiliaryData() const { return {}; }
    QString auxiliaryDataAsQML() const { return {}; }

    ModelNode getNodeForCanonicalIndex(int) { return {}; }
};

} //QmlDesigner