1 /***************************************************************************
2 * Copyright (C) 2009 by Adam Kidder <thekidder@gmail.com> *
3 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
21 #ifndef SEARCHCRITERIONDESCRIPTION_H
22 #define SEARCHCRITERIONDESCRIPTION_H
24 #define DISABLE_NEPOMUK_LEGACY
25 #include <nepomuk/comparisonterm.h>
31 class SearchCriterionValue
;
34 * @brief Helper class for SearchCriterionSelector.
36 * Describes a search criterion including the used
39 class SearchCriterionDescription
44 Comparator(const QString
& n
) :
47 value(Nepomuk::Query::ComparisonTerm::Smaller
),
52 Comparator(const QString
& n
, Nepomuk::Query::ComparisonTerm::Comparator c
,
53 const QString
& a
= QString()) :
61 QString name
; // user visible and translated name
63 Nepomuk::Query::ComparisonTerm::Comparator value
;
64 QString autoValueType
; // type for an automatically calculated value of the value widget
67 SearchCriterionDescription(const QString
& name
,
68 const QUrl
& identifier
,
69 const QList
<Comparator
>& comparators
,
70 SearchCriterionValue
* valueWidget
);
72 virtual ~SearchCriterionDescription();
75 QUrl
identifier() const;
76 const QList
<Comparator
>& comparators() const;
77 SearchCriterionValue
* valueWidget() const;
80 QString m_name
; // user visible name that gets translated
81 QUrl m_identifier
; // internal Nepomuk identifier URL
82 QList
<Comparator
> m_comparators
;
83 SearchCriterionValue
* m_valueWidget
;
86 #endif // SEARCHCRITERIONDESCRIPTION_H