Files
qt-creator/src/plugins/qmljseditor/qmljseditorplugin.h

105 lines
3.1 KiB
C
Raw Normal View History

/****************************************************************************
2009-04-22 15:21:04 +02:00
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
2009-04-22 15:21:04 +02:00
**
** This file is part of Qt Creator.
2009-04-22 15:21:04 +02:00
**
** 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.
2009-04-22 15:21:04 +02:00
**
** 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.
2010-12-17 16:01:08 +01:00
**
****************************************************************************/
2009-04-22 15:21:04 +02:00
#pragma once
2009-04-22 15:21:04 +02:00
#include <extensionsystem/iplugin.h>
#include <coreplugin/icontext.h>
#include <coreplugin/id.h>
#include <QPointer>
2009-04-22 15:21:04 +02:00
QT_FORWARD_DECLARE_CLASS(QAction)
namespace Utils { class JsonSchemaManager; }
namespace Core {
class Command;
class ActionContainer;
class IDocument;
class IEditor;
}
namespace QmlJS { class ModelManagerInterface; }
2010-06-09 15:56:03 +02:00
namespace QmlJSEditor {
2009-09-04 16:51:11 +02:00
class QmlJSEditorDocument;
2009-09-04 16:51:11 +02:00
2009-04-22 15:21:04 +02:00
namespace Internal {
class QmlJSQuickFixAssistProvider;
class QmlTaskManager;
2009-04-22 15:21:04 +02:00
class QmlJSEditorPlugin : public ExtensionSystem::IPlugin
2009-04-22 15:21:04 +02:00
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlJSEditor.json")
2009-04-22 15:21:04 +02:00
public:
QmlJSEditorPlugin();
virtual ~QmlJSEditorPlugin();
2009-04-22 15:21:04 +02:00
// IPlugin
bool initialize(const QStringList &arguments, QString *errorMessage = 0);
void extensionsInitialized();
2010-07-13 17:05:47 +02:00
ShutdownFlag aboutToShutdown();
2009-04-22 15:21:04 +02:00
static QmlJSEditorPlugin *instance()
2009-04-22 15:21:04 +02:00
{ return m_instance; }
QmlJSQuickFixAssistProvider *quickFixAssistProvider() const;
Utils::JsonSchemaManager *jsonManager() const;
void findUsages();
void renameUsages();
void reformatFile();
void showContextPane();
private:
void currentEditorChanged(Core::IEditor *editor);
void runSemanticScan();
void checkCurrentEditorSemanticInfoUpToDate();
void autoFormatOnSave(Core::IDocument *document);
Core::Command *addToolAction(QAction *a, Core::Context &context, Core::Id id,
Core::ActionContainer *c1, const QString &keySequence);
static QmlJSEditorPlugin *m_instance;
2009-04-22 15:21:04 +02:00
2010-06-09 15:56:03 +02:00
QmlJS::ModelManagerInterface *m_modelManager;
QmlJSQuickFixAssistProvider *m_quickFixAssistProvider;
QmlTaskManager *m_qmlTaskManager;
QAction *m_reformatFileAction;
QPointer<QmlJSEditorDocument> m_currentDocument;
QScopedPointer<Utils::JsonSchemaManager> m_jsonManager;
2009-04-22 15:21:04 +02:00
};
} // namespace Internal
} // namespace QmlJSEditor