gitgrep.h 2.32 KB
Newer Older
Orgad Shaneh's avatar
Orgad Shaneh committed
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
/****************************************************************************
**
** Copyright (C) 2016 Orgad Shaneh <orgads@gmail.com>.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/

Tobias Hunger's avatar
Tobias Hunger committed
26
#pragma once
Orgad Shaneh's avatar
Orgad Shaneh committed
27
28
29

#include <texteditor/basefilefind.h>

30
#include <QCoreApplication>
Orgad Shaneh's avatar
Orgad Shaneh committed
31

32
QT_FORWARD_DECLARE_CLASS(QCheckBox)
Orgad Shaneh's avatar
Orgad Shaneh committed
33

34
35
namespace Utils { class FancyLineEdit; }

Orgad Shaneh's avatar
Orgad Shaneh committed
36
37
38
namespace Git {
namespace Internal {

39
class GitGrep : public TextEditor::FileFindExtension
Orgad Shaneh's avatar
Orgad Shaneh committed
40
{
41
    Q_DECLARE_TR_FUNCTIONS(GitGrep)
Orgad Shaneh's avatar
Orgad Shaneh committed
42
43

public:
44
45
46
    GitGrep();
    ~GitGrep() override;
    QString title() const override;
47
    QString toolTip() const override;
48
49
50
51
52
53
    QWidget *widget() const override;
    bool isEnabled() const override;
    bool isEnabled(const TextEditor::FileFindParameters &parameters) const override;
    QVariant parameters() const override;
    void readSettings(QSettings *settings) override;
    void writeSettings(QSettings *settings) const override;
Orgad Shaneh's avatar
Orgad Shaneh committed
54
55
    QFuture<Utils::FileSearchResultList> executeSearch(
            const TextEditor::FileFindParameters &parameters) override;
56
57
    Core::IEditor *openEditor(const Core::SearchResultItem &item,
                              const TextEditor::FileFindParameters &parameters) override;
Orgad Shaneh's avatar
Orgad Shaneh committed
58
59

private:
60
61
62
    QWidget *m_widget;
    QCheckBox *m_enabledCheckBox;
    Utils::FancyLineEdit *m_treeLineEdit;
Orgad Shaneh's avatar
Orgad Shaneh committed
63
64
65
66
};

} // namespace Internal
} // namespace Git