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

parley

kvtlessonmodel.h

Go to the documentation of this file.
00001 /***************************************************************************
00002 
00003                              kvtlessonmodel
00004 
00005     -----------------------------------------------------------------------
00006 
00007     copyright     : (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
00008 
00009     -----------------------------------------------------------------------
00010 
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 
00022 #ifndef KVTLESSONMODEL_H
00023 #define KVTLESSONMODEL_H
00024 
00025 #include <QAbstractListModel>
00026 #include <QModelIndex>
00027 
00028 #include <QObject>
00029 
00030 #include <keduvocdocument.h>
00031 
00036 class KVTLessonModel : public QAbstractListModel
00037 {
00038     Q_OBJECT
00039 
00040 public:
00042     enum SplitLessonOrder {
00043         sorted,    
00044         random 
00045     };
00046 
00047     KVTLessonModel(QObject *parent = 0) : QAbstractListModel(parent)
00048     {
00049         m_doc = 0;
00050     }
00053     void setDocument(KEduVocDocument * doc);
00054     KEduVocDocument * document() const
00055     {
00056         return m_doc;
00057     }
00061     int rowCount(const QModelIndex &parent = QModelIndex()) const;
00063     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00067     Qt::ItemFlags flags(const QModelIndex &index) const;
00072     QVariant data(const QModelIndex &index, int role) const;
00073 
00079     bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
00080 //  bool newData(const QStringList &strings);
00081 
00082     int currentLesson() const
00083     {
00084         return m_doc->currentLesson();
00085     }
00086     void setCurrentLesson(int index)
00087     {
00088         m_doc->setCurrentLesson(index);
00089         setModified(true);
00090     } //move this into cpp?
00091     void setModified(bool modified)
00092     {
00093         m_doc->setModified(modified);
00094     }
00095 
00097     void setAllLessonsInPractice();
00099     void setNoLessonsInPractice();
00100 
00101     // add a lesson - returns lesson index
00102     int addLesson(const QString &lessonName = QString());
00103     // returns whether it was possible to delete
00104     bool deleteLesson(int lessonIndex, KEduVocDocument::LessonDeletion mode);
00105 
00106     Qt::DropActions supportedDropActions() const;
00107 
00108     bool removeRows(int row, int count, const QModelIndex &parent);
00109     bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent);
00110 
00111 
00119     void splitLesson(int lessonIndex, int entriesPerLesson, SplitLessonOrder order);
00120 //signals:
00121     //void signalLessonsInPracticeChanged(QList<int> intLessons);
00122 private:
00124     KEduVocDocument *m_doc;
00125 
00126 //public slots:
00127     //void slotLessonSelectionChanged(const QModelIndex &, const QModelIndex &);
00128 };
00129 
00130 #endif

parley

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

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal