diff options
author | Marco Bubke <marco.bubke@digia.com> | 2013-01-23 12:31:22 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@digia.com> | 2013-01-23 14:53:28 +0100 |
commit | 8d9710c0747a68f9938c8e7d32110f67ba64cc1e (patch) | |
tree | fda8332d2625520be7d282dcdbe20f48ad10f3ed /src/plugins/qmldesigner/documentmanager.h | |
parent | a4455f37110f09e326b984977baae286082366ad (diff) |
Refactoring document handling
The document handling in the qml designer was complicated source
code, which was initially intended for a non creator application.
To integrate new views it has to be changed and cleaned up. This
is the first major step in that direction.
Change-Id: Ie26f0aad7a03946d18bdb4c0759b246c5439d922
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/documentmanager.h')
-rw-r--r-- | src/plugins/qmldesigner/documentmanager.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/documentmanager.h b/src/plugins/qmldesigner/documentmanager.h new file mode 100644 index 0000000000..43a6f67584 --- /dev/null +++ b/src/plugins/qmldesigner/documentmanager.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** 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. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + + +#ifndef QMLDESIGNER_DOCUMENTMANAGER_H +#define QMLDESIGNER_DOCUMENTMANAGER_H + +#include <QObject> +#include <QList> + +#include <designdocument.h> + +namespace Core { +class IEditor; +} + +namespace QmlDesigner { + +class DocumentManager : public QObject +{ + Q_OBJECT +public: + DocumentManager(); + ~DocumentManager(); + + void setCurrentDesignDocument(Core::IEditor*editor); + DesignDocument *currentDesignDocument() const; + bool hasCurrentDesignDocument() const; + + void removeEditors(QList<Core::IEditor*> editors); + +private: + QHash<Core::IEditor *,QWeakPointer<DesignDocument> > m_designDocumentHash; + QWeakPointer<DesignDocument> m_currentDesignDocument; +}; + +} // namespace QmlDesigner + +#endif // QMLDESIGNER_DOCUMENTMANAGER_H |