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

libkdeedu/keduvocdocument

  • sources
  • kde-4.12
  • kdeedu
  • libkdeedu
  • keduvocdocument
keduvocdocument.h
Go to the documentation of this file.
1 /***************************************************************************
2  Vocabulary Document for KDE Edu
3  -----------------------------------------------------------------------
4  copyright : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
5 
6  (C) 2005, 2007 Peter Hedlund <peter.hedlund@kdemail.net>
7  (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #ifndef KEDUVOCDOCUMENT_H
20 #define KEDUVOCDOCUMENT_H
21 
22 #include "libkeduvocdocument_export.h"
23 
24 #include "keduvocidentifier.h"
25 #include "keduvocarticle.h"
26 #include "keduvocconjugation.h"
27 
28 #include <QtCore/QObject>
29 #include <QtCore/QList>
30 #include <QtCore/QMap>
31 
32 #include <KDE/KUrl>
33 
34 class QStringList;
35 class KEduVocExpression;
36 class KEduVocLesson;
37 class KEduVocWordType;
38 class KEduVocLeitnerBox;
39 
44 class KEDUVOCDOCUMENT_EXPORT KEduVocDocument : public QObject
45 {
46  Q_OBJECT
47 public:
48 
50  enum FileType {
51  KvdNone,
52  Automatic,
53  Kvtml,
54  Wql,
55  Pauker,
56  Vokabeln,
57  Xdxf,
58  Csv,
59  Kvtml1
60  };
61 
63  enum ErrorCode {
64  NoError = 0,
65  Unknown,
66  InvalidXml,
67  FileTypeUnknown,
68  FileCannotWrite,
69  FileWriterFailed,
70  FileCannotRead,
71  FileReaderFailed,
72  FileDoesNotExist
73  };
74 
76  enum FileDialogMode
77  {
78  Reading,
79  Writing
80  };
81 
83  enum LessonDeletion
84  {
85  DeleteEmptyLesson,
86  DeleteEntriesAndLesson
87  };
88 
94  explicit KEduVocDocument( QObject* parent = 0 );
95 
99  ~KEduVocDocument();
100 
101  // *** whole document methods ***
102 
109  int open( const KUrl& url );
110 
119  int saveAs( const KUrl & url, FileType ft, const QString & generator );
120 
121  QByteArray toByteArray(const QString &generator);
122 
130  void merge( KEduVocDocument *docToMerge, bool matchIdentifiers );
131 
137  void setModified( bool dirty = true );
138 
140  bool isModified() const;
141 
145  void setUrl( const KUrl& url );
146 
148  KUrl url() const;
149 
150 
153  void setTitle( const QString & title );
154 
156  QString title() const;
157 
160  void setAuthor( const QString & author );
161 
163  QString author() const;
164 
167  void setAuthorContact( const QString & authorContact );
168 
170  QString authorContact() const;
171 
174  void setLicense( const QString & license );
175 
177  QString license() const;
178 
181  void setDocumentComment( const QString & comment );
182 
184  QString documentComment() const;
185 
188  void setCategory( const QString & category );
189 
191  QString category() const;
192 
196  void setGenerator( const QString & generator );
197 
199  QString generator() const;
200 
203  void setVersion( const QString & ver );
204 
206  QString version() const;
207 
208  // *** identifier methods ***
209 
213  int identifierCount() const;
214 
221  int appendIdentifier( const KEduVocIdentifier & identifier = KEduVocIdentifier());
222 
229  void setIdentifier( int index, const KEduVocIdentifier& lang );
230 
237  KEduVocIdentifier& identifier( int index );
238 
242  const KEduVocIdentifier& identifier( int index ) const;
243 
249  void removeIdentifier( int index );
250 
257  int indexOfIdentifier( const QString &name ) const;
258 
259  // *** grade methods ***
260 
268  KDE_DEPRECATED void queryIdentifier( QString &org, QString &trans ) const;
269 
277  KDE_DEPRECATED void setQueryIdentifier( const QString &org, const QString &trans );
278 
279  // *** lesson methods ***
280 
284  KEduVocLesson * lesson();
285 
286  KEduVocWordType * wordTypeContainer();
287 
288  KEduVocLeitnerBox * leitnerContainer();
289 
290  // *** file format specific methods ***
291 
298  QString csvDelimiter() const;
299 
305  void setCsvDelimiter( const QString &delimiter );
306 
307  static FileType detectFileType( const QString &fileName );
308 
317  static QString pattern( FileDialogMode mode );
318 
319  static QString errorDescription( int errorCode );
320 
321 Q_SIGNALS:
322  void progressChanged( KEduVocDocument *, int curr_percent );
323 
328  void docModified( bool mod );
329 
330 private:
331  // The private data of this - see KEduVocDocument::Private, implemented in keduvocdocument.cpp
332  class KEduVocDocumentPrivate;
333  KEduVocDocumentPrivate* const d;
334 
335  Q_DISABLE_COPY( KEduVocDocument )
336 };
337 
338 
339 #endif // KEDUVOCDOCUMENT_H
keduvocconjugation.h
KEduVocDocument::Pauker
Definition: keduvocdocument.h:55
KEduVocDocument::KvdNone
Definition: keduvocdocument.h:51
KEduVocDocument::FileDialogMode
FileDialogMode
used as parameter for pattern
Definition: keduvocdocument.h:76
KEduVocLesson
class to store information about a lesson
Definition: keduvoclesson.h:27
keduvocidentifier.h
KEduVocIdentifier
Class to store meta information about a language or any other category in the vocabulary.
Definition: keduvocidentifier.h:29
KEduVocDocument::Automatic
Definition: keduvocdocument.h:52
KEduVocDocument::FileTypeUnknown
Definition: keduvocdocument.h:67
libkeduvocdocument_export.h
KEDUVOCDOCUMENT_EXPORT
#define KEDUVOCDOCUMENT_EXPORT
Definition: libkeduvocdocument_export.h:32
KEduVocDocument::Reading
Definition: keduvocdocument.h:78
KEduVocDocument::DeleteEmptyLesson
Definition: keduvocdocument.h:85
QObject
KEduVocDocument::Xdxf
Definition: keduvocdocument.h:57
KEduVocLeitnerBox
Leitner Boxes are an alternative grading system.
Definition: keduvocleitnerbox.h:31
KEduVocDocument::FileType
FileType
known vocabulary file types
Definition: keduvocdocument.h:50
KEduVocDocument::FileWriterFailed
Definition: keduvocdocument.h:69
KEduVocWordType
class to store translation word types
Definition: keduvocwordtype.h:33
KEduVocDocument::InvalidXml
Definition: keduvocdocument.h:66
KEduVocDocument::LessonDeletion
LessonDeletion
delete only empty lessons or also if they have entries
Definition: keduvocdocument.h:83
KEduVocDocument::Unknown
Definition: keduvocdocument.h:65
KEduVocDocument::FileCannotWrite
Definition: keduvocdocument.h:68
KEduVocDocument::Vokabeln
Definition: keduvocdocument.h:56
KEduVocDocument::FileCannotRead
Definition: keduvocdocument.h:70
KEduVocExpression
This class contains one vocabulary expression as an original with one or more translations.
Definition: keduvocexpression.h:37
KEduVocDocument::ErrorCode
ErrorCode
the return code when opening/saving
Definition: keduvocdocument.h:63
KEduVocDocument::FileReaderFailed
Definition: keduvocdocument.h:71
KEduVocDocument::Kvtml
Definition: keduvocdocument.h:53
KEduVocDocument::Wql
Definition: keduvocdocument.h:54
KEduVocDocument
This class contains the expressions of your vocabulary as well as other information about the vocabul...
Definition: keduvocdocument.h:44
keduvocarticle.h
KEduVocDocument::Csv
Definition: keduvocdocument.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:37:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdeedu/keduvocdocument

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