2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-12-03 13:49:35 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-12-03 13:49:35 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-12-03 13:49:35 +01: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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-12-03 13:49:35 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-03 13:49:35 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-12-03 13:49:35 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-12-03 13:49:35 +01:00
|
|
|
|
|
|
|
|
#include "cpptools_global.h"
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QString>
|
2013-03-21 19:24:34 +01:00
|
|
|
#include <QObject>
|
2011-08-18 15:04:13 +02:00
|
|
|
|
2010-12-03 13:49:35 +01:00
|
|
|
namespace CppTools {
|
2014-09-15 00:12:27 +02:00
|
|
|
class CppModelManager;
|
2010-12-03 13:49:35 +01:00
|
|
|
|
2013-03-21 19:24:34 +01:00
|
|
|
class CPPTOOLS_EXPORT AbstractEditorSupport : public QObject
|
2010-12-03 13:49:35 +01:00
|
|
|
{
|
2013-03-21 19:24:34 +01:00
|
|
|
Q_OBJECT
|
2010-12-03 13:49:35 +01:00
|
|
|
public:
|
2016-01-15 16:12:54 +01:00
|
|
|
explicit AbstractEditorSupport(CppModelManager *modelmanager, QObject *parent = 0);
|
|
|
|
|
~AbstractEditorSupport();
|
2010-12-03 13:49:35 +01:00
|
|
|
|
2013-08-19 15:47:51 +02:00
|
|
|
/// \returns the contents, encoded as UTF-8
|
2010-12-03 13:49:35 +01:00
|
|
|
virtual QByteArray contents() const = 0;
|
|
|
|
|
virtual QString fileName() const = 0;
|
|
|
|
|
|
|
|
|
|
void updateDocument();
|
2015-05-18 09:35:29 +02:00
|
|
|
void notifyAboutUpdatedContents() const;
|
2013-11-25 15:22:58 +01:00
|
|
|
unsigned revision() const { return m_revision; }
|
2010-12-03 13:49:35 +01:00
|
|
|
|
|
|
|
|
static QString licenseTemplate(const QString &file = QString(), const QString &className = QString());
|
|
|
|
|
|
|
|
|
|
private:
|
2014-09-15 00:12:27 +02:00
|
|
|
CppModelManager *m_modelmanager;
|
2013-11-25 15:22:58 +01:00
|
|
|
unsigned m_revision;
|
2010-12-03 13:49:35 +01:00
|
|
|
};
|
|
|
|
|
|
2013-04-02 11:28:11 +02:00
|
|
|
} // namespace CppTools
|