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

parley

kvttablemodel.h

Go to the documentation of this file.
00001 /***************************************************************************
00002 
00003                              kvttablemodel
00004 
00005     -----------------------------------------------------------------------
00006 
00007     copyright     : (C) 2006 Peter Hedlund <peter.hedlund@kdemail.net>
00008                     (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
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 KVTTABLEMODEL_H
00023 #define KVTTABLEMODEL_H
00024 
00025 #include <QAbstractTableModel>
00026 #include <QPixmap>
00027 
00028 #include <keduvocdocument.h>
00029 
00030 #define KV_COL_LESS      0   // col: lesson number
00031 #define KV_COL_MARK      1   // col: mark
00032 #define KV_COL_TRANS     2   // col: first translation
00033 
00034 // To enable use of KEduVocExpression* in a QVariant
00035 // Q_DECLARE_METATYPE ( KEduVocExpression* )
00036 
00041 class KVTTableModel : public QAbstractTableModel
00042 {
00043     Q_OBJECT
00044 public:
00045 
00046     enum KVTItemDataRole {
00047         LessonsRole = Qt::UserRole + 1,
00048         LessonRole,
00049         StateRole,
00050         GradeRole,
00051         LocaleRole
00052 //         ExpressionRole
00053     };
00054 
00055     KVTTableModel(QObject *parent = 0);
00056 
00057     void setDocument(KEduVocDocument * doc);
00058     KEduVocDocument * document() const
00059     {
00060         return m_doc;
00061     }
00062 
00063     bool insertRows(int row, int count = 1, const QModelIndex &parent = QModelIndex());
00064     bool removeRows(int row, int count = 1, const QModelIndex &parent = QModelIndex());
00065 
00069     void appendTranslation();
00070 
00076     bool removeTranslation(int translationIndex);
00077 
00078     int rowCount(const QModelIndex &parent) const;
00079     int columnCount(const QModelIndex &parent) const;
00080 
00081     QVariant data(const QModelIndex &index, int role) const;
00082     QVariant headerData(int section, Qt::Orientation orientation, int role) const;
00083 
00084     Qt::ItemFlags flags(const QModelIndex &index) const;
00085     bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
00086     bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
00087 
00088 public slots:
00089     void dataChangedFromOutside(const QModelIndex& topLeft, const QModelIndex& bottomRight);
00090     void appendEntry();
00091 
00092     void loadLanguageSettings();
00093 
00094 private:
00095     KEduVocDocument * m_doc;
00096     QPixmap m_pixInactive;
00097     QPixmap m_pixInQuery;
00098     QMap<int, QPixmap> m_headerPixmaps;
00099 
00100     friend class ParleyApp;
00101     friend class KVTStatisticsDialog;
00102 };
00103 
00104 #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