qmljseditorplugin.h 2.69 KB
Newer Older
1 2 3 4
/**************************************************************************
**
** This file is part of Qt Creator
**
hjk's avatar
hjk committed
5
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6
**
7
** Contact: Nokia Corporation (qt-info@nokia.com)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** 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.
**
** If you are unsure which license is appropriate for your use, please
hjk's avatar
hjk committed
26
** contact the sales department at http://qt.nokia.com/contact.
27 28 29
**
**************************************************************************/

30 31
#ifndef QMLJSEDITORPLUGIN_H
#define QMLJSEDITORPLUGIN_H
32 33 34

#include <extensionsystem/iplugin.h>

35 36
QT_FORWARD_DECLARE_CLASS(QAction)

37 38 39 40
namespace TextEditor {
class TextEditorActionHandler;
} // namespace TextEditor

41 42 43 44 45 46
namespace Core {
class Command;
class ActionContainer;
class ActionManager;
}

47
namespace QmlJSEditor {
48

Roberto Raggi's avatar
Roberto Raggi committed
49
class ModelManagerInterface;
Erik Verbruggen's avatar
Erik Verbruggen committed
50
class QmlFileWizard;
51

52 53
namespace Internal {

54 55
class QmlJSEditorFactory;
class QmlJSTextEditor;
56
class QmlJSPreviewRunner;
57

58
class QmlJSEditorPlugin : public ExtensionSystem::IPlugin
59 60 61 62
{
    Q_OBJECT

public:
63 64
    QmlJSEditorPlugin();
    virtual ~QmlJSEditorPlugin();
65 66 67 68 69

    // IPlugin
    bool initialize(const QStringList &arguments, QString *errorMessage = 0);
    void extensionsInitialized();

70
    static QmlJSEditorPlugin *instance()
71 72
    { return m_instance; }

73
    void initializeEditor(QmlJSTextEditor *editor);
74

75 76 77
public Q_SLOTS:
    void followSymbolUnderCursor();

78 79 80
private Q_SLOTS:
    void openPreview();

81
private:
82 83 84
    Core::Command *addToolAction(QAction *a, Core::ActionManager *am, const QList<int> &context, const QString &name,
                                 Core::ActionContainer *c1, const QString &keySequence);

85
    static QmlJSEditorPlugin *m_instance;
86

87 88 89
    QAction *m_actionPreview;
    QmlJSPreviewRunner *m_previewRunner;

Roberto Raggi's avatar
Roberto Raggi committed
90
    ModelManagerInterface *m_modelManager;
Erik Verbruggen's avatar
Erik Verbruggen committed
91
    QmlFileWizard *m_wizard;
92
    QmlJSEditorFactory *m_editor;
93 94 95 96
    TextEditor::TextEditorActionHandler *m_actionHandler;
};

} // namespace Internal
97
} // namespace QmlJSEditor
98

99
#endif // QMLJSEDITORPLUGIN_H