Moved qmljsmodelmanagerinterface.h

This commit is contained in:
Roberto Raggi
2010-06-09 15:56:03 +02:00
parent 373bfb05e7
commit 726c3345c4
18 changed files with 91 additions and 48 deletions

View File

@@ -30,8 +30,8 @@
#include "qmljscodecompletion.h"
#include "qmlexpressionundercursor.h"
#include "qmljseditor.h"
#include "qmljsmodelmanagerinterface.h"
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsbind.h>
#include <qmljs/qmljsinterpreter.h>

View File

@@ -40,6 +40,8 @@ class ITextEditable;
}
namespace QmlJS {
class ModelManagerInterface;
namespace Interpreter {
class Value;
}
@@ -47,8 +49,6 @@ namespace QmlJS {
namespace QmlJSEditor {
class ModelManagerInterface;
namespace Internal {
class FunctionArgumentWidget;
@@ -58,7 +58,7 @@ class CodeCompletion: public TextEditor::ICompletionCollector
Q_OBJECT
public:
CodeCompletion(ModelManagerInterface *modelManager, QObject *parent = 0);
CodeCompletion(QmlJS::ModelManagerInterface *modelManager, QObject *parent = 0);
virtual ~CodeCompletion();
virtual TextEditor::ITextEditable *editor() const;
@@ -88,7 +88,7 @@ private:
const QHash<QString, const QmlJS::Interpreter::Value *> &newCompletions,
const QIcon &icon, int relevance);
ModelManagerInterface *m_modelManager;
QmlJS::ModelManagerInterface *m_modelManager;
TextEditor::ITextEditable *m_editor;
int m_startPosition;
QList<TextEditor::CompletionItem> m_completions;

View File

@@ -1430,7 +1430,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source)
return semanticInfo;
}
void SemanticHighlighter::setModelManager(QmlJSEditor::ModelManagerInterface *modelManager)
void SemanticHighlighter::setModelManager(QmlJS::ModelManagerInterface *modelManager)
{
m_modelManager = modelManager;
}

View File

@@ -47,9 +47,11 @@ namespace Core {
class ICore;
}
namespace QmlJSEditor {
namespace QmlJS {
class ModelManagerInterface;
}
class ModelManagerInterface;
namespace QmlJSEditor {
class Highlighter;
namespace Internal {
@@ -176,7 +178,7 @@ public:
};
void rehighlight(const Source &source);
void setModelManager(ModelManagerInterface *modelManager);
void setModelManager(QmlJS::ModelManagerInterface *modelManager);
Q_SIGNALS:
void changed(const QmlJSEditor::Internal::SemanticInfo &semanticInfo);
@@ -194,7 +196,7 @@ private:
bool m_done;
Source m_source;
SemanticInfo m_lastSemanticInfo;
ModelManagerInterface *m_modelManager;
QmlJS::ModelManagerInterface *m_modelManager;
};
class QmlJSTextEditor : public TextEditor::BaseTextEditor
@@ -265,7 +267,7 @@ private:
QTimer *m_updateUsesTimer;
QTimer *m_semanticRehighlightTimer;
QComboBox *m_methodCombo;
ModelManagerInterface *m_modelManager;
QmlJS::ModelManagerInterface *m_modelManager;
QTextCharFormat m_occurrencesFormat;
QTextCharFormat m_occurrencesUnusedFormat;
QTextCharFormat m_occurrenceRenameFormat;

View File

@@ -21,7 +21,6 @@ HEADERS += \
qmljshighlighter.h \
qmljshoverhandler.h \
qmljsmodelmanager.h \
qmljsmodelmanagerinterface.h \
qmljspreviewrunner.h \
qmljsquickfix.h
@@ -36,7 +35,6 @@ SOURCES += \
qmljshighlighter.cpp \
qmljshoverhandler.cpp \
qmljsmodelmanager.cpp \
qmljsmodelmanagerinterface.cpp \
qmljspreviewrunner.cpp \
qmljsquickfix.cpp

View File

@@ -50,9 +50,12 @@ namespace TextEditor {
class ITextEditable;
}
namespace QmlJS {
class ModelManagerInterface;
}
namespace QmlJSEditor {
class ModelManagerInterface;
class QmlFileWizard;
namespace Internal {
@@ -98,7 +101,7 @@ private:
QAction *m_actionPreview;
QmlJSPreviewRunner *m_previewRunner;
ModelManagerInterface *m_modelManager;
QmlJS::ModelManagerInterface *m_modelManager;
QmlFileWizard *m_wizard;
QmlJSEditorFactory *m_editor;
TextEditor::TextEditorActionHandler *m_actionHandler;

View File

@@ -63,7 +63,7 @@ HoverHandler::HoverHandler(QObject *parent)
: QObject(parent)
, m_helpEngineNeedsSetup(false)
{
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<ModelManagerInterface>();
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<QmlJS::ModelManagerInterface>();
ICore *core = ICore::instance();
QFileInfo fi(core->settings()->fileName());

View File

@@ -30,8 +30,7 @@
#ifndef QMLJSHOVERHANDLER_H
#define QMLJSHOVERHANDLER_H
#include "qmljsmodelmanagerinterface.h"
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <QtCore/QObject>
QT_BEGIN_NAMESPACE
@@ -79,7 +78,7 @@ private:
QStringList *baseClasses) const;
private:
ModelManagerInterface *m_modelManager;
QmlJS::ModelManagerInterface *m_modelManager;
QHelpEngineCore *m_helpEngine;
QString m_helpId;
QString m_toolTip;

View File

@@ -30,8 +30,7 @@
#ifndef QMLJSMODELMANAGER_H
#define QMLJSMODELMANAGER_H
#include "qmljsmodelmanagerinterface.h"
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <qmljs/qmljsdocument.h>
#include <QFuture>
@@ -47,7 +46,7 @@ class MimeType;
namespace QmlJSEditor {
namespace Internal {
class ModelManager: public ModelManagerInterface
class ModelManager: public QmlJS::ModelManagerInterface
{
Q_OBJECT

View File

@@ -1,72 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** 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
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLJSMODELMANAGERINTERFACE_H
#define QMLJSMODELMANAGERINTERFACE_H
#include "qmljseditor_global.h"
#include <qmljs/qmljsdocument.h>
#include <QObject>
#include <QStringList>
#include <QSharedPointer>
namespace QmlJS {
class Snapshot;
}
namespace QmlJSEditor {
class QMLJSEDITOR_EXPORT ModelManagerInterface: public QObject
{
Q_OBJECT
public:
ModelManagerInterface(QObject *parent = 0);
virtual ~ModelManagerInterface();
virtual QmlJS::Snapshot snapshot() const = 0;
virtual void updateSourceFiles(const QStringList &files,
bool emitDocumentOnDiskChanged) = 0;
virtual void fileChangedOnDisk(const QString &path) = 0;
virtual void removeFiles(const QStringList &files) = 0;
virtual void setProjectImportPaths(const QStringList &importPaths) = 0;
virtual QStringList importPaths() const = 0;
signals:
void documentUpdated(QmlJS::Document::Ptr doc);
void documentChangedOnDisk(QmlJS::Document::Ptr doc);
void aboutToRemoveFiles(const QStringList &files);
};
} // namespace QmlJSEditor
#endif // QMLJSMODELMANAGERINTERFACE_H

View File

@@ -35,9 +35,11 @@
#include <qmljs/parser/qmljsastfwd_p.h>
#include <qmljs/qmljsdocument.h>
namespace QmlJSEditor {
namespace QmlJS {
class ModelManagerInterface;
}
class ModelManagerInterface;
namespace QmlJSEditor {
namespace Internal {