• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • collection
entryfilter.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
3  ***************************************************************************/
4 
5 /***************************************************************************
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  ***************************************************************************/
13 
14 #ifndef ENTRYFILTER_H
15 #define ENTRYFILTER_H
16 
17 #include "ui_entryfilter.h"
18 
19 #include <QtCore/QList>
20 #include <QtCore/QSet>
21 #include <prefs.h>
22 
23 class KEduVocText;
24 class KEduVocTranslation;
25 class KEduVocExpression;
26 class KEduVocDocument;
27 class KDialog;
28 class TestEntry;
29 
30 
31 class EntryFilter
32  : public QObject
33 {
34  Q_OBJECT
35 public:
36  EntryFilter(KEduVocDocument *doc, QObject *parent);
37 
48  QList<TestEntry*> entries(bool showDialog = true);
49 
50 private:
51  void collectEntries(int setNo);
52 
58  void expireEntries(int setNo);
59 
60  void lessonEntries(int setNo);
61  void wordTypeEntries(int setNo);
62 
63  bool isBlocked(const KEduVocText* const grade) const;
64  bool isConjugationBlocked(KEduVocTranslation* translation) const;
65  void blockedEntries(int setNo);
66  void timesWrongEntries(int setNo);
67  void timesPracticedEntries(int setNo);
68  void minMaxGradeEntries(int setNo);
69 
70  void updateTotal();
71 
75  void cleanupInvalid(int setNo);
76 
82  QList<TestEntry*> conjugationTestEntries(bool ignoreBlocked) const;
83 
84  static void randomizedInsert(QList<TestEntry*>& list, TestEntry* entry);
85 
86 private slots:
87  void checkBoxChanged(bool filter);
88 
89 private:
90  Ui::EntryFilter ui;
91  KEduVocDocument *m_doc;
92 
93  // All entries that are valid given all criteria
94  QSet<KEduVocExpression*> m_entries[2];
95 
96  // Various sets of entries that are valid given only one criterium each.
97  // These are used in the selection dialog if there are no totally valid entries.
98  QSet<KEduVocExpression*> m_entriesLesson[2];
99  QSet<KEduVocExpression*> m_entriesWordType[2];
100  QSet<KEduVocExpression*> m_entriesNotBlocked[2];
101  QSet<KEduVocExpression*> m_entriesTimesWrong[2];
102  QSet<KEduVocExpression*> m_entriesTimesPracticed[2];
103  QSet<KEduVocExpression*> m_entriesMinMaxGrade[2];
104 
105  int m_numSets;
106  int m_fromTranslation;
107  int m_toTranslation;
108 
109  // The tenses selected by the user for practice
110  QStringList m_tenses;
111 
112  KDialog *m_dialog;
113  QSet<KEduVocExpression*> m_currentSelection[2];
114 };
115 
116 
117 #endif
118 
EntryFilter
Definition: entryfilter.h:31
EntryFilter::EntryFilter
EntryFilter(KEduVocDocument *doc, QObject *parent)
Definition: entryfilter.cpp:50
KDialog
prefs.h
QObject
QSet< KEduVocExpression * >
QList< TestEntry * >
QStringList
QObject::parent
QObject * parent() const
EntryFilter::entries
QList< TestEntry * > entries(bool showDialog=true)
Returns the list of test entries after filtering out invalid entries according to the settings...
Definition: entryfilter.cpp:71
TestEntry
Definition: testentry.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal