blob: 0a7e633c3ddca681f2e47aeb2f8b3c4bcbc67595 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include "cppeditor_global.h"
#include <QString>
#include <QObject>
namespace CppEditor {
class CppModelManager;
class CPPEDITOR_EXPORT AbstractEditorSupport : public QObject
{
Q_OBJECT
public:
explicit AbstractEditorSupport(CppModelManager *modelmanager, QObject *parent = nullptr);
~AbstractEditorSupport() override;
/// \returns the contents, encoded as UTF-8
virtual QByteArray contents() const = 0;
virtual QString fileName() const = 0;
virtual QString sourceFileName() const = 0;
void updateDocument();
void notifyAboutUpdatedContents() const;
unsigned revision() const { return m_revision; }
static QString licenseTemplate(const QString &file = QString(), const QString &className = QString());
static bool usePragmaOnce();
private:
CppModelManager *m_modelmanager;
unsigned m_revision;
};
} // namespace CppEditor
|