aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/classview/classviewmanager.h
blob: 0df20995270215bf649ceaaf82b18429312de591 (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
46
47
// Copyright (C) 2016 Denis Mingulov
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <QObject>
#include <QStandardItem>

namespace Utils { class FilePath; }

namespace ClassView::Internal {

class ManagerPrivate;

class Manager final : public QObject
{
    Q_OBJECT
public:
    explicit Manager(QObject *parent);
    ~Manager() final;

    static Manager *instance();

    bool canFetchMore(QStandardItem *item, bool skipRoot = false) const;
    void fetchMore(QStandardItem *item, bool skipRoot = false);
    bool hasChildren(QStandardItem *item) const;

    void gotoLocation(const Utils::FilePath &filePath, int line = 0, int column = 0);
    void gotoLocations(const QList<QVariant> &locations);
    void setFlatMode(bool flat);
    void onWidgetVisibilityIsChanged(bool visibility);

signals:
    void treeDataUpdate(std::shared_ptr<QStandardItem> result);

private:
    void initialize();

    inline bool state() const;
    void setState(bool state);

    ManagerPrivate *d;
};

void setupClassViewManager(QObject *guard);

} // ClassView::Internal