• 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
keduvockvtmlwriter.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  export a KEduVocDocument to a KVTML file
3  -----------------------------------------------------------------------
4  copyright : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
5 
6  (C) 2005 Eric Pignet <eric at erixpage.com>
7  (C) 2007 Peter Hedlund <peter.hedlund@kdemail.net>
8  (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #include "keduvockvtmlwriter.h"
21 
22 #include <QtCore/QLatin1String>
23 #include <QtCore/QTextStream>
24 #include <QtCore/QFile>
25 
26 #include <KDebug>
27 
28 #include "keduvocdocument.h"
29 #include "keduvocgrade.h"
30 #include "keduvoclesson.h"
31 #include "keduvocexpression.h"
32 #include "kvtmldefs.h"
33 #include "keduvoccommon_p.h"
34 
35 KEduVocKvtmlWriter::KEduVocKvtmlWriter( QFile *file )
36 {
37  // the file must be already open
38  m_outputFile = file;
39 }
40 
41 
42 bool KEduVocKvtmlWriter::writeDoc( KEduVocDocument *doc, const QString &generator )
43 {
44  bool first_expr = true;
45 
46  m_doc = doc;
47 
48  m_domDoc = QDomDocument( "kvtml SYSTEM \"kvoctrain.dtd\"" );
49  m_domDoc.appendChild( m_domDoc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) );
50  QDomElement domElementKvtml = m_domDoc.createElement( "kvtml" );
51  m_domDoc.appendChild( domElementKvtml );
52 
53  domElementKvtml.setAttribute( KV_ENCODING, ( QString ) "UTF-8" );
54  domElementKvtml.setAttribute( KV_GENERATOR, generator );
55  domElementKvtml.setAttribute( KV_COLS, m_doc->identifierCount() );
56  domElementKvtml.setAttribute( KV_LINES, m_doc->entryCount() );
57 
58  if ( !m_doc->title().isEmpty() )
59  domElementKvtml.setAttribute( KV_TITLE, m_doc->title() );
60 
61  if ( !m_doc->author().isEmpty() )
62  domElementKvtml.setAttribute( KV_AUTHOR, m_doc->author() );
63 
64  if ( !m_doc->license().isEmpty() )
65  domElementKvtml.setAttribute( KV_LICENSE, m_doc->license() );
66 
67  if ( !m_doc->documentComment().isEmpty() )
68  domElementKvtml.setAttribute( KV_DOC_REM, m_doc->documentComment() );
69 
70  if ( !writeLesson( domElementKvtml ) )
71  return false;
72 
73  if ( !writeArticle( domElementKvtml ) )
74  return false;
75 
76  QList<KEduVocPersonalPronoun> pronouns;
77  for ( int i = 0; i < m_doc->identifierCount(); i++ )
78  pronouns.append( m_doc->identifier(i).personalPronouns() );
79  if ( pronouns.count() > 0 ) {
80  if ( !writePersonalPronouns(domElementKvtml, pronouns ) )
81  return false;
82  }
83 
84  if ( !writeType( domElementKvtml ) )
85  return false;
86 
87  if ( !writeTense( domElementKvtml ) )
88  return false;
89 
90  if ( !writeUsage( domElementKvtml ) )
91  return false;
92 
93  QString q_org, q_trans;
94  m_doc->queryIdentifier( q_org, q_trans );
95 
96  int entryCount = m_doc->entryCount();
97 
98  for ( int i = 0; i < entryCount; i++ ) {
99  KEduVocExpression *entry = m_doc->entry( i );
100  QDomElement domElementExpression = m_domDoc.createElement( KV_EXPR );
101 
102  if ( entry->lesson() != 0 ) {
103  int lm = entry->lesson();
104  if ( lm > m_doc->lessonCount() ) {
105  // should not be
106  kError() << "index of lesson member too high: " << lm << endl;
107  lm = 0;
108  }
109  domElementExpression.setAttribute( KV_LESS_MEMBER, lm );
110  }
111 
112 // Sorry, but we don't support this any more.
113 // if ( entry->isInQuery() )
114 // domElementExpression.setAttribute( KV_SELECTED, 1 );
115 
116  if ( !entry->isActive() )
117  domElementExpression.setAttribute( KV_INACTIVE, 1 );
118 
119  QDomElement domElementOriginal = m_domDoc.createElement( KV_ORG );
120  if ( first_expr ) {
121  // save space, only tell language in first entry
122  QString s;
123  domElementOriginal.setAttribute( KV_SIZEHINT, m_doc->sizeHint( 0 ) );
124 
125  s = m_doc->identifier( 0 ).name().simplified();
126  if ( s.isEmpty() )
127  s = "original";
128  domElementOriginal.setAttribute( KV_LANG, s );
129  if ( s == q_org )
130  domElementOriginal.setAttribute( KV_QUERY, ( QString ) KV_O );
131  else if ( s == q_trans )
132  domElementOriginal.setAttribute( KV_QUERY, ( QString ) KV_T );
133  }
134 
135  if ( !entry->translation( 0 ).comment().isEmpty() )
136  domElementOriginal.setAttribute( KV_REMARK, entry->translation( 0 ).comment() );
137 
138  if ( !entry->translation( 0 ).synonym().isEmpty() )
139  domElementOriginal.setAttribute( KV_SYNONYM, entry->translation( 0 ).synonym() );
140 
141  if ( !entry->translation( 0 ).example().isEmpty() )
142  domElementOriginal.setAttribute( KV_EXAMPLE, entry->translation( 0 ).example() );
144  /*
145  if (!entry->translation(0).usageLabel().isEmpty() )
146  domElementOriginal.setAttribute(KV_USAGE, entry->translation(0).usageLabel());
147  */
148  if ( !entry->translation( 0 ).paraphrase().isEmpty() )
149  domElementOriginal.setAttribute( KV_PARAPHRASE, entry->translation( 0 ).paraphrase() );
150 
151  if ( !entry->translation( 0 ).antonym().isEmpty() )
152  domElementOriginal.setAttribute( KV_ANTONYM, entry->translation( 0 ).antonym() );
153 
154  if ( !entry->translation( 0 ).pronunciation().isEmpty() )
155  domElementOriginal.setAttribute( KV_PRONUNCE, entry->translation( 0 ).pronunciation() );
156 
157  if ( !entry->translation( 0 ).type().isEmpty() )
158  domElementOriginal.setAttribute( KV_EXPRTYPE, m_compability.oldType( entry->translation( 0 ).type(), entry->translation( 0 ).subType() ) );
159 
160  if ( !writeMultipleChoice(domElementOriginal, entry->translation( 0 ).multipleChoice() ) )
161  return false;
162 
163  QString s;
164  QString entype = s = entry->translation( 0 ).type();
165  int pos = s.indexOf( QM_TYPE_DIV );
166  if ( pos >= 0 )
167  entype = s.left( pos );
168  else
169  entype = s;
170 
171  if ( entype == QM_VERB ) {
172  // conjugation
173  if ( !writeConjugEntry(domElementOriginal, entry->translation( 0 )) ) {
174  return false;
175  }
176 
177 
178  } else if ( entype == QM_ADJ && !entry->translation( 0 ).comparison().isEmpty() ) {
179  KEduVocComparison comp = entry->translation( 0 ).comparison();
180  if ( !writeComparison(domElementOriginal, comp ) )
181  return false;
182  }
183 
184  QDomText domTextOriginal = m_domDoc.createTextNode( entry->translation( 0 ).text() );
185  domElementOriginal.appendChild( domTextOriginal );
186  domElementExpression.appendChild( domElementOriginal );
187 
188  int trans = 1;
189  while ( trans < m_doc->identifierCount() ) {
190  QDomElement domElementTranslation = m_domDoc.createElement( KV_TRANS );
191  if ( first_expr ) {
192  // save space, only tell language in first entry
193  QString s;
194  domElementTranslation.setAttribute( KV_SIZEHINT, m_doc->sizeHint( trans ) );
195 
196  s = m_doc->identifier( trans ).name().simplified();
197  if ( s.isEmpty() ) {
198  s.setNum( trans );
199  s.prepend( QLatin1String("translation ") );
200  }
201  domElementTranslation.setAttribute( KV_LANG, s );
202  if ( s == q_org )
203  domElementTranslation.setAttribute( KV_QUERY, ( QString ) KV_O );
204  else if ( s == q_trans )
205  domElementTranslation.setAttribute( KV_QUERY, ( QString ) KV_T );
206  }
207 
208  if ( entry->translation( trans ).gradeFrom( 0 ).grade() != 0 || entry->translation( 0 ).gradeFrom( trans ).grade() != 0 )
209  domElementTranslation.setAttribute( KV_GRADE, QString::number( entry->translation( trans ).gradeFrom( 0 ).grade() ) + ';' + QString::number( entry->translation( 0 ).gradeFrom( trans ).grade() ) );
210 
211  if ( entry->translation( trans ).gradeFrom( 0 ).practiceCount() != 0 || entry->translation( 0 ).gradeFrom( trans ).practiceCount() != 0 )
212  domElementTranslation.setAttribute( KV_COUNT, QString::number( entry->translation( trans ).gradeFrom( 0 ).practiceCount() ) + ';' + QString::number( entry->translation( 0 ).gradeFrom( trans ).practiceCount() ) );
213 
214  if ( entry->translation( trans ).gradeFrom( 0 ).badCount() != 0 || entry->translation( 0 ).gradeFrom( trans ).badCount() != 0 )
215  domElementTranslation.setAttribute( KV_BAD, QString::number( entry->translation( trans ).gradeFrom( 0 ).badCount() ) + ';' + QString::number( entry->translation( 0 ).gradeFrom( trans ).badCount() ) );
216 
217  if ( entry->translation( trans ).gradeFrom( 0 ).practiceDate().toTime_t() != 0 || entry->translation( 0 ).gradeFrom( trans ).practiceDate().toTime_t() != 0 )
218  domElementTranslation.setAttribute( KV_DATE, QString::number( entry->translation( trans ).gradeFrom( 0 ).practiceDate().toTime_t() ) + ';' + QString::number( entry->translation( 0 ).gradeFrom( trans ).practiceDate().toTime_t() ) );
219 
220  if ( !entry->translation( trans ).comment().isEmpty() )
221  domElementTranslation.setAttribute( KV_REMARK, entry->translation( trans ).comment() );
222 
223  if ( !entry->translation( trans ).falseFriend( 0 ).isEmpty() )
224  domElementTranslation.setAttribute( KV_FAUX_AMI_F, entry->translation( trans ).falseFriend( 0 ) );
225 
226  if ( !entry->translation( 0 ).falseFriend( trans ).isEmpty() )
227  domElementTranslation.setAttribute( KV_FAUX_AMI_T, entry->translation( 0 ).falseFriend( trans ) );
228 
229  if ( !entry->translation( trans ).synonym().isEmpty() )
230  domElementTranslation.setAttribute( KV_SYNONYM, entry->translation( trans ).synonym() );
231 
232  if ( !entry->translation( trans ).example().isEmpty() )
233  domElementTranslation.setAttribute( KV_EXAMPLE, entry->translation( trans ).example() );
234 
236  /*
237  if (!entry->translation(trans).usageLabel().isEmpty() )
238  domElementTranslation.setAttribute(KV_USAGE, entry->translation(trans).usageLabel());
239  */
240  if ( !entry->translation( trans ).paraphrase().isEmpty() )
241  domElementTranslation.setAttribute( KV_PARAPHRASE, entry->translation( trans ).paraphrase() );
242 
243  if ( !entry->translation( trans ).antonym().isEmpty() )
244  domElementTranslation.setAttribute( KV_ANTONYM, entry->translation( trans ).antonym() );
245 
246  if ( !entry->translation( trans ).pronunciation().isEmpty() )
247  domElementTranslation.setAttribute( KV_PRONUNCE, entry->translation( trans ).pronunciation() );
248 
249  if ( !entry->translation( trans ).type().isEmpty() )
250  domElementTranslation.setAttribute( KV_EXPRTYPE, m_compability.oldType( entry->translation( trans ).type(), entry->translation( trans ).subType() ) );
251 
252  if ( !writeMultipleChoice(domElementTranslation, entry->translation( trans ).multipleChoice() ) )
253  return false;
254 
255  QString s;
256  QString entype = s = entry->translation( 0 ).type();
257  int pos = s.indexOf( QM_TYPE_DIV );
258  if ( pos >= 0 )
259  entype = s.left( pos );
260  else
261  entype = s;
262 
263  if ( entype == QM_VERB ) {
264  if ( !writeConjugEntry(domElementTranslation, entry->translation( trans ) ) ) {
265  return false;
266  }
267  }
268 
269  if ( entype == QM_ADJ && !entry->translation( trans ).comparison().isEmpty() ) {
270  KEduVocComparison comp = entry->translation( trans ).comparison();
271  if ( !writeComparison(domElementTranslation, comp ) )
272  return false;
273  }
274 
275  QDomText domTextTranslation = m_domDoc.createTextNode( entry->translation( trans ).text() );
276  domElementTranslation.appendChild( domTextTranslation );
277  domElementExpression.appendChild( domElementTranslation );
278 
279  trans++;
280  }
281 
282  domElementKvtml.appendChild( domElementExpression );
283 
284  first_expr = false;
285  }
286 
287  m_domDoc.appendChild( domElementKvtml );
288 
289  QTextStream ts( m_outputFile );
290  m_domDoc.save( ts, 2 );
291 
292  return true;
293 }
294 
295 
296 bool KEduVocKvtmlWriter::writeLesson( QDomElement &domElementParent )
297 {
298  if ( m_doc->lessonCount() == 0 )
299  return true;
300 
301  QDomElement domElementLesson = m_domDoc.createElement( KV_LESS_GRP );
302  domElementLesson.setAttribute( KV_SIZEHINT, m_doc->sizeHint( -1 ) );
303 
304  for ( int i = 0; i < m_doc->lessonCount(); ++i ) {
305  QDomElement domElementDesc = m_domDoc.createElement( KV_LESS_DESC );
306  QDomText domTextDesc = m_domDoc.createTextNode( m_doc->lesson(i).name() );
307 
308  domElementDesc.setAttribute( KV_LESS_NO, i );
309  if ( m_doc->currentLesson() == i ) {
310  domElementDesc.setAttribute( KV_LESS_CURR, 1 );
311  }
312  if ( m_doc->lesson(i).inPractice() ) {
313  domElementDesc.setAttribute( KV_LESS_QUERY, 1 );
314  }
315  domElementDesc.appendChild( domTextDesc );
316  domElementLesson.appendChild( domElementDesc );
317  }
318 
319  domElementParent.appendChild( domElementLesson );
320  return true;
321 }
322 
323 
324 bool KEduVocKvtmlWriter::writeArticle( QDomElement &domElementParent )
325 /*
326  <article>
327  <e l="de"> lang determines also lang order in entries !!
328  <fi>eine</fi> which must NOT differ
329  <fd>die</fd>
330  <mi>ein</mi>
331  <md>der</md>
332  <ni>ein</ni>
333  <nd>das</nd>
334  </e>
335  </article>
336 */
337 {
338  QDomElement domElementArticle = m_domDoc.createElement( KV_ARTICLE_GRP );
339  QString def;
340  QString indef;
341  QString s;
342 
343  for ( int i = 0; i < m_doc->identifierCount(); i++ )
344  {
345  QDomElement domElementEntry = m_domDoc.createElement( KV_ART_ENTRY );
346  s = m_doc->identifier(i).name().simplified();
347  domElementEntry.setAttribute( KV_LANG, s );
348 
349  QString articleString;
350  // female
351  articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Definite | KEduVocWordFlag::Feminine );
352  if ( !articleString.isEmpty() ) {
353  QDomElement domElementFD = m_domDoc.createElement( KV_ART_FD );
354  QDomText domTextFD = m_domDoc.createTextNode( articleString );
355 
356  domElementFD.appendChild( domTextFD );
357  domElementEntry.appendChild( domElementFD );
358  }
359  articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite | KEduVocWordFlag::Feminine );
360  if ( !articleString.isEmpty() ) {
361  QDomElement domElementFI = m_domDoc.createElement( KV_ART_FI );
362  QDomText domTextFI = m_domDoc.createTextNode( articleString );
363 
364  domElementFI.appendChild( domTextFI );
365  domElementEntry.appendChild( domElementFI );
366  }
367 
368 
369  // male
370  articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Definite | KEduVocWordFlag::Masculine );
371  if ( !articleString.isEmpty() ) {
372  QDomElement domElementMD = m_domDoc.createElement( KV_ART_MD );
373  QDomText domTextMD = m_domDoc.createTextNode( articleString );
374 
375  domElementMD.appendChild( domTextMD );
376  domElementEntry.appendChild( domElementMD );
377  }
378  articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite | KEduVocWordFlag::Masculine );
379  if ( !articleString.isEmpty() ) {
380  QDomElement domElementMI = m_domDoc.createElement( KV_ART_MI );
381  QDomText domTextMI = m_domDoc.createTextNode( articleString );
382 
383  domElementMI.appendChild( domTextMI );
384  domElementEntry.appendChild( domElementMI );
385  }
386 
387  // neutral
388  articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Definite | KEduVocWordFlag::Neutral );
389  if ( !articleString.isEmpty() ) {
390  QDomElement domElementND = m_domDoc.createElement( KV_ART_ND );
391  QDomText domTextND = m_domDoc.createTextNode( articleString );
392 
393  domElementND.appendChild( domTextND );
394  domElementEntry.appendChild( domElementND );
395  }
396  articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite | KEduVocWordFlag::Neutral );
397  if ( !articleString.isEmpty() ) {
398  QDomElement domElementNI = m_domDoc.createElement( KV_ART_NI );
399  QDomText domTextNI = m_domDoc.createTextNode( articleString );
400 
401  domElementNI.appendChild( domTextNI );
402  domElementEntry.appendChild( domElementNI );
403  }
404 
405  domElementArticle.appendChild( domElementEntry );
406  }
407 
408  domElementParent.appendChild( domElementArticle );
409  return true;
410 }
411 
412 
413 bool KEduVocKvtmlWriter::writeType( QDomElement &domElementParent )
414 {
416  /*
417  if (m_doc->typeDescriptions().count() == 0)
418  return true;
419 
420  QDomElement domElementType = m_domDoc.createElement(KV_TYPE_GRP);
421  int count = 1;
422 
423  foreach(const QString &type, m_doc->typeDescriptions())
424  {
425  if (!(type.isNull()) )
426  {
427  QDomElement domElementDesc = m_domDoc.createElement(KV_TYPE_DESC);
428  QDomText domTextDesc = m_domDoc.createTextNode(type);
429 
430  domElementDesc.setAttribute(KV_TYPE_NO, count);
431  domElementDesc.appendChild(domTextDesc);
432  domElementType.appendChild(domElementDesc);
433  count++;
434  }
435  }
436 
437  domElementParent.appendChild(domElementType);
438  */
439  return true;
440 }
441 
442 /*
443 bool KEduVocKvtmlWriter::writeTense( QDomElement &domElementParent )
444 {
445  if ( m_doc->tenseDescriptions().count() == 0 )
446  return true;
447 
448  QDomElement domElementTense = m_domDoc.createElement( KV_TENSE_GRP );
449  int count = 1;
450 
451  foreach( const QString &tense, m_doc->tenseDescriptions() ) {
452  if ( !( tense.isNull() ) ) {
453  QDomElement domElementDesc = m_domDoc.createElement( KV_TENSE_DESC );
454  QDomText domTextDesc = m_domDoc.createTextNode( tense );
455 
456  domElementDesc.setAttribute( KV_TENSE_NO, count );
457  domElementDesc.appendChild( domTextDesc );
458  domElementTense.appendChild( domElementDesc );
459  count++;
460  }
461  }
462 
463  domElementParent.appendChild( domElementTense );
464  return true;
465 }
466 */
467 
468 bool KEduVocKvtmlWriter::writeUsage( QDomElement &domElementParent )
469 {
470 
472  /*
473  if (m_doc->usageDescriptions().count() == 0)
474  return true;
475 
476  QDomElement domElementUsage = m_domDoc.createElement(KV_USAGE_GRP);
477  int count = 1;
478 
479  foreach(const QString &usage, m_doc->usageDescriptions())
480  {
481  if (!(usage.isNull()))
482  {
483  QDomElement domElementDesc = m_domDoc.createElement(KV_USAGE_DESC);
484  QDomText domTextDesc = m_domDoc.createTextNode(usage);
485 
486  domElementDesc.setAttribute(KV_USAGE_NO, count);
487  domElementDesc.appendChild(domTextDesc);
488  domElementUsage.appendChild(domElementDesc);
489  count++;
490  }
491  }
492 
493  domElementParent.appendChild(domElementUsage);
494  */
495  return true;
496 }
497 
498 
499 bool KEduVocKvtmlWriter::writeComparison( QDomElement &domElementParent, const KEduVocTranslation* translation )
500 /*
501  <comparison>
502  <l1>good</l1>
503  <l2>better</l2>
504  <l3>best</l3>
505  </comparison>
506 */
507 {
508  if ( translation.comparison().isEmpty() && translation.superlative().isEmpty() ) {
509  return true;
510  }
511 
512  QDomElement domElementComparison = m_domDoc.createElement( KV_COMPARISON_GRP );
513 
514  if ( !comp.l1().isEmpty() ) {
515  QDomElement domElementL1 = m_domDoc.createElement( KV_COMP_L1 );
516  QDomText domTextL1 = m_domDoc.createTextNode( comp.l1() );
517 
518  domElementL1.appendChild( domTextL1 );
519  domElementComparison.appendChild( domElementL1 );
520  }
521 
522  if ( !comp.l2().isEmpty() ) {
523  QDomElement domElementL2 = m_domDoc.createElement( KV_COMP_L2 );
524  QDomText domTextL2 = m_domDoc.createTextNode( comp.l2() );
525 
526  domElementL2.appendChild( domTextL2 );
527  domElementComparison.appendChild( domElementL2 );
528  }
529 
530  if ( !comp.l3().isEmpty() ) {
531  QDomElement domElementL3 = m_domDoc.createElement( KV_COMP_L3 );
532  QDomText domTextL3 = m_domDoc.createTextNode( comp.l3() );
533 
534  domElementL3.appendChild( domTextL3 );
535  domElementComparison.appendChild( domElementL3 );
536  }
537 
538  domElementParent.appendChild( domElementComparison );
539  return true;
540 }
541 
542 
543 bool KEduVocKvtmlWriter::writeMultipleChoice( QDomElement &domElementParent, const KEduVocMultipleChoice &mc )
544 /*
545  <multiplechoice>
546  <mc1>good</mc1>
547  <mc2>better</mc2>
548  <mc3>best</mc3>
549  <mc4>best 2</mc4>
550  <mc5>best 3</mc5>
551  </multiplechoice>
552 */
553 {
554  if ( mc.isEmpty() )
555  return true;
556 
557  QDomElement domElementMC = m_domDoc.createElement( KV_MULTIPLECHOICE_GRP );
558 
559  if ( !mc.choice( 1 ).isEmpty() ) {
560  QDomElement domElementMC1 = m_domDoc.createElement( KV_MC_1 );
561  QDomText domTextMC1 = m_domDoc.createTextNode( mc.choice( 1 ) );
562 
563  domElementMC1.appendChild( domTextMC1 );
564  domElementMC.appendChild( domElementMC1 );
565  }
566 
567  if ( !mc.choice( 2 ).isEmpty() ) {
568  QDomElement domElementMC2 = m_domDoc.createElement( KV_MC_2 );
569  QDomText domTextMC2 = m_domDoc.createTextNode( mc.choice( 2 ) );
570 
571  domElementMC2.appendChild( domTextMC2 );
572  domElementMC.appendChild( domElementMC2 );
573  }
574 
575  if ( !mc.choice( 3 ).isEmpty() ) {
576  QDomElement domElementMC3 = m_domDoc.createElement( KV_MC_3 );
577  QDomText domTextMC3 = m_domDoc.createTextNode( mc.choice( 3 ) );
578 
579  domElementMC3.appendChild( domTextMC3 );
580  domElementMC.appendChild( domElementMC3 );
581  }
582 
583  if ( !mc.choice( 4 ).isEmpty() ) {
584  QDomElement domElementMC4 = m_domDoc.createElement( KV_MC_4 );
585  QDomText domTextMC4 = m_domDoc.createTextNode( mc.choice( 4 ) );
586 
587  domElementMC4.appendChild( domTextMC4 );
588  domElementMC.appendChild( domElementMC4 );
589  }
590 
591  if ( !mc.choice( 5 ).isEmpty() ) {
592  QDomElement domElementMC5 = m_domDoc.createElement( KV_MC_5 );
593  QDomText domTextMC5 = m_domDoc.createTextNode( mc.choice( 5 ) );
594 
595  domElementMC5.appendChild( domTextMC5 );
596  domElementMC.appendChild( domElementMC5 );
597  }
598 
599  domElementParent.appendChild( domElementMC );
600  return true;
601 }
602 
603 
604 bool KEduVocKvtmlWriter::writeConjugHeader( QDomElement &domElementParent, QList<KEduVocConjugation> &curr_conjug )
605 {
606  /*
607  <conjugation> used in header for definiton of "prefix"
608  <e l="de"> lang determines also lang order in entries !!
609  <s1>I</s1> which must NOT differ
610  <s2>you<2>
611  <s3f common="0">he</s3f>
612  <s3m>she</s3m>
613  <s3n>it</s3n>
614  <p1>we</p1>
615  <p2>you</p2>
616  <p3f common="1">they</p3f>
617  <p3m>they</p3m>
618  <p3n>they</p3n>
619  </e>
620  </conjugation>
621 
622  */
623  if ( curr_conjug.size() == 0 )
624  return true;
625 
626  QDomElement domElementConjug = m_domDoc.createElement( KV_CONJUG_GRP );
627  QString s;
628 
629  for ( int ent = 0; ent < qMin( curr_conjug.count(), m_doc->identifierCount() ); ent++ ) {
630  QDomElement domElementEntry = m_domDoc.createElement( KV_CON_ENTRY );
631 
632  s = m_doc->identifier( ent ).name().simplified();
633  if ( s.isEmpty() ) {
634  s.setNum( ent );
635  s.prepend( QLatin1String("translation ") );
636  }
637 
638  domElementEntry.setAttribute( KV_LANG, s );
639  if ( !writeConjug(domElementEntry, curr_conjug[ent], "--" ) )
640  return false;
641 
642  domElementConjug.appendChild( domElementEntry );
643  }
644 
645  domElementParent.appendChild( domElementConjug );
646  return true;
647 }
648 
649 
650 bool KEduVocKvtmlWriter::writeConjugEntry( QDomElement &domElementParent, KEduVocTranslation &translation )
651 /*
652  <conjugation> in entry for definition of tenses of (irreg.) verbs
653  <t n="sipa">
654  <s1>go</s1>
655  <s2>go</s2>
656  <s3f>goes</s3f>
657  <s3m>goes</s3m>
658  <s3n>goes</s3n>
659  <p1>go</p1>
660  <p2>go</p2>
661  <p3f>go</p3f>
662  <p3m>go</p3m>
663  <p3n>go</p3n>
664  </t>
665  </conjugation>
666 */
667 {
668 
669 // curr_conjug.cleanUp();
670  QDomElement domElementConjug = m_domDoc.createElement( KV_CONJUG_GRP );
671 
672  foreach ( const QString &tense, translation.conjugationTenses() ) {
673  QDomElement domElementType = m_domDoc.createElement( KV_CON_TYPE );
674 
675  domElementType.setAttribute( KV_CON_NAME, m_compability.oldTense(tense) );
676 
677  if ( !writeConjug(domElementType, translation.conjugation(tense), m_compability.oldTense(tense) ) )
678  return false;
679 
680  domElementConjug.appendChild( domElementType );
681  }
682 
683  domElementParent.appendChild( domElementConjug );
684  return true;
685 }
686 
687 
688 bool KEduVocKvtmlWriter::writeConjug( QDomElement &domElementParent, const KEduVocConjugation &curr_conjug, const QString &type )
689 {
691 /*
692  if ( !curr_conjug.pers1Singular().isEmpty() ) {
693  QDomElement domElementP1s = m_domDoc.createElement( KV_CON_P1S );
694  QDomText domTextP1s = m_domDoc.createTextNode( curr_conjug.pers1Singular() );
695 
696  domElementP1s.appendChild( domTextP1s );
697  domElementParent.appendChild( domElementP1s );
698  }
699 
700  if ( !curr_conjug.pers2Singular().isEmpty() ) {
701  QDomElement domElementP2s = m_domDoc.createElement( KV_CON_P2S );
702  QDomText domTextP2s = m_domDoc.createTextNode( curr_conjug.pers2Singular() );
703 
704  domElementP2s.appendChild( domTextP2s );
705  domElementParent.appendChild( domElementP2s );
706  }
707 
708  if ( !curr_conjug.pers3FemaleSingular().isEmpty() || curr_conjug.pers3SingularCommon() ) {
709  QDomElement domElementP3sf = m_domDoc.createElement( KV_CON_P3SF );
710  QDomText domTextP3sf = m_domDoc.createTextNode( curr_conjug.pers3FemaleSingular() );
711 
712  if ( curr_conjug.pers3SingularCommon() )
713  domElementP3sf.setAttribute( KV_CONJ_COMMON, 1 );
714 
715  domElementP3sf.appendChild( domTextP3sf );
716  domElementParent.appendChild( domElementP3sf );
717  }
718 
719  if ( !curr_conjug.pers3MaleSingular().isEmpty() ) {
720  QDomElement domElementP3sm = m_domDoc.createElement( KV_CON_P3SM );
721  QDomText domTextP3sm = m_domDoc.createTextNode( curr_conjug.pers3MaleSingular() );
722 
723  domElementP3sm.appendChild( domTextP3sm );
724  domElementParent.appendChild( domElementP3sm );
725  }
726 
727  if ( !curr_conjug.pers3NaturalSingular().isEmpty() ) {
728  QDomElement domElementP3sn = m_domDoc.createElement( KV_CON_P3SN );
729  QDomText domTextP3sn = m_domDoc.createTextNode( curr_conjug.pers3NaturalSingular() );
730 
731  domElementP3sn.appendChild( domTextP3sn );
732  domElementParent.appendChild( domElementP3sn );
733  }
734 
735  if ( !curr_conjug.pers1Plural().isEmpty() ) {
736  QDomElement domElementP1p = m_domDoc.createElement( KV_CON_P1P );
737  QDomText domTextP1p = m_domDoc.createTextNode( curr_conjug.pers1Plural() );
738 
739  domElementP1p.appendChild( domTextP1p );
740  domElementParent.appendChild( domElementP1p );
741  }
742 
743  if ( !curr_conjug.pers2Plural().isEmpty() ) {
744  QDomElement domElementP2p = m_domDoc.createElement( KV_CON_P2P );
745  QDomText domTextP2p = m_domDoc.createTextNode( curr_conjug.pers2Plural() );
746 
747  domElementP2p.appendChild( domTextP2p );
748  domElementParent.appendChild( domElementP2p );
749  }
750 
751  if ( !curr_conjug.pers3FemalePlural().isEmpty() || curr_conjug.pers3PluralCommon() ) {
752  QDomElement domElementP3pf = m_domDoc.createElement( KV_CON_P3PF );
753  QDomText domTextP3pf = m_domDoc.createTextNode( curr_conjug.pers3FemalePlural() );
754 
755  if ( curr_conjug.pers3PluralCommon() )
756  domElementP3pf.setAttribute( KV_CONJ_COMMON, 1 );
757 
758  domElementP3pf.appendChild( domTextP3pf );
759  domElementParent.appendChild( domElementP3pf );
760  }
761 
762  if ( !curr_conjug.pers3MalePlural().isEmpty() ) {
763  QDomElement domElementP3pm = m_domDoc.createElement( KV_CON_P3PM );
764  QDomText domTextP3pm = m_domDoc.createTextNode( curr_conjug.pers3MalePlural() );
765 
766  domElementP3pm.appendChild( domTextP3pm );
767  domElementParent.appendChild( domElementP3pm );
768  }
769 
770  if ( !curr_conjug.pers3NaturalPlural().isEmpty() ) {
771  QDomElement domElementP3pn = m_domDoc.createElement( KV_CON_P3PN );
772  QDomText domTextP3pn = m_domDoc.createTextNode( curr_conjug.pers3NaturalPlural() );
773 
774  domElementP3pn.appendChild( domTextP3pn );
775  domElementParent.appendChild( domElementP3pn );
776  }
777 
778  return true; */
779  kDebug() << "Implement me!";
780  return false;
781 }
782 
783 bool KEduVocKvtmlWriter::writePersonalPronouns( QDomElement &domElementParent, QList<KEduVocPersonalPronoun> &curr_conjug )
784 {
785  /*
786  <conjugation> used in header for definiton of "prefix"
787  <e l="de"> lang determines also lang order in entries !!
788  <s1>I</s1> which must NOT differ
789  <s2>you<2>
790  <s3f common="0">he</s3f>
791  <s3m>she</s3m>
792  <s3n>it</s3n>
793  <p1>we</p1>
794  <p2>you</p2>
795  <p3f common="1">they</p3f>
796  <p3m>they</p3m>
797  <p3n>they</p3n>
798  </e>
799  </conjugation>
800  */
801  const QString type = QString::fromLatin1("--");
802 
803  if ( curr_conjug.size() == 0 )
804  return true;
805 
806  QDomElement domElementConjug = m_domDoc.createElement( KV_CONJUG_GRP );
807  QString s;
808 
809  for ( int ent = 0; ent < qMin( curr_conjug.count(), m_doc->identifierCount() ); ent++ ) {
810  QDomElement domElementEntry = m_domDoc.createElement( KV_CON_ENTRY );
811 
812  s = m_doc->identifier( ent ).name().simplified();
813  if ( s.isEmpty() ) {
814  s.setNum( ent );
815  s.prepend( QLatin1String("translation ") );
816  }
817 
818  domElementEntry.setAttribute( KV_LANG, s );
819  if ( !writePersonalPronounChild(domElementEntry, curr_conjug[ent] ) )
820  return false;
821 
822  domElementConjug.appendChild( domElementEntry );
823  }
824 
825  domElementParent.appendChild( domElementConjug );
826  return true;
827 }
828 
829 
830 bool KEduVocKvtmlWriter::writePersonalPronounChild( QDomElement &domElementParent, const KEduVocPersonalPronoun &curr_conjug )
831 {
832  // the old stuff only has singular
833  const KEduVocWordFlag::ConjugationNumber num = KEduVocWordFlag::Singular;
834 
835  if ( !curr_conjug.personalPronoun( KEduVocWordFlag::First, num ).isEmpty() ) {
836  domElementParent.appendChild( newTextElement( KV_CON_P1S, curr_conjug.personalPronoun( KEduVocWordFlag::First, num ) ) );
837  }
838 
839  if ( !curr_conjug.personalPronoun( KEduVocWordFlag::Second, num ).isEmpty() ) {
840  domElementParent.appendChild( newTextElement( KV_CON_P2S, curr_conjug.personalPronoun( KEduVocWordFlag::Second, num ) ) );
841  }
842 
844 /*
845  if ( !curr_conjug.pers2Singular().isEmpty() ) {
846  QDomElement domElementP2s = m_domDoc.createElement( KV_CON_P2S );
847  QDomText domTextP2s = m_domDoc.createTextNode( curr_conjug.pers2Singular() );
848 
849  domElementP2s.appendChild( domTextP2s );
850  domElementParent.appendChild( domElementP2s );
851  }
852 
853  if ( !curr_conjug.pers3FemaleSingular().isEmpty() || curr_conjug.pers3SingularCommon() ) {
854  QDomElement domElementP3sf = m_domDoc.createElement( KV_CON_P3SF );
855  QDomText domTextP3sf = m_domDoc.createTextNode( curr_conjug.pers3FemaleSingular() );
856 
857  if ( curr_conjug.pers3SingularCommon() )
858  domElementP3sf.setAttribute( KV_CONJ_COMMON, 1 );
859 
860  domElementP3sf.appendChild( domTextP3sf );
861  domElementParent.appendChild( domElementP3sf );
862  }
863 
864  if ( !curr_conjug.pers3MaleSingular().isEmpty() ) {
865  QDomElement domElementP3sm = m_domDoc.createElement( KV_CON_P3SM );
866  QDomText domTextP3sm = m_domDoc.createTextNode( curr_conjug.pers3MaleSingular() );
867 
868  domElementP3sm.appendChild( domTextP3sm );
869  domElementParent.appendChild( domElementP3sm );
870  }
871 
872  if ( !curr_conjug.pers3NaturalSingular().isEmpty() ) {
873  QDomElement domElementP3sn = m_domDoc.createElement( KV_CON_P3SN );
874  QDomText domTextP3sn = m_domDoc.createTextNode( curr_conjug.pers3NaturalSingular() );
875 
876  domElementP3sn.appendChild( domTextP3sn );
877  domElementParent.appendChild( domElementP3sn );
878  }
879 
880  if ( !curr_conjug.pers1Plural().isEmpty() ) {
881  QDomElement domElementP1p = m_domDoc.createElement( KV_CON_P1P );
882  QDomText domTextP1p = m_domDoc.createTextNode( curr_conjug.pers1Plural() );
883 
884  domElementP1p.appendChild( domTextP1p );
885  domElementParent.appendChild( domElementP1p );
886  }
887 
888  if ( !curr_conjug.pers2Plural().isEmpty() ) {
889  QDomElement domElementP2p = m_domDoc.createElement( KV_CON_P2P );
890  QDomText domTextP2p = m_domDoc.createTextNode( curr_conjug.pers2Plural() );
891 
892  domElementP2p.appendChild( domTextP2p );
893  domElementParent.appendChild( domElementP2p );
894  }
895 
896  if ( !curr_conjug.pers3FemalePlural().isEmpty() || curr_conjug.pers3PluralCommon() ) {
897  QDomElement domElementP3pf = m_domDoc.createElement( KV_CON_P3PF );
898  QDomText domTextP3pf = m_domDoc.createTextNode( curr_conjug.pers3FemalePlural() );
899 
900  if ( curr_conjug.pers3PluralCommon() )
901  domElementP3pf.setAttribute( KV_CONJ_COMMON, 1 );
902 
903  domElementP3pf.appendChild( domTextP3pf );
904  domElementParent.appendChild( domElementP3pf );
905  }
906 
907  if ( !curr_conjug.pers3MalePlural().isEmpty() ) {
908  QDomElement domElementP3pm = m_domDoc.createElement( KV_CON_P3PM );
909  QDomText domTextP3pm = m_domDoc.createTextNode( curr_conjug.pers3MalePlural() );
910 
911  domElementP3pm.appendChild( domTextP3pm );
912  domElementParent.appendChild( domElementP3pm );
913  }
914 
915  if ( !curr_conjug.pers3NaturalPlural().isEmpty() ) {
916  QDomElement domElementP3pn = m_domDoc.createElement( KV_CON_P3PN );
917  QDomText domTextP3pn = m_domDoc.createTextNode( curr_conjug.pers3NaturalPlural() );
918 
919  domElementP3pn.appendChild( domTextP3pn );
920  domElementParent.appendChild( domElementP3pn );
921  }*/
922 
923  return true;
924 }
925 
926 QDomElement KEduVocKvtmlWriter::newTextElement( const QString &elementName, const QString &text )
927 {
928  QDomElement retval = m_domDoc.createElement( elementName );
929  QDomText textNode = m_domDoc.createTextNode( text );
930  retval.appendChild( textNode );
931  return retval;
932 }
933 
934 
KV_LANG
#define KV_LANG
Definition: kvtmldefs.h:39
KV_BAD
#define KV_BAD
Definition: kvtmldefs.h:48
KV_MC_2
#define KV_MC_2
Definition: kvtmldefs.h:167
KV_COMP_L1
#define KV_COMP_L1
Definition: kvtmldefs.h:151
KV_LINES
#define KV_LINES
Definition: kvtmldefs.h:31
KV_LESS_NO
#define KV_LESS_NO
Definition: kvtmldefs.h:97
KEduVocText::isEmpty
bool isEmpty()
If the string inside is empty this returns true.
Definition: keduvoctext.cpp:227
keduvocexpression.h
keduvocdocument.h
KEduVocDocument::license
QString license() const
Definition: keduvocdocument.cpp:778
KEduVocContainer::inPractice
bool inPractice()
Definition: keduvoccontainer.cpp:161
KV_PRONUNCE
#define KV_PRONUNCE
Definition: kvtmldefs.h:56
KV_O
#define KV_O
Definition: kvtmldefs.h:41
KEduVocTranslation::comment
QString comment() const
Returns comments of this expression.
Definition: keduvoctranslation.cpp:202
KV_SYNONYM
#define KV_SYNONYM
Definition: kvtmldefs.h:54
KV_TITLE
#define KV_TITLE
Definition: kvtmldefs.h:27
KEduVocIdentifier::name
QString name() const
Name of this identifier.
Definition: keduvocidentifier.cpp:81
QM_VERB
#define QM_VERB
Definition: keduvockvtmlcompability.h:34
KV_ART_NI
#define KV_ART_NI
Definition: kvtmldefs.h:140
keduvoccommon_p.h
QM_ADJ
#define QM_ADJ
Definition: keduvockvtmlcompability.h:45
KV_ART_MI
#define KV_ART_MI
Definition: kvtmldefs.h:139
QM_TYPE_DIV
#define QM_TYPE_DIV
Definition: keduvockvtmlcompability.h:63
KEduVocWordFlag::Singular
Definition: keduvocwordflags.h:33
KV_ART_FI
#define KV_ART_FI
Definition: kvtmldefs.h:138
KEduVocTranslation::multipleChoice
QStringList & multipleChoice()
Returns multiple choice if available.
Definition: keduvoctranslation.cpp:296
KV_LESS_DESC
#define KV_LESS_DESC
Definition: kvtmldefs.h:95
KV_ANTONYM
#define KV_ANTONYM
Definition: kvtmldefs.h:55
KEduVocWordFlag::Masculine
Definition: keduvocwordflags.h:28
KEduVocTranslation::conjugation
KEduVocConjugation & conjugation(const QString &tense)
Returns a conjugation if available.
Definition: keduvoctranslation.cpp:290
KV_ART_MD
#define KV_ART_MD
Definition: kvtmldefs.h:136
KEduVocWordFlag::First
Definition: keduvocwordflags.h:47
KEduVocConjugation
The conjugation of a verb.
Definition: keduvocconjugation.h:37
KEduVocMultipleChoice::choice
QString choice(int index) const
Definition: keduvocmultiplechoice.cpp:81
KV_CON_NAME
#define KV_CON_NAME
Definition: kvtmldefs.h:207
KEduVocTranslation::conjugationTenses
QStringList conjugationTenses() const
Definition: keduvoctranslation.cpp:313
KEduVocExpression::isActive
bool isActive() const
returns flag if entry is activated for queries
Definition: keduvocexpression.cpp:150
KV_MC_1
#define KV_MC_1
Definition: kvtmldefs.h:166
keduvoclesson.h
KV_LESS_QUERY
#define KV_LESS_QUERY
Definition: kvtmldefs.h:96
KEduVocIdentifier::article
KEduVocArticle & article() const
Articles (a, the in English, el, la,...
Definition: keduvocidentifier.cpp:106
KV_MULTIPLECHOICE_GRP
#define KV_MULTIPLECHOICE_GRP
Definition: kvtmldefs.h:165
KV_EXPR
#define KV_EXPR
Definition: kvtmldefs.h:36
KV_EXPRTYPE
#define KV_EXPRTYPE
Definition: kvtmldefs.h:59
KEduVocPersonalPronoun
The conjugation of a verb.
Definition: keduvocpersonalpronoun.h:25
KEduVocTranslation::pronunciation
QString pronunciation() const
Returns the pronunciation of this expression.
Definition: keduvoctranslation.cpp:302
KV_LICENSE
#define KV_LICENSE
Definition: kvtmldefs.h:29
KEduVocDocument::title
QString title() const
Definition: keduvocdocument.cpp:741
KV_COLS
#define KV_COLS
Definition: kvtmldefs.h:33
KV_QUERY
#define KV_QUERY
Definition: kvtmldefs.h:40
KV_CONJUG_GRP
#define KV_CONJUG_GRP
Definition: kvtmldefs.h:204
KEduVocDocument::documentComment
QString documentComment() const
Definition: keduvocdocument.cpp:783
KEduVocDocument::identifier
KEduVocIdentifier & identifier(int index)
Returns the identifier of translation index.
Definition: keduvocdocument.cpp:654
KV_DATE
#define KV_DATE
Definition: kvtmldefs.h:49
KEduVocDocument::author
QString author() const
Definition: keduvocdocument.cpp:756
KEduVocText::practiceDate
QDateTime practiceDate() const
returns last practice date as int
Definition: keduvoctext.cpp:143
KV_COUNT
#define KV_COUNT
Definition: kvtmldefs.h:45
KEduVocKvtmlWriter::KEduVocKvtmlWriter
KEduVocKvtmlWriter(QFile *file)
Definition: keduvockvtmlwriter.cpp:35
kvtmldefs.h
KEduVocMultipleChoice::isEmpty
bool isEmpty() const
Definition: keduvocmultiplechoice.cpp:69
KV_T
#define KV_T
Definition: kvtmldefs.h:42
KV_COMP_L2
#define KV_COMP_L2
Definition: kvtmldefs.h:152
KV_GRADE
#define KV_GRADE
Definition: kvtmldefs.h:43
KV_CON_ENTRY
#define KV_CON_ENTRY
Definition: kvtmldefs.h:205
KV_MC_4
#define KV_MC_4
Definition: kvtmldefs.h:169
KEduVocDocument::queryIdentifier
KDE_DEPRECATED void queryIdentifier(QString &org, QString &trans) const
Retrieves the identifiers for the current query not written in the new version!
Definition: keduvocdocument.cpp:800
KV_MC_5
#define KV_MC_5
Definition: kvtmldefs.h:170
KV_LESS_GRP
#define KV_LESS_GRP
Definition: kvtmldefs.h:93
KV_ARTICLE_GRP
#define KV_ARTICLE_GRP
Definition: kvtmldefs.h:133
KV_ART_FD
#define KV_ART_FD
Definition: kvtmldefs.h:135
KV_ORG
static const QLatin1String KV_ORG("o")
KV_FAUX_AMI_F
#define KV_FAUX_AMI_F
Definition: kvtmldefs.h:52
KEduVocTranslation::antonym
QString antonym() const
Returns antonym of this expression.
KEduVocPersonalPronoun::personalPronoun
QString personalPronoun(KEduVocWordFlags flags) const
Definition: keduvocpersonalpronoun.cpp:78
KV_GENERATOR
#define KV_GENERATOR
Definition: kvtmldefs.h:32
KV_COMP_L3
#define KV_COMP_L3
Definition: kvtmldefs.h:153
KV_LESS_CURR
#define KV_LESS_CURR
Definition: kvtmldefs.h:94
KEduVocTranslation::example
QString example() const
Returns example of this expression.
Definition: keduvoctranslation.cpp:266
KV_LESS_MEMBER
#define KV_LESS_MEMBER
Definition: kvtmldefs.h:44
KV_FAUX_AMI_T
#define KV_FAUX_AMI_T
Definition: kvtmldefs.h:53
KV_TRANS
static const QLatin1String KV_TRANS("t")
KEduVocExpression::lesson
KEduVocLesson * lesson() const
return the lesson
Definition: keduvocexpression.cpp:144
KEduVocTranslation
Definition: keduvoctranslation.h:35
KEduVocWordFlag::Indefinite
Definition: keduvocwordflags.h:62
KV_ART_ENTRY
static const QLatin1String KV_ART_ENTRY("e")
keduvockvtmlwriter.h
KEduVocContainer::name
QString name()
get the container name
Definition: keduvoccontainer.cpp:156
KV_CON_P2S
#define KV_CON_P2S
Definition: kvtmldefs.h:209
KEduVocTranslation::paraphrase
QString paraphrase() const
Returns paraphrase of this expression.
Definition: keduvoctranslation.cpp:278
KEduVocExpression
This class contains one vocabulary expression as an original with one or more translations.
Definition: keduvocexpression.h:37
KV_CON_TYPE
#define KV_CON_TYPE
Definition: kvtmldefs.h:206
KEduVocMultipleChoice
Definition: keduvocmultiplechoice.h:34
KV_ART_ND
#define KV_ART_ND
Definition: kvtmldefs.h:137
KEduVocDocument::identifierCount
int identifierCount() const
Definition: keduvocdocument.cpp:694
KEduVocKvtmlCompability::oldType
QString oldType(const QString &mainType, const QString &subType) const
To write old docs: convert a nice new type to the ugly old style.
KEduVocIdentifier::personalPronouns
KEduVocPersonalPronoun & personalPronouns() const
Get the personal pronouns for this identifier.
Definition: keduvocidentifier.cpp:111
KV_SIZEHINT
#define KV_SIZEHINT
Definition: kvtmldefs.h:46
KEduVocText::text
QString text() const
The translation as string (the word itself)
Definition: keduvoctext.cpp:55
KV_EXAMPLE
#define KV_EXAMPLE
Definition: kvtmldefs.h:60
KEduVocKvtmlWriter::writeDoc
bool writeDoc(KEduVocDocument *doc, const QString &generator)
Definition: keduvockvtmlwriter.cpp:42
KV_PARAPHRASE
#define KV_PARAPHRASE
Definition: kvtmldefs.h:62
KV_CON_P1S
#define KV_CON_P1S
Definition: kvtmldefs.h:208
KEduVocText::badCount
count_t badCount() const
returns bad query count as int
Definition: keduvoctext.cpp:131
KEduVocExpression::translation
KEduVocTranslation * translation(int index)
Get a pointer to the translation.
Definition: keduvocexpression.cpp:182
KV_REMARK
#define KV_REMARK
Definition: kvtmldefs.h:51
KEduVocKvtmlCompability::oldTense
QString oldTense(const QString &tense)
Definition: keduvockvtmlcompability.cpp:215
KV_INACTIVE
#define KV_INACTIVE
Definition: kvtmldefs.h:58
KV_COMPARISON_GRP
#define KV_COMPARISON_GRP
Definition: kvtmldefs.h:150
KEduVocText::practiceCount
count_t practiceCount() const
returns how often this entry has been practiced as int
Definition: keduvoctext.cpp:107
KV_MC_3
#define KV_MC_3
Definition: kvtmldefs.h:168
KV_AUTHOR
#define KV_AUTHOR
Definition: kvtmldefs.h:28
KEduVocDocument::lesson
KEduVocLesson * lesson()
Get the lesson root object.
Definition: keduvocdocument.cpp:716
KV_DOC_REM
#define KV_DOC_REM
Definition: kvtmldefs.h:30
KEduVocDocument
This class contains the expressions of your vocabulary as well as other information about the vocabul...
Definition: keduvocdocument.h:44
KEduVocArticle::article
QString article(const KEduVocWordFlags &)
Definition: keduvocarticle.cpp:63
KEduVocWordFlag::Feminine
Definition: keduvocwordflags.h:29
KEduVocTranslation::superlative
KDE_DEPRECATED QString superlative() const
Definition: keduvoctranslation.cpp:413
KEduVocText::grade
grade_t grade() const
returns grade as int
Definition: keduvoctext.cpp:77
KEduVocWordFlag::Second
Definition: keduvocwordflags.h:48
KV_ENCODING
#define KV_ENCODING
Definition: kvtmldefs.h:34
KEduVocWordFlag::Definite
Definition: keduvocwordflags.h:61
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