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

parley

  • sources
  • kde-4.12
  • kdeedu
  • parley
  • src
  • vocabulary
vocabularymodel.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  Copyright 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
4 
5  ***************************************************************************/
6 
7 /***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef VOCABULARYMODEL_H
16 #define VOCABULARYMODEL_H
17 
18 #include <keduvocexpression.h>
19 #include <keduvoctranslation.h>
20 #include <QAbstractTableModel>
21 
22 class KEduVocDocument;
23 class KEduVocLesson;
24 
25 
26 namespace Editor {
30 class VocabularyModel : public QAbstractTableModel
31 {
32 Q_OBJECT
33 public:
34  enum entryColumns {
35  Translation = 0,
36  Pronunciation,
37  WordType,
38  Synonym,
39  Antonym,
40  Example,
41  Comment,
42  Paraphrase,
43 // Audio,
44 // Image,
45  EntryColumnsMAX
46 
47  };
48 
49  enum roles {
50  TranslationRole = Qt::UserRole,
51  EntryRole,
52  LocaleRole
53  };
54 
55  VocabularyModel(QObject *parent = 0);
56 
57  ~VocabularyModel();
58 
59 
60  int rowCount(const QModelIndex&) const;
61  int columnCount(const QModelIndex&) const;
62  QVariant data(const QModelIndex&, int) const;
63  bool setData(const QModelIndex &index, const QVariant &value, int role);
64  Qt::ItemFlags flags(const QModelIndex &index) const;
65 
66  QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
67 
71  static QString columnTitle(KEduVocDocument *document, int translation, int column);
72 
77  static int translation(int column);
78 
83  static int columnType(int column);
84 
85  QModelIndex appendEntry(KEduVocExpression *expression = 0);
86 
87  bool removeRows ( int row, int count, const QModelIndex & parent = QModelIndex() );
88 
89  QStringList mimeTypes() const;
90  QMimeData * mimeData(const QModelIndexList &indexes) const;
91 // bool dropMimeData(const QMimeData *data, Qt::DropAction action,
92 // int row, int column, const QModelIndex &parent);
93 
94  void resetLanguages();
95 
96 public slots:
97  void setDocument(KEduVocDocument *doc);
98 
103  void showContainer(KEduVocContainer *container);
104 
109  void setLesson(KEduVocLesson *lessonContainer);
110 
111  KEduVocLesson * lesson();
112 
117  void showEntriesOfSubcontainers(bool show);
118 
123  void automaticTranslation(bool enabled);
124 
125 
126 private:
127  KEduVocContainer *m_container;
128  KEduVocLesson *m_lesson;
129 
130  KEduVocDocument *m_document;
131  KEduVocContainer::EnumEntriesRecursive m_recursive;
132 };
133 }
134 Q_DECLARE_METATYPE(KEduVocExpression*)
135 
136 #endif
Editor::VocabularyModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: vocabularymodel.cpp:267
Editor::VocabularyModel::columnCount
int columnCount(const QModelIndex &) const
Definition: vocabularymodel.cpp:109
Editor::VocabularyModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const
Definition: vocabularymodel.cpp:248
Editor::VocabularyModel
Definition: vocabularymodel.h:30
Editor::VocabularyModel::entryColumns
entryColumns
Definition: vocabularymodel.h:34
Editor::VocabularyModel::TranslationRole
Definition: vocabularymodel.h:50
Editor::VocabularyModel::roles
roles
Definition: vocabularymodel.h:49
QObject
Editor::VocabularyModel::Example
Definition: vocabularymodel.h:40
Editor::VocabularyModel::VocabularyModel
VocabularyModel(QObject *parent=0)
Definition: vocabularymodel.cpp:35
Editor::VocabularyModel::translation
static int translation(int column)
Returns which translation this column matches.
Definition: vocabularymodel.cpp:313
Editor::VocabularyModel::showContainer
void showContainer(KEduVocContainer *container)
Whatever the contents, the model will now display it.
Definition: vocabularymodel.cpp:67
Editor::VocabularyModel::Pronunciation
Definition: vocabularymodel.h:36
Editor::VocabularyModel::data
QVariant data(const QModelIndex &, int) const
Definition: vocabularymodel.cpp:117
Editor::VocabularyModel::columnType
static int columnType(int column)
Returns the type of the column specified.
Definition: vocabularymodel.cpp:318
Editor::VocabularyModel::EntryColumnsMAX
Definition: vocabularymodel.h:45
Editor::VocabularyModel::showEntriesOfSubcontainers
void showEntriesOfSubcontainers(bool show)
Show the entries of child lessons in selected lessons.
Definition: vocabularymodel.cpp:389
Editor::VocabularyModel::EntryRole
Definition: vocabularymodel.h:51
QMimeData
Editor::VocabularyModel::Antonym
Definition: vocabularymodel.h:39
Editor::VocabularyModel::mimeTypes
QStringList mimeTypes() const
Definition: vocabularymodel.cpp:364
Editor::VocabularyModel::WordType
Definition: vocabularymodel.h:37
Editor::VocabularyModel::setDocument
void setDocument(KEduVocDocument *doc)
Definition: vocabularymodel.cpp:49
Editor::VocabularyModel::LocaleRole
Definition: vocabularymodel.h:52
Editor::VocabularyModel::mimeData
QMimeData * mimeData(const QModelIndexList &indexes) const
Definition: vocabularymodel.cpp:369
Editor::VocabularyModel::Translation
Definition: vocabularymodel.h:35
Editor::VocabularyModel::removeRows
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
Definition: vocabularymodel.cpp:346
Editor::VocabularyModel::lesson
KEduVocLesson * lesson()
Definition: vocabularymodel.cpp:91
Editor::VocabularyModel::setData
bool setData(const QModelIndex &index, const QVariant &value, int role)
Definition: vocabularymodel.cpp:212
Editor::VocabularyModel::Paraphrase
Definition: vocabularymodel.h:42
Editor::VocabularyModel::setLesson
void setLesson(KEduVocLesson *lessonContainer)
Definition: vocabularymodel.cpp:86
Editor::VocabularyModel::Synonym
Definition: vocabularymodel.h:38
Editor::VocabularyModel::automaticTranslation
void automaticTranslation(bool enabled)
Set automatic translation to enabled/disabled.
Definition: vocabularymodel.cpp:406
Editor::VocabularyModel::appendEntry
QModelIndex appendEntry(KEduVocExpression *expression=0)
Definition: vocabularymodel.cpp:323
Editor::VocabularyModel::columnTitle
static QString columnTitle(KEduVocDocument *document, int translation, int column)
Returns the name of the entryColumns column.
Definition: vocabularymodel.cpp:286
Editor::VocabularyModel::~VocabularyModel
~VocabularyModel()
Definition: vocabularymodel.cpp:45
Editor::VocabularyModel::rowCount
int rowCount(const QModelIndex &) const
Definition: vocabularymodel.cpp:96
Editor::VocabularyModel::Comment
Definition: vocabularymodel.h:41
QAbstractTableModel
Editor::VocabularyModel::resetLanguages
void resetLanguages()
Definition: vocabularymodel.cpp:400
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:06 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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