2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-03-30 12:11:32 +02:00
|
|
|
**
|
2013-01-28 17:12:19 +01:00
|
|
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2010-03-30 12:11:32 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-03-30 12:11:32 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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.
|
2010-03-30 12:11:32 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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-03-30 12:11:32 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-03-30 12:11:32 +02:00
|
|
|
|
|
|
|
|
#ifndef CMAKEEDITOR_H
|
|
|
|
|
#define CMAKEEDITOR_H
|
|
|
|
|
|
|
|
|
|
#include "cmakeeditorfactory.h"
|
|
|
|
|
|
|
|
|
|
#include <texteditor/basetextdocument.h>
|
|
|
|
|
#include <texteditor/basetexteditor.h>
|
2013-08-30 12:55:06 +02:00
|
|
|
#include <texteditor/codeassist/completionassistprovider.h>
|
2012-02-19 18:58:39 +04:00
|
|
|
#include <utils/uncommentselection.h>
|
2010-03-30 12:11:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace TextEditor {
|
|
|
|
|
class FontSettings;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
class CMakeEditorWidget;
|
2010-03-30 12:11:32 +02:00
|
|
|
class CMakeHighlighter;
|
2011-02-21 16:02:26 +01:00
|
|
|
class CMakeManager;
|
2010-03-30 12:11:32 +02:00
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
class CMakeEditor : public TextEditor::BaseTextEditor
|
2010-03-30 12:11:32 +02:00
|
|
|
{
|
2011-03-31 17:43:48 +02:00
|
|
|
Q_OBJECT
|
2011-04-13 13:00:30 +02:00
|
|
|
|
2010-03-30 12:11:32 +02:00
|
|
|
public:
|
2011-02-21 16:02:26 +01:00
|
|
|
CMakeEditor(CMakeEditorWidget *);
|
2010-03-30 12:11:32 +02:00
|
|
|
|
|
|
|
|
bool duplicateSupported() const { return true; }
|
|
|
|
|
Core::IEditor *duplicate(QWidget *parent);
|
2011-11-10 11:36:51 +01:00
|
|
|
Core::Id id() const;
|
2013-08-30 12:55:06 +02:00
|
|
|
TextEditor::CompletionAssistProvider *completionAssistProvider();
|
2011-04-13 13:00:30 +02:00
|
|
|
|
2011-03-31 17:43:48 +02:00
|
|
|
private slots:
|
|
|
|
|
void markAsChanged();
|
|
|
|
|
void build();
|
2010-03-30 12:11:32 +02:00
|
|
|
};
|
|
|
|
|
|
2011-02-21 16:02:26 +01:00
|
|
|
class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
|
2010-03-30 12:11:32 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2011-02-21 16:02:26 +01:00
|
|
|
CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory, TextEditor::TextEditorActionHandler *ah);
|
2010-03-30 12:11:32 +02:00
|
|
|
|
|
|
|
|
bool save(const QString &fileName = QString());
|
|
|
|
|
|
|
|
|
|
CMakeEditorFactory *factory() { return m_factory; }
|
|
|
|
|
TextEditor::TextEditorActionHandler *actionHandler() const { return m_ah; }
|
2011-02-21 16:02:26 +01:00
|
|
|
|
2013-07-04 20:11:10 +02:00
|
|
|
Link findLinkAt(const QTextCursor &cursor, bool resolveTarget = true, bool inNextSplit = false);
|
2012-02-19 18:58:39 +04:00
|
|
|
|
2010-03-30 12:11:32 +02:00
|
|
|
protected:
|
2011-02-21 16:02:26 +01:00
|
|
|
TextEditor::BaseTextEditor *createEditor();
|
2012-02-19 18:58:39 +04:00
|
|
|
void contextMenuEvent(QContextMenuEvent *e);
|
2010-03-30 12:11:32 +02:00
|
|
|
|
|
|
|
|
public slots:
|
2012-02-19 18:58:39 +04:00
|
|
|
void unCommentSelection();
|
2010-03-30 12:11:32 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
CMakeEditorFactory *m_factory;
|
|
|
|
|
TextEditor::TextEditorActionHandler *m_ah;
|
2012-02-19 18:58:39 +04:00
|
|
|
Utils::CommentDefinition m_commentDefinition;
|
2010-03-30 12:11:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CMakeDocument : public TextEditor::BaseTextDocument
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CMakeDocument();
|
|
|
|
|
QString defaultPath() const;
|
|
|
|
|
QString suggestedFileName() const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Qt4ProjectManager
|
|
|
|
|
|
|
|
|
|
#endif // CMAKEEDITOR_H
|