aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/editordocumenthandle.h
blob: fdb8da28f6067d13013bb984d0239329e96f42f2 (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
42
43
44
45
// 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 "senddocumenttracker.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;

    SendDocumentTracker &sendTracker();

private:
    SendDocumentTracker m_sendTracker;
    RefreshReason m_refreshReason = None;
};

} // CppEditor