aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/editordocumenthandle.h
blob: ef9b8403b58094a63608051a956ff3d36647b57b (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
39
40
41
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "cppeditor_global.h"

namespace Utils { class FilePath; }

namespace CppEditor {

class BaseEditorDocumentProcessor;

class CPPEDITOR_EXPORT CppEditorDocumentHandle
{
public:
    virtual ~CppEditorDocumentHandle();

    enum RefreshReason {
        None,
        ProjectUpdate,
        Other,
    };
    RefreshReason refreshReason() const;
    void setRefreshReason(const RefreshReason &refreshReason);

    // For the Working Copy
    virtual Utils::FilePath filePath() const = 0;
    virtual QByteArray contents() const = 0;
    virtual unsigned revision() const = 0;

    // For updating if new project info is set
    virtual BaseEditorDocumentProcessor *processor() const = 0;

    virtual void resetProcessor() = 0;

private:
    RefreshReason m_refreshReason = None;
};

} // CppEditor