OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qmljseditor / qmljseditorplugin.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32
33 #ifndef QMLJSEDITORPLUGIN_H
34 #define QMLJSEDITORPLUGIN_H
35
36 #include <extensionsystem/iplugin.h>
37 #include <coreplugin/icontext.h>
38 #include <QtCore/QPointer>
39
40 QT_FORWARD_DECLARE_CLASS(QAction)
41 QT_FORWARD_DECLARE_CLASS(QTimer)
42
43 namespace TextEditor {
44 class TextEditorActionHandler;
45 } // namespace TextEditor
46
47 namespace Core {
48 class Command;
49 class ActionContainer;
50 class ActionManager;
51 class IEditor;
52 }
53
54 namespace TextEditor {
55 class ITextEditor;
56 }
57
58 namespace QmlJS {
59     class ModelManagerInterface;
60 }
61
62 namespace QmlJSEditor {
63
64 class QmlFileWizard;
65 class QmlJSTextEditorWidget;
66
67 namespace Internal {
68
69 class QmlJSEditorFactory;
70 class QmlJSPreviewRunner;
71 class QmlJSQuickFixCollector;
72 class QmlTaskManager;
73
74 class QmlJSEditorPlugin : public ExtensionSystem::IPlugin
75 {
76     Q_OBJECT
77
78 public:
79     QmlJSEditorPlugin();
80     virtual ~QmlJSEditorPlugin();
81
82     // IPlugin
83     bool initialize(const QStringList &arguments, QString *errorMessage = 0);
84     void extensionsInitialized();
85     ShutdownFlag aboutToShutdown();
86
87     static QmlJSEditorPlugin *instance()
88     { return m_instance; }
89
90     QmlJSQuickFixCollector *quickFixCollector() const;
91
92     void initializeEditor(QmlJSEditor::QmlJSTextEditorWidget *editor);
93
94 public Q_SLOTS:
95     void followSymbolUnderCursor();
96     void findUsages();
97     void showContextPane();
98
99 private Q_SLOTS:
100     void quickFix(TextEditor::ITextEditor *editable);
101     void quickFixNow();
102     void currentEditorChanged(Core::IEditor *editor);
103
104 private:
105     Core::Command *addToolAction(QAction *a, Core::ActionManager *am, Core::Context &context, const QString &name,
106                                  Core::ActionContainer *c1, const QString &keySequence);
107
108     static QmlJSEditorPlugin *m_instance;
109
110     QAction *m_actionPreview;
111     QmlJSPreviewRunner *m_previewRunner;
112
113     QmlJS::ModelManagerInterface *m_modelManager;
114     QmlFileWizard *m_wizard;
115     QmlJSEditorFactory *m_editor;
116     TextEditor::TextEditorActionHandler *m_actionHandler;
117
118     QmlJSQuickFixCollector *m_quickFixCollector;
119
120     QTimer *m_quickFixTimer;
121     QPointer<TextEditor::ITextEditor> m_currentTextEditable;
122     QmlTaskManager *m_qmlTaskManager;
123 };
124
125 } // namespace Internal
126 } // namespace QmlJSEditor
127
128 #endif // QMLJSEDITORPLUGIN_H