2 * SPDX-FileCopyrightText: 2019 Ismael Asensio <isma.af@mgmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
10 #include "dolphin_export.h"
16 * @brief Simple query model that parses a Baloo search Url and extracts its
17 * separate components to be displayed on dolphin search box.
22 /** Parses the components of @p searchUrl for the supported schemes */
23 static DolphinQuery
fromSearchUrl(const QUrl
&searchUrl
);
24 /** Checks whether the DolphinQuery supports the given @p urlScheme */
25 static bool supportsScheme(const QString
&urlScheme
);
27 /** @return the \a searchUrl passed to Baloo::Query::fromSearchUrl() */
28 QUrl
searchUrl() const;
29 /** @return the user text part of the query, to be shown in the searchbar */
31 /** @return the first of Baloo::Query::types(), or an empty string */
33 /** @return a list of the search terms of the Baloo::Query that act as a filter,
34 * such as \"rating>= <i>value<i>\" or \"modified>= <i>date<i>\"*/
35 QStringList
searchTerms() const;
36 /** @return Baloo::Query::includeFolder(), that is, the initial directory
37 * for the query or an empty string if its a global search" */
38 QString
includeFolder() const;
39 /** @return whether the query includes search in file content */
40 bool hasContentSearch() const;
41 /** @return whether the query includes a filter by fileName */
42 bool hasFileName() const;
45 /** Calls Baloo::Query::fromSearchUrl() on the current searchUrl
46 * and parses the result to extract its separate components */
47 void parseBalooQuery();
53 QStringList m_searchTerms
;
54 QString m_includeFolder
;
55 bool m_hasContentSearch
= false;
56 bool m_hasFileName
= false;
59 #endif //DOLPHINQUERY_H