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
27 class SearchCriterionValue
;
31 * @brief Helper class for SearchCriterionSelector.
33 * Describes a search criterion including the used
36 class SearchCriterionDescription
41 Comparator(const QString
& n
, const QString
& o
= QString(),
42 const QString
& p
= QString(), const QString
& a
= QString()) :
43 name(n
), operation(o
), prefix(p
), autoValueType(a
) {}
44 QString name
; // user visible and translated name
45 QString operation
; // Nepomuk operation that represents the comparator
46 QString prefix
; // prefix like "+" or "-" that is part of the Nepomuk query
47 QString autoValueType
; // type for an automatically calculated value of the value widget
50 SearchCriterionDescription(const QString
& name
,
51 const QString
& identifier
,
52 const QList
<Comparator
>& comparators
,
53 SearchCriterionValue
* valueWidget
);
55 virtual ~SearchCriterionDescription();
58 QString
identifier() const;
59 const QList
<Comparator
>& comparators() const;
60 SearchCriterionValue
* valueWidget() const;
63 QString m_name
; // user visible name that gets translated
64 QString m_identifier
; // internal Nepomuk identifier
65 QList
<Comparator
> m_comparators
;
66 SearchCriterionValue
* m_valueWidget
;
69 #endif // SEARCHCRITERIONDESCRIPTION_H