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

132 lines
3.7 KiB
C
Raw Normal View History

/****************************************************************************
2009-04-22 15:21:04 +02:00
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
2009-04-22 15:21:04 +02:00
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
2010-12-17 16:01:08 +01:00
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
2009-04-22 15:21:04 +02:00
#ifndef QMLJSEDITORPLUGIN_H
#define QMLJSEDITORPLUGIN_H
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;
}
2009-04-22 15:21:04 +02:00
namespace TextEditor {
class TextEditorActionHandler;
} // namespace TextEditor
namespace Core {
class Command;
class ActionContainer;
class ActionManager;
class IEditor;
}
namespace TextEditor {
class ITextEditor;
}
2010-06-09 15:56:03 +02:00
namespace QmlJS {
class ModelManagerInterface;
}
namespace QmlJSEditor {
2009-09-04 16:51:11 +02:00
2009-09-24 12:54:53 +02:00
class QmlFileWizard;
class QmlJSTextEditorWidget;
2009-09-04 16:51:11 +02:00
2009-04-22 15:21:04 +02:00
namespace Internal {
class QmlJSEditorFactory;
class QmlJSPreviewRunner;
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;
void initializeEditor(QmlJSEditor::QmlJSTextEditorWidget *editor);
2009-04-22 15:21:04 +02:00
Utils::JsonSchemaManager *jsonManager() const;
public Q_SLOTS:
void findUsages();
void renameUsages();
void reformatFile();
void showContextPane();
private Q_SLOTS:
void currentEditorChanged(Core::IEditor *editor);
void runSemanticScan();
void checkCurrentEditorSemanticInfoUpToDate();
2009-04-22 15:21:04 +02:00
private:
Core::Command *addToolAction(QAction *a, Core::Context &context, const 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;
QmlJSEditorFactory *m_editor;
2009-04-22 15:21:04 +02:00
TextEditor::TextEditorActionHandler *m_actionHandler;
QmlJSQuickFixAssistProvider *m_quickFixAssistProvider;
QmlTaskManager *m_qmlTaskManager;
QAction *m_reformatFileAction;
QPointer<QmlJSTextEditorWidget> m_currentEditor;
QScopedPointer<Utils::JsonSchemaManager> m_jsonManager;
2009-04-22 15:21:04 +02:00
};
} // namespace Internal
} // namespace QmlJSEditor
2009-04-22 15:21:04 +02:00
#endif // QMLJSEDITORPLUGIN_H