1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef FORMEDITORWIDGET_H
35 #define FORMEDITORWIDGET_H
43 namespace QmlDesigner {
48 class FormEditorScene;
49 class FormEditorGraphicsView;
54 class FormEditorWidget : public QWidget
58 FormEditorWidget(FormEditorView *view);
60 ZoomAction *zoomAction() const;
61 QAction *anchorToolAction() const;
62 QAction *transformToolAction() const;
63 QAction *showBoundingRectAction() const;
64 QAction *selectOnlyContentItemsAction() const;
65 QAction *snappingAction() const;
66 QAction *snappingAndAnchoringAction() const;
68 void setScene(FormEditorScene *scene);
69 ToolBox *toolBox() const;
71 double spacing() const;
72 double margins() const;
74 void setFeedbackNode(const QmlItemNode &node);
76 QString contextHelpId() const;
78 void setRootItemRect(const QRectF &rect);
79 QRectF rootItemRect() const;
88 void enterEvent(QEvent *event);
89 void wheelEvent(QWheelEvent *event);
90 QActionGroup *toolActionGroup() const;
93 void changeTransformTool(bool checked);
94 void changeAnchorTool(bool checked);
95 void setZoomLevel(double zoomLevel);
96 void changeRootItemWidth(const QString &widthText);
97 void changeRootItemHeight(const QString &heightText);
98 void resetNodeInstanceView();
101 QWeakPointer<FormEditorView> m_formEditorView;
102 QWeakPointer<FormEditorGraphicsView> m_graphicsView;
103 QWeakPointer<ZoomAction> m_zoomAction;
104 QWeakPointer<ToolBox> m_toolBox;
105 QWeakPointer<QAction> m_anchorToolAction;
106 QWeakPointer<QAction> m_transformToolAction;
107 QWeakPointer<QActionGroup> m_toolActionGroup;
108 QWeakPointer<QAction> m_snappingAction;
109 QWeakPointer<QAction> m_snappingAndAnchoringAction;
110 QWeakPointer<QAction> m_noSnappingAction;
111 QWeakPointer<QAction> m_showBoundingRectAction;
112 QWeakPointer<QAction> m_selectOnlyContentItemsAction;
113 QWeakPointer<LineEditAction> m_rootWidthAction;
114 QWeakPointer<LineEditAction> m_rootHeightAction;
115 QWeakPointer<QAction> m_resetAction;
120 #endif //FORMEDITORWIDGET_H