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 QMLINSPECTORTOOLBAR_H
35 #define QMLINSPECTORTOOLBAR_H
40 QT_FORWARD_DECLARE_CLASS(QAction)
41 QT_FORWARD_DECLARE_CLASS(QColor)
42 QT_FORWARD_DECLARE_CLASS(QToolButton)
53 namespace QmlJSInspector {
55 class ToolBarColorBox;
59 class QmlInspectorToolbar : public QObject
65 SelectionToolMode = 1,
66 MarqueeSelectionToolMode = 2,
73 explicit QmlInspectorToolbar(QObject *parent = 0);
74 void createActions(const Core::Context &context);
75 QWidget *widget() const;
78 void setEnabled(bool value);
82 void activateColorPicker();
83 void activateSelectTool();
84 void activateZoomTool();
85 void setAnimationSpeed(qreal slowdownFactor);
86 void setDesignModeBehavior(bool inDesignMode);
87 void setShowAppOnTop(bool showAppOnTop);
88 void setSelectedColor(const QColor &color);
91 void applyChangesFromQmlFileTriggered(bool isChecked);
93 void designModeSelected(bool checked);
94 void reloadSelected();
95 void colorPickerSelected();
96 void selectToolSelected();
97 void zoomToolSelected();
99 void showAppOnTopSelected(bool isChecked);
100 void animationSpeedChanged(qreal slowdownFactor = 1.0f);
103 void activateDesignModeOnClick();
104 void activatePlayOnClick();
105 void activateColorPickerOnClick();
106 void activateSelectToolOnClick();
107 void activateZoomOnClick();
109 void showAppOnTopClick();
111 void changeToDefaultAnimSpeed();
112 void changeToHalfAnimSpeed();
113 void changeToFourthAnimSpeed();
114 void changeToEighthAnimSpeed();
115 void changeToTenthAnimSpeed();
117 void activateFromQml();
119 void updatePlayAction();
120 void updatePauseAction();
123 QAction *m_fromQmlAction;
124 QAction *m_observerModeAction;
125 QAction *m_playAction;
126 QAction *m_selectAction;
127 QAction *m_zoomAction;
128 QAction *m_colorPickerAction;
130 QAction *m_showAppOnTopAction;
132 QAction *m_defaultAnimSpeedAction;
133 QAction *m_halfAnimSpeedAction;
134 QAction *m_fourthAnimSpeedAction;
135 QAction *m_eighthAnimSpeedAction;
136 QAction *m_tenthAnimSpeedAction;
137 QAction *m_menuPauseAction;
139 QToolButton *m_playButton;
143 ToolBarColorBox *m_colorBox;
147 qreal m_animationSpeed;
148 qreal m_previousAnimationSpeed;
150 DesignTool m_activeTool;
152 Utils::StyledBar *m_barWidget;
155 } // namespace Internal
156 } // namespace QmlJSInspector
158 #endif // QMLINSPECTORTOOLBAR_H