Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
PackEditorModel Class Reference
Inheritance diagram for PackEditorModel:
Collaboration diagram for PackEditorModel:

Signals

void openedChanged ()
 
void fileNameChanged ()
 
void savedChanged ()
 
void readOnlyChanged ()
 
void lessonChanged ()
 
void sublessonChanged ()
 
void exerciseChanged ()
 
void lessonListChanged ()
 
void sublessonListChanged ()
 
void exerciseListChanged ()
 
void currentTextChanged ()
 
void currentRawTextChanged ()
 
void currentRepeatTypeChanged ()
 
void currentLengthLimitChanged ()
 
void currentLineLengthChanged ()
 
void currentLessonDescriptionChanged ()
 
void unusedSublessonsChanged ()
 
void canRemoveChanged ()
 

Public Member Functions

 PackEditorModel (QObject *parent=nullptr)
 
const QString & fileName () const
 
void setFileName (const QString &newFileName)
 
bool opened () const
 
bool saved () const
 
bool readOnly () const
 
int lesson () const
 
void setLesson (int newLesson)
 
int sublesson () const
 
void setSublesson (int newSublesson)
 
int exercise () const
 
void setExercise (int newExercise)
 
const QStringList & lessonList () const
 
const QStringList & sublessonList () const
 
const QStringList & exerciseList () const
 
QString currentText () const
 
QString currentRawText () const
 
void setCurrentRawText (const QString &newRawText)
 
QString currentRepeatType () const
 
void setCurrentRepeatType (const QString &newRepeatType)
 
int currentLengthLimit () const
 
void setCurrentLengthLimit (int newLengthLimit)
 
int currentLineLength () const
 
void setCurrentLineLength (int newLineLength)
 
QString currentLessonDescription () const
 
void setCurrentLessonDescription (const QString &newLessonDescription)
 
QList< int > unusedSublessons () const
 
bool canRemove () const
 
Q_INVOKABLE void newFile ()
 
Q_INVOKABLE void open ()
 
Q_INVOKABLE bool save ()
 
Q_INVOKABLE bool saveAs (const QString &fileName)
 
Q_INVOKABLE void nextExercise ()
 
Q_INVOKABLE void previousExercise ()
 
Q_INVOKABLE QString sublessonName (int id)
 
Q_INVOKABLE void addLesson ()
 
Q_INVOKABLE void addSublesson (int id)
 
Q_INVOKABLE void addExercise ()
 
Q_INVOKABLE void removeCurrentExercise ()
 

Properties

QString fileName
 
bool opened
 
bool saved
 
bool readOnly
 
int lesson
 
int sublesson
 
int exercise
 
QStringList lessonList
 
QStringList sublessonList
 
QStringList exerciseList
 
QString currentText
 
QString currentRawText
 
QString currentRepeatType
 
int currentLengthLimit
 
int currentLineLength
 
QString currentLessonDescription
 
QList< int > unusedSublessons
 
bool canRemove
 

Private Member Functions

void init ()
 
void nextSublesson ()
 
void previousSublesson ()
 
void nextLesson (bool updateExList=true)
 
void previousLesson (bool updateExList=true)
 
void updateLists ()
 
void updateLessonList ()
 
void updateSublessonList ()
 
void updateExerciseList ()
 
void updateAbsoluteSublesson ()
 
void setAbsoluteSublesson (int absoluteSublesson)
 
void deleteExerciseLine (int lesson, int sublesson, int exercise)
 
void editExercise (bool repeat, const QString &repeatType, int repeatLimit, int lineLength, const QString &desc, const QString &rawText)
 
void moveExercise (int lesson, int sublesson, int exercise, int newLesson, int newSublesson, int newExercise)
 
void moveLesson (int lesson, int newLesson)
 

Private Attributes

std::shared_ptr< IConfigParserm_parser = nullptr
 
QString m_fileName
 
bool m_opened = false
 
bool m_saved = false
 
bool m_readOnly = false
 
int m_lesson = 0
 
int m_sublesson = 0
 
int m_absoluteSublesson = 0
 
int m_exercise = 0
 
QStringList m_lessonList
 
QStringList m_sublessonList
 
QStringList m_exerciseList
 

The documentation for this class was generated from the following files: