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

libkdeedu/keduvocdocument

keduvocdocument.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                    Vocabulary Document for KDE Edu
00003     -----------------------------------------------------------------------
00004     copyright     : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
00005 
00006                     (C) 2005, 2007 Peter Hedlund <peter.hedlund@kdemail.net>
00007                     (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef KEDUVOCDOCUMENT_H
00020 #define KEDUVOCDOCUMENT_H
00021 
00022 #include "libkeduvocdocument_export.h"
00023 
00024 #include "keduvocidentifier.h"
00025 #include "keduvocgrammar.h"
00026 #include "keduvocconjugation.h"
00027 
00028 #include <QtCore/QObject>
00029 #include <QtCore/QList>
00030 #include <QtCore/QMap>
00031 
00032 #include <KDE/KUrl>
00033 
00034 class QStringList;
00035 class KEduVocExpression;
00036 class KEduVocLesson;
00037 class KEduVocWordType;
00038 
00043 class KEDUVOCDOCUMENT_EXPORT KEduVocDocument : public QObject
00044 {
00045     Q_OBJECT
00046 public:
00047 
00049     enum FileType {
00050         KvdNone,
00051         Automatic,
00052         Kvtml,
00053         Wql,
00054         Pauker,
00055         Vokabeln,
00056         Xdxf,
00057         Csv,
00058         Kvtml1
00059     };
00060 
00062     enum ErrorCode {
00063         NoError = 0,
00064         Unknown,
00065         InvalidXml,
00066         FileTypeUnknown,
00067         FileCannotWrite,
00068         FileWriterFailed,
00069         FileCannotRead,
00070         FileReaderFailed,
00071         FileDoesNotExist
00072     };
00073 
00075     enum FileDialogMode
00076     {
00077         Reading,
00078         Writing
00079     };
00080 
00082     enum LessonDeletion
00083     {
00084         DeleteEmptyLesson,
00085         DeleteEntriesAndLesson
00086     };
00087 
00093     explicit KEduVocDocument( QObject* parent = 0 );
00094 
00098     ~KEduVocDocument();
00099 
00100     // *** whole document methods ***
00101 
00108     int open( const KUrl& url );
00109 
00118     int saveAs( const KUrl & url, FileType ft, const QString & generator );
00119 
00127     void merge( KEduVocDocument *docToMerge, bool matchIdentifiers );
00128 
00134     void setModified( bool dirty = true );
00135 
00137     bool isModified() const;
00138 
00142     void setUrl( const KUrl& url );
00143 
00145     KUrl url() const;
00146 
00147 
00150     void setTitle( const QString & title );
00151 
00153     QString title() const;
00154 
00157     void setAuthor( const QString & author );
00158 
00160     QString author() const;
00161 
00164     void setLicense( const QString & license );
00165 
00167     QString license() const;
00168 
00171     void setDocumentComment( const QString & comment );
00172 
00174     QString documentComment() const;
00175 
00178     void setCategory( const QString & category );
00179 
00181     QString category() const;
00182 
00186     void setGenerator( const QString & generator );
00187 
00189     QString generator() const;
00190 
00193     void setVersion( const QString & ver );
00194 
00196     QString version() const;
00197 
00198 
00199     // *** entry methods ***
00200 
00206     void appendEntry( KEduVocExpression *expression );
00207 
00214     void insertEntry( KEduVocExpression *expression, int index );
00215 
00221     void removeEntry( int index );
00222 
00226     void shuffle();
00227 
00233     int cleanUp();
00234 
00238     int entryCount() const;
00239 
00246     int sizeHint( int index ) const;
00247 
00254     void setSizeHint( int index, const int width );
00255 
00256     // *** identifier methods ***
00257 
00261     int identifierCount() const;
00262 
00269     int appendIdentifier( const KEduVocIdentifier & identifier = KEduVocIdentifier());
00270 
00277     void setIdentifier( int index, const KEduVocIdentifier& lang );
00278 
00285     KEduVocIdentifier& identifier( int index );
00286 
00292     void removeIdentifier( int index );
00293 
00300     int indexOfIdentifier( const QString &name ) const;
00301 
00302     // *** type methods ***
00303 
00309     KEduVocWordType& wordTypes();
00310 
00311 
00312     // *** tense methods ***
00313 
00320     void setTenseName( int index, QString &str );
00321 
00328     QString tenseName( int index ) const;
00329 
00333     void setTenseDescriptions( const QStringList &names );
00334 
00338     QStringList tenseDescriptions() const;
00339 
00340     // *** usage methods ***
00341 
00347     QStringList usages() const;
00348 
00354     void addUsage( const QString &usage );
00355 
00363     void renameUsage( const QString &oldName, const QString &newName );
00364 
00371     void removeUsage( const QString &name );
00372 
00373     // *** grade methods ***
00374 
00382     void resetEntry( int index = -1, int lesson = 0 );
00383 
00390     KEduVocExpression *entry( int index );
00391 
00392 
00400     KDE_DEPRECATED void queryIdentifier( QString &org, QString &trans ) const;
00401 
00409     KDE_DEPRECATED void setQueryIdentifier( const QString &org, const QString &trans );
00410 
00411     // *** lesson methods ***
00412 
00416     int currentLesson() const;
00417 
00422     void setCurrentLesson( int lesson );
00423 
00428     KEduVocLesson & lesson( int index );
00429 
00433     QList<KEduVocLesson> & lessons() const;
00434 
00438     int lessonCount() const;
00439 
00445     int appendLesson( const QString &lessonName, bool inQuery=true );
00446 
00453     bool removeLesson( int lessonIndex, int deleteMode );
00454 
00459     KDE_DEPRECATED QStringList lessonNames() const;
00460 
00466     void moveLesson(int from, int to);
00467 
00468     // *** file format specific methods ***
00469 
00476     QString csvDelimiter() const;
00477 
00483     void setCsvDelimiter( const QString &delimiter );
00484 
00485     static FileType detectFileType( const QString &fileName );
00486 
00495     static QString pattern( FileDialogMode mode );
00496 
00497     static QString errorDescription( int errorCode );
00498 
00499 Q_SIGNALS:
00500     void progressChanged( KEduVocDocument *, int curr_percent );
00501 
00506     void docModified( bool mod );
00507 
00508 private:
00509     // The private data of this - see KEduVocDocument::Private, implemented in keduvocdocument.cpp
00510     class KEduVocDocumentPrivate;
00511     KEduVocDocumentPrivate* const d;
00512 
00513     Q_DISABLE_COPY( KEduVocDocument )
00514 };
00515 
00516 
00517 #endif // KEDUVOCDOCUMENT_H

libkdeedu/keduvocdocument

Skip menu "libkdeedu/keduvocdocument"
  • 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