]>
cloud.milkyroute.net Git - dolphin.git/blob - src/search/searchcriterionvalue.h
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 SEARCHCRITERIONVALUE_H
22 #define SEARCHCRITERIONVALUE_H
24 #define DISABLE_NEPOMUK_LEGACY
25 #include <nepomuk/literalterm.h>
35 * @brief Helper class for SearchCriterionSelector.
36 * Represents an input widget for the value of a search criterion.
38 class SearchCriterionValue
: public QWidget
43 SearchCriterionValue(QWidget
* parent
= 0);
44 virtual ~SearchCriterionValue();
47 * Must be overwritten by derived classes and returns
48 * the literal term of the search criterion value.
50 virtual Nepomuk::Query::LiteralTerm
value() const = 0;
53 * Initializes the widget on the base of the given value-type.
54 * It is in the hand of the derived classes to interprete
55 * the value-type string and create a corresponding value for
56 * the widget (@see SearchCriterionSelector::Comparator).
57 * The default implementation is empty.
59 virtual void initializeValue(const QString
& valueType
);
62 void valueChanged(const Nepomuk::Query::LiteralTerm
& value
);
67 /** @brief Allows to input a date value as search criterion. */
68 class DateValue
: public SearchCriterionValue
73 DateValue(QWidget
* parent
= 0);
75 virtual Nepomuk::Query::LiteralTerm
value() const;
76 virtual void initializeValue(const QString
& valueType
);
79 KDateWidget
* m_dateWidget
;
84 /** @brief Allows to input a tag as search criterion. */
85 class TagValue
: public SearchCriterionValue
90 TagValue(QWidget
* parent
= 0);
92 virtual Nepomuk::Query::LiteralTerm
value() const;
95 virtual void showEvent(QShowEvent
* event
);
103 /** @brief Allows to input a file size value as search criterion. */
104 class SizeValue
: public SearchCriterionValue
109 SizeValue(QWidget
* parent
= 0);
110 virtual ~SizeValue();
111 virtual Nepomuk::Query::LiteralTerm
value() const;
114 KLineEdit
* m_lineEdit
;
118 /** @brief Allows to input a rating value as search criterion. */
119 class RatingValue
: public SearchCriterionValue
124 RatingValue(QWidget
* parent
= 0);
125 virtual ~RatingValue();
126 virtual Nepomuk::Query::LiteralTerm
value() const;
129 KRatingWidget
* m_ratingWidget
;
132 #endif // SEARCHCRITERIONVALUE_H