2022-08-19 15:59:36 +02:00
|
|
|
// 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
|
2011-02-18 11:47:15 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-08-12 15:48:24 +02:00
|
|
|
|
|
|
|
|
#include <qmljs/qmljsicontextpane.h>
|
|
|
|
|
|
2012-09-24 13:48:18 +02:00
|
|
|
#include <QPointer>
|
|
|
|
|
|
2014-02-11 21:55:42 +02:00
|
|
|
namespace QmlEditorWidgets { class ContextPaneWidget; }
|
2010-08-12 15:48:24 +02:00
|
|
|
|
|
|
|
|
namespace QmlJSEditor {
|
|
|
|
|
|
|
|
|
|
class QuickToolBar : public QmlJS::IContextPane
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-02-15 09:50:02 +01:00
|
|
|
QuickToolBar();
|
2018-11-24 02:45:30 +01:00
|
|
|
~QuickToolBar() override;
|
|
|
|
|
void apply(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false) override;
|
|
|
|
|
bool isAvailable(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node) override;
|
2010-08-12 15:48:24 +02:00
|
|
|
void setProperty(const QString &propertyName, const QVariant &value);
|
|
|
|
|
void removeProperty(const QString &propertyName);
|
2018-11-24 02:45:30 +01:00
|
|
|
void setEnabled(bool) override;
|
|
|
|
|
QWidget* widget() override;
|
2010-08-12 15:48:24 +02:00
|
|
|
|
|
|
|
|
void onPropertyChanged(const QString &, const QVariant &);
|
|
|
|
|
void onPropertyRemoved(const QString &);
|
|
|
|
|
void onPropertyRemovedAndChange(const QString &, const QString &, const QVariant &, bool removeFirst = true);
|
|
|
|
|
void onPinnedChanged(bool);
|
|
|
|
|
void onEnabledChanged(bool);
|
|
|
|
|
|
|
|
|
|
private:
|
2014-03-03 16:03:35 +01:00
|
|
|
void indentLines(int startLine, int endLine);
|
|
|
|
|
|
2010-08-12 15:48:24 +02:00
|
|
|
QmlEditorWidgets::ContextPaneWidget* contextWidget();
|
2012-09-24 13:48:18 +02:00
|
|
|
QPointer<QmlEditorWidgets::ContextPaneWidget> m_widget;
|
2010-08-12 15:48:24 +02:00
|
|
|
QmlJS::Document::Ptr m_doc;
|
2018-02-15 09:50:02 +01:00
|
|
|
QmlJS::AST::Node *m_node = nullptr;
|
|
|
|
|
TextEditor::TextEditorWidget *m_editorWidget = nullptr;
|
|
|
|
|
bool m_blockWriting = false;
|
2010-08-12 15:48:24 +02:00
|
|
|
QStringList m_propertyOrder;
|
2010-10-21 15:41:58 +02:00
|
|
|
QStringList m_prototypes;
|
2010-11-11 16:32:46 +01:00
|
|
|
QString m_oldType;
|
2010-08-12 15:48:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} //QmlDesigner
|