]>
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
32 * @brief Helper class for SearchCriterionSelector.
33 * Represents an input widget for the value of a search criterion.
35 class SearchCriterionValue
: public QWidget
40 SearchCriterionValue(QWidget
* parent
= 0);
41 virtual ~SearchCriterionValue();
44 * Must be overwritten by derived classes and returns
45 * the string representation of the search criterion value.
47 virtual QString
value() const = 0;
50 * Initializes the widget on the base of the given value-type.
51 * It is in the hand of the derived classes to interprete
52 * the value-type string and create a corresponding value for
53 * the widget (@see SearchCriterionSelector::Comparator).
54 * The default implementation is empty.
56 virtual void initializeValue(const QString
& valueType
);
59 void valueChanged(const QString
& value
);
64 /** @brief Allows to input a date value as search criterion. */
65 class DateValue
: public SearchCriterionValue
70 DateValue(QWidget
* parent
= 0);
72 virtual QString
value() const;
73 virtual void initializeValue(const QString
& valueType
);
76 KDateWidget
* m_dateWidget
;
81 /** @brief Allows to input a tag as search criterion. */
82 class TagValue
: public SearchCriterionValue
87 TagValue(QWidget
* parent
= 0);
89 virtual QString
value() const;
92 virtual void showEvent(QShowEvent
* event
);
100 /** @brief Allows to input a file size value as search criterion. */
101 class SizeValue
: public SearchCriterionValue
106 SizeValue(QWidget
* parent
= 0);
107 virtual ~SizeValue();
108 virtual QString
value() const;
111 KLineEdit
* m_lineEdit
;
115 /** @brief Allows to input a rating value as search criterion. */
116 class RatingValue
: public SearchCriterionValue
121 RatingValue(QWidget
* parent
= 0);
122 virtual ~RatingValue();
123 virtual QString
value() const;
126 KRatingWidget
* m_ratingWidget
;
129 #endif // SEARCHCRITERIONVALUE_H