1 /***************************************************************************
2                          qgslayertreelocatorfilters.h
3                          --------------------------
4     begin                : May 2017
5     copyright            : (C) 2017 by Nyall Dawson
6     email                : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef QGSLAYERTREELOCATORFILTERS_H
19 #define QGSLAYERTREELOCATORFILTERS_H
20 
21 #include "qgis_app.h"
22 #include "qgslocatorfilter.h"
23 
24 
25 
26 
27 
28 class APP_EXPORT QgsLayerTreeLocatorFilter : public QgsLocatorFilter
29 {
30     Q_OBJECT
31 
32   public:
33 
34     QgsLayerTreeLocatorFilter( QObject *parent = nullptr );
35     QgsLayerTreeLocatorFilter *clone() const override;
name()36     QString name() const override { return QStringLiteral( "layertree" ); }
displayName()37     QString displayName() const override { return tr( "Project Layers" ); }
priority()38     Priority priority() const override { return Highest; }
prefix()39     QString prefix() const override { return QStringLiteral( "l" ); }
flags()40     QgsLocatorFilter::Flags flags() const override { return QgsLocatorFilter::FlagFast; }
41 
42     void fetchResults( const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback ) override;
43     void triggerResult( const QgsLocatorResult &result ) override;
44 
45 };
46 
47 #endif // QGSLAYERTREELOCATORFILTERS_H
48