2010-02-26 11:08:17 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2011-01-11 16:28:15 +01:00
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
2010-02-26 11:08:17 +01:00
|
|
|
**
|
|
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** No Commercial Usage
|
2010-02-26 11:08:17 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** This file contains pre-release code and may not be distributed.
|
|
|
|
|
** You may use this file in accordance with the terms and conditions
|
|
|
|
|
** contained in the Technology Preview License Agreement accompanying
|
|
|
|
|
** this package.
|
2010-02-26 11:08:17 +01:00
|
|
|
**
|
|
|
|
|
** 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.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** 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.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please contact
|
|
|
|
|
** Nokia at qt-info@nokia.com.
|
2010-02-26 11:08:17 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef FORMEDITORSTACK_H
|
|
|
|
|
#define FORMEDITORSTACK_H
|
|
|
|
|
|
2010-03-09 15:48:01 +01:00
|
|
|
#include "editordata.h"
|
|
|
|
|
|
2010-02-26 11:08:17 +01:00
|
|
|
#include <QtGui/QStackedWidget>
|
|
|
|
|
#include <QtCore/QList>
|
|
|
|
|
#include <QtCore/QString>
|
|
|
|
|
|
2010-03-09 10:26:20 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QDesignerFormWindowInterface;
|
|
|
|
|
class QDesignerFormEditorInterface;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2010-02-26 11:08:17 +01:00
|
|
|
namespace Core {
|
|
|
|
|
class IEditor;
|
2010-03-09 15:48:01 +01:00
|
|
|
class IMode;
|
2010-02-26 11:08:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Designer {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-03-09 15:48:01 +01:00
|
|
|
/* FormEditorStack: Maintains a stack of Qt Designer form windows embedded
|
|
|
|
|
* into a scrollarea and their associated XML editors.
|
|
|
|
|
* Takes care of updating the XML editor once design mode is left.
|
|
|
|
|
* Also updates the maincontainer resize handles when the active form
|
|
|
|
|
* window changes. */
|
2010-02-26 11:08:17 +01:00
|
|
|
class FormEditorStack : public QStackedWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2010-12-16 12:05:48 +01:00
|
|
|
Q_DISABLE_COPY(FormEditorStack)
|
2010-02-26 11:08:17 +01:00
|
|
|
public:
|
2010-03-09 10:26:20 +01:00
|
|
|
explicit FormEditorStack(QWidget *parent = 0);
|
|
|
|
|
|
2010-03-09 15:48:01 +01:00
|
|
|
void add(const EditorData &d);
|
2010-02-26 11:08:17 +01:00
|
|
|
bool removeFormWindowEditor(Core::IEditor *xmlEditor);
|
2010-03-09 15:48:01 +01:00
|
|
|
|
2010-02-26 11:08:17 +01:00
|
|
|
bool setVisibleEditor(Core::IEditor *xmlEditor);
|
2010-03-10 10:21:52 +01:00
|
|
|
SharedTools::WidgetHost *formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const;
|
|
|
|
|
SharedTools::WidgetHost *formWindowEditorForFormWindow(const QDesignerFormWindowInterface *fw) const;
|
2010-03-09 17:01:34 +01:00
|
|
|
|
|
|
|
|
EditorData activeEditor() const;
|
2010-02-26 11:08:17 +01:00
|
|
|
|
|
|
|
|
private slots:
|
2010-03-09 10:26:20 +01:00
|
|
|
void updateFormWindowSelectionHandles();
|
2010-03-09 15:48:01 +01:00
|
|
|
void modeAboutToChange(Core::IMode *);
|
2010-03-10 10:21:52 +01:00
|
|
|
void formSizeChanged(int w, int h);
|
2010-02-26 11:08:17 +01:00
|
|
|
|
|
|
|
|
private:
|
2010-03-09 10:26:20 +01:00
|
|
|
inline int indexOf(const QDesignerFormWindowInterface *) const;
|
|
|
|
|
inline int indexOf(const Core::IEditor *xmlEditor) const;
|
2010-02-26 11:08:17 +01:00
|
|
|
|
2010-03-09 15:48:01 +01:00
|
|
|
QList<EditorData> m_formEditors;
|
2010-03-09 10:26:20 +01:00
|
|
|
QDesignerFormEditorInterface *m_designerCore;
|
2010-02-26 11:08:17 +01:00
|
|
|
};
|
|
|
|
|
|
2010-03-09 10:26:20 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Designer
|
2010-02-26 11:08:17 +01:00
|
|
|
|
|
|
|
|
#endif // FORMEDITORSTACK_H
|