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

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • scripts
translator.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  Copyright 2008 Avgoustinos Kadis <avgoustinos.kadis@kdemail.net>
4 
5  ***************************************************************************/
6 
7 /***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef TRANSLATOR_H
16 #define TRANSLATOR_H
17 
18 #include <QMap>
19 // #include <QHash>
20 #include <QStringList>
21 
22 /*class Translation
23 {
24  public:
25  QString word;
26  QString fromLanguage;
27  QString toLanguage;
28 
29  Translation ()
30  {
31  word = "";
32  fromLanguage = "";
33  toLanguage = "";
34  }
35 
36  Translation ( QString pword, QString pfromLanguage, QString ptoLanguage )
37  {
38  word = pword;
39  fromLanguage = pfromLanguage;
40  toLanguage = ptoLanguage;
41  }
42 
43  void operator=(const Translation &t1) {
44  word = t1.word;
45  fromLanguage = t1.fromLanguage;
46  toLanguage = t1.toLanguage;
47  }
48 
49 // inline bool operator<(const Translation &t2) {
50 // if ( word != t2.word )
51 // return word < t2.word;
52 // if ( fromLanguage != t2.fromLanguage )
53 // return fromLanguage < t2.fromLanguage;
54 // return toLanguage < t2.toLanguage;
55 // }
56 };*/
57 
58 // inline bool operator<( const Translation &t1, const Translation &t2 )
59 // {
60 // if ( t1.word != t2.word )
61 // return t1.word < t2.word;
62 // if ( t1.fromLanguage != t2.fromLanguage )
63 // return t1.fromLanguage < t2.fromLanguage;
64 // return t1.toLanguage < t2.toLanguage;
65 // }
66 
67 #include "../parleymainwindow.h"
68 
74 class Translator
75 {
76 public:
77  Translator();
78  Translator(QObject * parent);
79 
80  ~Translator();
81 
89  void addTranslation(QString word, QString fromLanguage, QString toLanguage, QString translation);
90 
100  QSet<QString>* getTranslation(QString word, QString fromLanguage, QString toLanguage);
101 
102 private:
103  QMap<QString, QSet<QString>*> m_translations;
104  QObject * m_parent;
105 };
106 
107 #endif
QMap
Translator::addTranslation
void addTranslation(QString word, QString fromLanguage, QString toLanguage, QString translation)
Stores the translation of word from language fromLanguage, to language toLanguage.
Definition: translator.cpp:33
QObject
QSet
QString
Translator::~Translator
~Translator()
Definition: translator.cpp:29
Translator
Keeps the translated words.
Definition: translator.h:74
Translator::Translator
Translator()
Definition: translator.cpp:20
Translator::getTranslation
QSet< QString > * getTranslation(QString word, QString fromLanguage, QString toLanguage)
Returns a QStringList with all the translations of word from fromLanguage to toLanguage.
Definition: translator.cpp:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • 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
  • 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