/*************************************************************************** Copyright 2008 Frederik Gladhorn ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef ENTRYFILTER_H #define ENTRYFILTER_H #include "ui_entryfilter.h" #include #include class KEduVocExpression; class KEduVocDocument; class KDialog; class EntryFilter :public QObject { Q_OBJECT public: EntryFilter(QObject * parent, KEduVocDocument *doc); ~EntryFilter(); /** * Returns the list of test entries after filtering out invalid entries according to the settings. * @return list of entries to practice */ QList entries(); private: /** * Called when starting a practice. * Looks if the time is up, if the work has been praced too long ago, it will drop in grade. * Only if expiring is activated in prefs. */ void expireEntries(); void lessonEntries(); void wordTypeEntries(); void blockedEntries(); void timesWrongEntries(); void timesPracticedEntries(); void minMaxGradeEntries(); void updateTotal(); /** * Remove entries that are empty or not of the right type for the specific test type */ void cleanupInvalid(); private slots: // void filterLesson(bool filter); void checkBoxChanged(bool filter); private: Ui::EntryFilter ui; QSet m_entries; QSet m_entriesLesson; QSet m_entriesWordType; QSet m_entriesBlocked; QSet m_entriesTimesWrong; QSet m_entriesTimesPracticed; QSet m_entriesMinMaxGrade; QSet m_currentSelection; KEduVocDocument *m_doc; int m_fromTranslation; int m_toTranslation; KDialog *m_dialog; }; #endif