#ifndef SPACED_REPETITION_WINDOW_H #define SPACED_REPETITION_WINDOW_H #include #include #include "IStudyWindow.h" #include "StudyRecord.h" #include "StudySettings.h" #include "SpacedRepetitionModel.h" #include "CardSideView.h" class CardsStatusBar; class NumberFrame; class WarningPanel; class SpacedRepetitionWindow: public IStudyWindow { Q_OBJECT public: SpacedRepetitionWindow( SpacedRepetitionModel* aModel, QWidget* aParent ); ~SpacedRepetitionWindow(); protected: QVBoxLayout* createLowerPanel(); void processState(); void ReadSettings(); void WriteSettings(); QWidget* getAnswerEdit(); QWidget* getUserAnswerLabel(); private: static QString getProgressBarTooltip(); private: QBoxLayout* createProgressLayout(); QBoxLayout* createStatsLayout(); QBoxLayout* createProgressBarLayout(); void createGradeButtons(); QPushButton* createGradeButton(int i, const QString& iconName, const QString& label, const QString& toolTip); void setEnabledGradeButtons(); void layoutGradeButtons(); void putGradeButtonsIntoLayouts(QBoxLayout* higherLt); void replaceGradesLayout(QBoxLayout* higherLt); void setGoodButtonText(); void updateCardsProgress(); void displayAnswer(); void displayNoRemainedCards(); void showLimitWarnings(); bool dayLimitReached(int todayReviewed); void createExactAnswerWidget(); void showExactAnswer(const QStringList& correctAnswers); void focusAnswerWidget(); void processIsNewCard(); private slots: void displayQuestion(); private: static const int PosX = 200; static const int PosY = 200; static const int Width = 600; static const int Height = 430; static const int GradeButtonMinWidth = 100; private: bool dayCardsLimitShown; WarningPanel* warningPanel; QLabel* progressLabel; NumberFrame* todayNewLabel; NumberFrame* learningCardsLabel; QLabel* timeToNextLearningLabel; NumberFrame* scheduledCardsLabel; NumberFrame* scheduledNewLabel; QVBoxLayout* controlLt; CardsStatusBar* coloredProgressBar; QPushButton* gradeBtns[StudyRecord::GradesNum]; QPushButton* goodBtn; QSignalMapper* cardGradedSM; bool usesExactAnswer; CardSideView* exactAnswerLabel; QLineEdit* exactAnswerEdit; QTime m_answerTime; }; #endif