2009-03-20 14:57:12 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2009-03-20 14:57:12 +01:00
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2009-03-20 14:57:12 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** 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.
|
2009-03-20 14:57:12 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2009-03-20 14:57:12 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2009-03-16 11:08:07 +01:00
|
|
|
#ifndef GENERICPROJECTFILESEDITOR_H
|
|
|
|
|
#define GENERICPROJECTFILESEDITOR_H
|
|
|
|
|
|
|
|
|
|
#include <texteditor/basetexteditor.h>
|
|
|
|
|
#include <texteditor/basetextdocument.h>
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/editormanager/ieditorfactory.h>
|
|
|
|
|
|
2010-04-26 14:02:09 +02:00
|
|
|
namespace TextEditor {
|
|
|
|
|
class TextEditorActionHandler;
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-16 11:08:07 +01:00
|
|
|
namespace GenericProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class Manager;
|
|
|
|
|
class ProjectFilesEditor;
|
2011-02-21 16:02:26 +01:00
|
|
|
class ProjectFilesEditorWidget;
|
2009-03-16 11:08:07 +01:00
|
|
|
class ProjectFilesFactory;
|
|
|
|
|
|
|
|
|
|
class ProjectFilesFactory: public Core::IEditorFactory
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ProjectFilesFactory(Manager *manager, TextEditor::TextEditorActionHandler *handler);
|
2010-01-29 21:33:57 +01:00
|
|
|
|
2009-03-16 11:08:07 +01:00
|
|
|
virtual Core::IEditor *createEditor(QWidget *parent);
|
|
|
|
|
|
|
|
|
|
virtual QStringList mimeTypes() const;
|
2011-09-07 09:26:29 +02:00
|
|
|
virtual Core::Id id() const;
|
2010-01-07 18:17:24 +01:00
|
|
|
virtual QString displayName() const;
|
2009-03-16 11:08:07 +01:00
|
|
|
|
|
|
|
|
private:
|
2009-03-18 12:18:59 +01:00
|
|
|
TextEditor::TextEditorActionHandler *m_actionHandler;
|
|
|
|
|
QStringList m_mimeTypes;
|
2009-03-16 11:08:07 +01:00
|
|
|
};
|
|
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
class ProjectFilesEditor : public TextEditor::BaseTextEditor
|
2009-03-16 11:08:07 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2011-02-21 16:02:26 +01:00
|
|
|
ProjectFilesEditor(ProjectFilesEditorWidget *editorWidget);
|
2009-03-16 11:08:07 +01:00
|
|
|
|
2011-11-10 11:36:51 +01:00
|
|
|
virtual Core::Id id() const;
|
2009-03-16 11:08:07 +01:00
|
|
|
virtual bool duplicateSupported() const;
|
|
|
|
|
virtual Core::IEditor *duplicate(QWidget *parent);
|
2009-06-04 12:02:19 +02:00
|
|
|
virtual bool isTemporary() const { return false; }
|
2009-03-16 11:08:07 +01:00
|
|
|
};
|
|
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
class ProjectFilesEditorWidget : public TextEditor::BaseTextEditorWidget
|
2009-03-16 11:08:07 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2011-02-21 16:02:26 +01:00
|
|
|
ProjectFilesEditorWidget(QWidget *parent, ProjectFilesFactory *factory,
|
2009-03-16 11:08:07 +01:00
|
|
|
TextEditor::TextEditorActionHandler *handler);
|
2011-02-21 16:02:26 +01:00
|
|
|
virtual ~ProjectFilesEditorWidget();
|
2009-03-16 11:08:07 +01:00
|
|
|
|
|
|
|
|
ProjectFilesFactory *factory() const;
|
|
|
|
|
TextEditor::TextEditorActionHandler *actionHandler() const;
|
|
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
virtual TextEditor::BaseTextEditor *createEditor();
|
2009-03-16 11:08:07 +01:00
|
|
|
|
|
|
|
|
private:
|
2009-03-18 12:18:59 +01:00
|
|
|
ProjectFilesFactory *m_factory;
|
|
|
|
|
TextEditor::TextEditorActionHandler *m_actionHandler;
|
2009-03-16 11:08:07 +01:00
|
|
|
};
|
|
|
|
|
|
2011-02-04 09:52:39 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace GenericProjectManager
|
2009-03-16 11:08:07 +01:00
|
|
|
|
|
|
|
|
#endif // GENERICPROJECTFILESEDITOR_H
|