File indexing completed on 2022-11-29 13:00:37

0001 /*
0002     SPDX-FileCopyrightText: 2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef WORDTYPEVIEW_H
0007 #define WORDTYPEVIEW_H
0008 
0009 #include "containerview.h"
0010 
0011 class QAction;
0012 class KSelectAction;
0013 class KEduVocWordType;
0014 class KEduVocExpression;
0015 namespace Editor
0016 {
0017 class EditorWindow;
0018 
0019 class WordTypeView : public ContainerView
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     explicit WordTypeView(EditorWindow *parent);
0025 
0026 public Q_SLOTS:
0027     /** Append a word type to the model and automatically set an edit up so the user can change "New lesson" into something meaningful.*/
0028     void slotCreateNewWordType();
0029 
0030     /** Remove a word type. */
0031     void slotDeleteWordType();
0032 
0033     void setTranslation(KEduVocExpression *entry, int translationId);
0034 
0035 Q_SIGNALS:
0036     void selectedWordTypeChanged(KEduVocWordType *wordType);
0037 
0038 protected:
0039     void contextMenuEvent(QContextMenuEvent *event) override;
0040 
0041 private Q_SLOTS:
0042     void setWordTypeNone();
0043     void setWordTypeNoun();
0044     void setWordTypeNounMale();
0045     void setWordTypeNounFemale();
0046     void setWordTypeNounNeutral();
0047     void setWordTypeAdjective();
0048     void setWordTypeAdverb();
0049     void setWordTypeVerb();
0050     void setWordTypeConjunction();
0051 
0052 private:
0053     QAction *m_actionNewWordType{nullptr};
0054     QAction *m_actionDeleteWordType{nullptr};
0055     QAction *m_actionRenameWordType{nullptr};
0056     KSelectAction *m_actionSpecialTypeMenu{nullptr};
0057 
0058     QAction *m_noneAction{nullptr};
0059     QAction *m_separator{nullptr};
0060     QAction *m_nounAction{nullptr};
0061     QAction *m_nounMaleAction{nullptr};
0062     QAction *m_nounFemaleAction{nullptr};
0063     QAction *m_nounNeutralAction{nullptr};
0064     QAction *m_adjectiveAction{nullptr};
0065     QAction *m_adverbAction{nullptr};
0066     QAction *m_verbAction{nullptr};
0067     QAction *m_conjunctionAction{nullptr};
0068 };
0069 }
0070 
0071 #endif