Commit 5e243dab authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: export core functionality



We export the core functionality of the model allowing
other plugins to use it.

The general functionality was already there, but I had
to rename the macro to avoid name clashes.

Also I renamed the .pri file to avoid confusion.

Change-Id: I88203ce9dbfddc8d734e5e232ff71bc0e244e5b8
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 960801b5
......@@ -5,6 +5,7 @@ QT += script \
network
DEFINES += TEST_EXPORTS
DEFINES += DESIGNER_CORE_LIBRARY
INCLUDEPATH += $$PWD \
$$PWD/include
......@@ -76,7 +77,7 @@ SOURCES += $$PWD/model/abstractview.cpp \
$$PWD/model/modelmerger.cpp \
$$PWD/exceptions/rewritingexception.cpp
HEADERS += $$PWD/include/corelib_global.h \
HEADERS += $$PWD/include/qmldesignercorelib_global.h \
$$PWD/include/abstractview.h \
$$PWD/include/nodeinstanceview.h \
$$PWD/include/rewriterview.h \
......
......@@ -33,7 +33,7 @@
#include <QVariant>
#include <QWeakPointer>
#include <QSharedPointer>
#include "corelib_global.h"
#include "qmldesignercorelib_global.h"
QT_BEGIN_NAMESPACE
class QTextStream;
......@@ -52,11 +52,11 @@ namespace QmlDesigner {
class Model;
class ModelNode;
class AbstractView;
class CORESHARED_EXPORT VariantProperty;
class CORESHARED_EXPORT NodeListProperty;
class CORESHARED_EXPORT NodeAbstractProperty;
class CORESHARED_EXPORT BindingProperty;
class CORESHARED_EXPORT NodeProperty;
class QMLDESIGNERCORE_EXPORT VariantProperty;
class QMLDESIGNERCORE_EXPORT NodeListProperty;
class QMLDESIGNERCORE_EXPORT NodeAbstractProperty;
class QMLDESIGNERCORE_EXPORT BindingProperty;
class QMLDESIGNERCORE_EXPORT NodeProperty;
class QmlObjectNode;
......@@ -65,14 +65,14 @@ namespace Internal {
class ModelPrivate;
}
class CORESHARED_EXPORT AbstractProperty
class QMLDESIGNERCORE_EXPORT AbstractProperty
{
friend class QmlDesigner::ModelNode;
friend class QmlDesigner::Internal::ModelPrivate;
friend CORESHARED_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2);
friend CORESHARED_EXPORT bool operator !=(const AbstractProperty &property1, const AbstractProperty &property2);
friend CORESHARED_EXPORT uint qHash(const AbstractProperty& property);
friend QMLDESIGNERCORE_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2);
friend QMLDESIGNERCORE_EXPORT bool operator !=(const AbstractProperty &property1, const AbstractProperty &property2);
friend QMLDESIGNERCORE_EXPORT uint qHash(const AbstractProperty& property);
public:
AbstractProperty();
......@@ -117,11 +117,11 @@ private:
QWeakPointer<AbstractView> m_view;
};
CORESHARED_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2);
CORESHARED_EXPORT bool operator !=(const AbstractProperty &property1, const AbstractProperty &property2);
CORESHARED_EXPORT uint qHash(const AbstractProperty& property);
CORESHARED_EXPORT QTextStream& operator<<(QTextStream &stream, const AbstractProperty &property);
CORESHARED_EXPORT QDebug operator<<(QDebug debug, const AbstractProperty &AbstractProperty);
QMLDESIGNERCORE_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2);
QMLDESIGNERCORE_EXPORT bool operator !=(const AbstractProperty &property1, const AbstractProperty &property2);
QMLDESIGNERCORE_EXPORT uint qHash(const AbstractProperty& property);
QMLDESIGNERCORE_EXPORT QTextStream& operator<<(QTextStream &stream, const AbstractProperty &property);
QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const AbstractProperty &AbstractProperty);
}
#endif //ABSTRACTPROPERTY_H
......@@ -30,7 +30,7 @@
#ifndef ABSTRACTVIEW_H
#define ABSTRACTVIEW_H
#include <corelib_global.h>
#include <qmldesignercorelib_global.h>
#include <model.h>
#include <modelnode.h>
......@@ -58,7 +58,7 @@ class QmlModelView;
class NodeInstanceView;
class RewriterView;
class CORESHARED_EXPORT AbstractView : public QObject
class QMLDESIGNERCORE_EXPORT AbstractView : public QObject
{
Q_OBJECT
public:
......@@ -191,8 +191,8 @@ private:
QWeakPointer<Model> m_model;
};
CORESHARED_EXPORT QList<Internal::InternalNodePointer> toInternalNodeList(const QList<ModelNode> &nodeList);
CORESHARED_EXPORT QList<ModelNode> toModelNodeList(const QList<Internal::InternalNodePointer> &nodeList, AbstractView *view);
QMLDESIGNERCORE_EXPORT QList<Internal::InternalNodePointer> toInternalNodeList(const QList<ModelNode> &nodeList);
QMLDESIGNERCORE_EXPORT QList<ModelNode> toModelNodeList(const QList<Internal::InternalNodePointer> &nodeList, AbstractView *view);
}
......
......@@ -31,7 +31,7 @@
#ifndef BASETEXTEDITMODIFIER_H
#define BASETEXTEDITMODIFIER_H
#include "corelib_global.h"
#include "qmldesignercorelib_global.h"
#include "plaintexteditmodifier.h"
#include <texteditor/basetexteditor.h>
......@@ -44,7 +44,7 @@ class Snapshot;
namespace QmlDesigner {
class CORESHARED_EXPORT BaseTextEditModifier: public PlainTextEditModifier
class QMLDESIGNERCORE_EXPORT BaseTextEditModifier: public PlainTextEditModifier
{
public:
BaseTextEditModifier(TextEditor::BaseTextEditorWidget *textEdit);
......
......@@ -30,12 +30,12 @@
#ifndef BINDINGPROPERTY_H
#define BINDINGPROPERTY_H
#include "corelib_global.h"
#include "qmldesignercorelib_global.h"
#include "abstractproperty.h"
namespace QmlDesigner {
class CORESHARED_EXPORT BindingProperty : public QmlDesigner::AbstractProperty
class QMLDESIGNERCORE_EXPORT BindingProperty : public QmlDesigner::AbstractProperty
{
friend class QmlDesigner::ModelNode;
friend class QmlDesigner::Internal::ModelPrivate;
......
......@@ -30,14 +30,14 @@
#ifndef EXCEPTION_H
#define EXCEPTION_H
#include <corelib_global.h>
#include <qmldesignercorelib_global.h>
#include <QString>
#include <QDebug>
namespace QmlDesigner {
class CORESHARED_EXPORT Exception
class QMLDESIGNERCORE_EXPORT Exception
{
public:
Exception(int line,
......@@ -64,7 +64,7 @@ private:
static bool s_shouldAssert;
};
CORESHARED_EXPORT QDebug operator<<(QDebug debug, const Exception &exception);
QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const Exception &exception);
}
......
......@@ -33,11 +33,11 @@
#include <QString>
#include <QStringList>
#include "corelib_global.h"
#include "qmldesignercorelib_global.h"
namespace QmlDesigner {
class CORESHARED_EXPORT Import
class QMLDESIGNERCORE_EXPORT Import
{
public:
static Import createLibraryImport(const QString &url, const QString &version = QString(), const QString &alias = QString(), const QStringList &importPaths = QStringList());
......@@ -71,7 +71,7 @@ private:
QStringList m_importPathList;
};
CORESHARED_EXPORT uint qHash(const Import &import);
QMLDESIGNERCORE_EXPORT uint qHash(const Import &import);
} // namespace QmlDesigner
......
......@@ -35,7 +35,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidArgumentException : public Exception
class QMLDESIGNERCORE_EXPORT InvalidArgumentException : public Exception
{
public:
InvalidArgumentException(int line,
......
......@@ -34,7 +34,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidIdException : public InvalidArgumentException
class QMLDESIGNERCORE_EXPORT InvalidIdException : public InvalidArgumentException
{
public:
enum Reason { InvalidCharacters, DuplicateId };
......
......@@ -34,7 +34,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidMetaInfoException : public Exception
class QMLDESIGNERCORE_EXPORT InvalidMetaInfoException : public Exception
{
public:
InvalidMetaInfoException(int line,
......
......@@ -34,7 +34,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidModelNodeException : public Exception
class QMLDESIGNERCORE_EXPORT InvalidModelNodeException : public Exception
{
public:
InvalidModelNodeException(int line,
......
......@@ -34,7 +34,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidModelStateException : public Exception
class QMLDESIGNERCORE_EXPORT InvalidModelStateException : public Exception
{
public:
InvalidModelStateException(int line,
......
......@@ -34,7 +34,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidPropertyException : public Exception
class QMLDESIGNERCORE_EXPORT InvalidPropertyException : public Exception
{
public:
InvalidPropertyException(int line,
......
......@@ -34,7 +34,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidQmlSourceException : public QmlDesigner::Exception
class QMLDESIGNERCORE_EXPORT InvalidQmlSourceException : public QmlDesigner::Exception
{
public:
InvalidQmlSourceException(int line,
......
......@@ -34,7 +34,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidReparentingException : public Exception
class QMLDESIGNERCORE_EXPORT InvalidReparentingException : public Exception
{
public:
InvalidReparentingException(int line,
......
......@@ -34,7 +34,7 @@
namespace QmlDesigner {
class CORESHARED_EXPORT InvalidSlideIndexException : public Exception
class QMLDESIGNERCORE_EXPORT InvalidSlideIndexException : public Exception
{
public:
InvalidSlideIndexException(int line,
......
......@@ -30,7 +30,7 @@
#ifndef ITEMLIBRARYINFO_H
#define ITEMLIBRARYINFO_H
#include "corelib_global.h"
#include "qmldesignercorelib_global.h"
#include "propertycontainer.h"
#include <QSharedPointer>
......@@ -45,15 +45,15 @@ class MetaInfoPrivate;
class ItemLibraryEntry;
CORESHARED_EXPORT QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibraryEntry);
CORESHARED_EXPORT QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry);
QMLDESIGNERCORE_EXPORT QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibraryEntry);
QMLDESIGNERCORE_EXPORT QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry);
class CORESHARED_EXPORT ItemLibraryEntry
class QMLDESIGNERCORE_EXPORT ItemLibraryEntry
{
//friend class QmlDesigner::MetaInfo;
//friend class QmlDesigner::Internal::MetaInfoParser;
friend CORESHARED_EXPORT QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibraryEntry);
friend CORESHARED_EXPORT QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry);
friend QMLDESIGNERCORE_EXPORT QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibraryEntry);
friend QMLDESIGNERCORE_EXPORT QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry);
public:
ItemLibraryEntry();
......@@ -93,7 +93,7 @@ private:
QExplicitlySharedDataPointer<Internal::ItemLibraryEntryData> m_data;
};
class CORESHARED_EXPORT ItemLibraryInfo : public QObject
class QMLDESIGNERCORE_EXPORT ItemLibraryInfo : public QObject
{
Q_OBJECT
......
......@@ -30,7 +30,7 @@
#ifndef METAINFO_H
#define METAINFO_H
#include "corelib_global.h"
#include "qmldesignercorelib_global.h"
#include <QMultiHash>
#include <QString>
......@@ -53,11 +53,11 @@ namespace Internal {
typedef QSharedPointer<MetaInfoPrivate> MetaInfoPrivatePointer;
}
CORESHARED_EXPORT bool operator==(const MetaInfo &first, const MetaInfo &second);
CORESHARED_EXPORT bool operator!=(const MetaInfo &first, const MetaInfo &second);
QMLDESIGNERCORE_EXPORT bool operator==(const MetaInfo &first, const MetaInfo &second);
QMLDESIGNERCORE_EXPORT bool operator!=(const MetaInfo &first, const MetaInfo &second);
class CORESHARED_EXPORT MetaInfo
class QMLDESIGNERCORE_EXPORT MetaInfo
{
friend class QmlDesigner::Internal::MetaInfoPrivate;
friend class QmlDesigner::Internal::ModelPrivate;
......
......@@ -30,7 +30,7 @@
#ifndef METAINFOPARSER_H
#define METAINFOPARSER_H
#include "corelib_global.h"
#include "qmldesignercorelib_global.h"
#include <QXmlStreamReader>
#include <QString>
#include <QFile>
......@@ -43,7 +43,7 @@ class ItemLibraryEntry;
namespace Internal {
class TEST_CORESHARED_EXPORT MetaInfoParser
class QMLDESIGNERCORE_EXPORT MetaInfoParser
{
public:
MetaInfoParser(const MetaInfo &metaInfo);
......
......@@ -30,7 +30,7 @@
#ifndef DESIGNERMODEL_H
#define DESIGNERMODEL_H
#include <corelib_global.h>
#include <qmldesignercorelib_global.h>
#include <QObject>
#include <QMimeData>
#include <QPair>
......@@ -62,7 +62,7 @@ class RewriterView;
typedef QList<QPair<QString, QVariant> > PropertyListType;
class CORESHARED_EXPORT Model : public QObject
class QMLDESIGNERCORE_EXPORT Model : public QObject
{
friend class QmlDesigner::ModelNode;
friend class QmlDesigner::NodeState;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment