qt5nodeinstanceserver.h 2.35 KB
Newer Older
1
2
/**************************************************************************
**
Thomas Murach's avatar
Thomas Murach committed
3
** This file is part of Qt Creator
4
**
Thomas Murach's avatar
Thomas Murach committed
5
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6
**
Thomas Murach's avatar
Thomas Murach committed
7
** Contact: Nokia Corporation (info@qt.nokia.com)
8
9
**
**
Thomas Murach's avatar
Thomas Murach committed
10
** GNU Lesser General Public License Usage
11
**
Thomas Murach's avatar
Thomas Murach committed
12
13
14
15
16
17
** 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.
18
**
Thomas Murach's avatar
Thomas Murach committed
19
20
21
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22
**
Thomas Murach's avatar
Thomas Murach committed
23
** Other Usage
24
**
Thomas Murach's avatar
Thomas Murach committed
25
26
27
28
29
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
30
31
32
**
**************************************************************************/

33
34
35
36
#ifndef QT5NODEINSTANCESERVER_H
#define QT5NODEINSTANCESERVER_H

#include <QtGlobal>
37
38
39

#include "nodeinstanceserver.h"

40
41
42
43
44
QT_BEGIN_NAMESPACE
class QSGItem;
class DesignerSupport;
QT_END_NAMESPACE

45
46
namespace QmlDesigner {

47
class Qt5NodeInstanceServer : public NodeInstanceServer
48
49
50
{
    Q_OBJECT
public:
51
52
53
54
55
56
57
58
59
    Qt5NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
    ~Qt5NodeInstanceServer();

    QSGView *sgView() const;
    QDeclarativeView *declarativeView() const;
    QDeclarativeEngine *engine() const;
    void refreshBindings();

    DesignerSupport *designerSupport() const;
60
61

    void createScene(const CreateSceneCommand &command);
62
    void clearScene(const ClearSceneCommand &command);
63
64

protected:
65
66
67
68
69
    void initializeView(const QVector<AddImportContainer> &importVector);
    void resizeCanvasSizeToRootItemSize();
    void resetAllItems();
    QList<ServerNodeInstance> setupScene(const CreateSceneCommand &command);
    QList<QSGItem*> allItems() const;
70
71

private:
72
73
    QWeakPointer<QSGView> m_sgView;
    DesignerSupport *m_designerSupport;
74
75
};

76
77
78
} // QmlDesigner

#endif // QT5NODEINSTANCESERVER_H