1 /***************************************************************************
2 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef DOLPHINSEARCHOPTIONSCONFIGURATOR_H
21 #define DOLPHINSEARCHOPTIONSCONFIGURATOR_H
29 class SearchCriterionSelector
;
34 * @brief Allows the user to configure a search query for Nepomuk.
36 class DolphinSearchOptionsConfigurator
: public QWidget
41 DolphinSearchOptionsConfigurator(QWidget
* parent
= 0);
42 virtual ~DolphinSearchOptionsConfigurator();
45 * Returns the sum of the configured options and the
46 * custom search query as Nepomuk URL.
47 * @see DolphinSearchOptionsConfigurator::setCustomSearchQuery()
49 KUrl
nepomukUrl() const;
53 * Sets a custom search query that is added to the
54 * search query defined by the search options configurator.
55 * This is useful if a custom search user interface is
56 * offered outside the search options configurator.
58 void setCustomSearchQuery(const QString
& searchQuery
);
61 void searchOptionsChanged();
64 virtual void showEvent(QShowEvent
* event
);
67 void slotAddSelectorButtonClicked();
68 void slotCriterionChanged();
69 void removeCriterion();
72 * Updates the 'enabled' property of the selector button
73 * dependent from the number of existing selectors.
75 void updateSelectorButton();
78 * Saves the current query by adding it as Places entry.
84 * Adds the new search description selector to the bottom
87 void addCriterion(SearchCriterionSelector
* selector
);
90 * Returns true, DolphinSearchOptionsConfigurator::nepomukUrl()
91 * contains at least 1 search parameter.
93 bool hasSearchParameters() const;
97 KComboBox
* m_locationBox
;
99 QPushButton
* m_addSelectorButton
;
100 QPushButton
* m_searchButton
;
101 QPushButton
* m_saveButton
;
102 QVBoxLayout
* m_vBoxLayout
;
103 QList
<SearchCriterionSelector
*> m_criterions
;
104 QString m_customSearchQuery
;