aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/todo/todoitemsscanner.h
blob: 61374d1ddf83a5b778b7e6857925c229462e7ea9 (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
// Copyright (C) 2016 Dmitry Savchenko
// Copyright (C) 2016 Vasiliy Sorokin
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "todoitem.h"
#include "keyword.h"

#include <QObject>

namespace Todo {
namespace Internal {

// TodoItemsScanner is an abstract class

class TodoItemsScanner : public QObject
{
    Q_OBJECT

public:
    explicit TodoItemsScanner(const KeywordList &keywordList, QObject *parent = nullptr);
    void setParams(const KeywordList &keywordList);

signals:
    void itemsFetched(const QString &fileName, const QList<TodoItem> &items);

protected:
    KeywordList m_keywordList;

    // Descendants can override and make a request for full rescan here if needed
    virtual void scannerParamsChanged() = 0;

    void processCommentLine(const QString &fileName, const QString &comment,
                            unsigned lineNumber, QList<TodoItem> &outItemList);
};

}
}