Term.h

Go to the documentation of this file.
00001 #ifndef TERM_H
00002 #define TERM_H
00003 
00004 #include <iterator.h>
00005 #include <string.h>
00006 #include <qdatastream.h>
00007 #include <qmap.h>
00008 #include <qstring.h>
00009 #include "BilingualKey.h"
00010 #include "Translation.h"
00011 
00012 class Term {
00013 
00014 public:
00015 
00016     Term( int id = 0, int vocabId = 0 );
00017     Term( const Term& term );
00018     ~Term();
00019    
00020     typedef QMap<QString, Translation> TranslationMap;
00021     typedef QMap<BilingualKey, QString> CommentMap;
00022 
00023     const int getId() const;
00024     const int getVocabId() const;
00025     bool isMarkedForStudy() const;
00026     void setMarkedForStudy( bool isMarkedForStudy );
00027 
00028     void addTranslation( const Translation& translation );
00029     void removeTranslation( const QString& language );
00030     bool isTranslationExists( const QString& language ) const;
00031     Translation& getTranslation( const QString& language );
00032     Translation getTranslation( const QString& language ) const;
00033     TranslationMap::ConstIterator translationsBegin() const;
00034     TranslationMap::ConstIterator translationsEnd() const;
00035     int getTranslationCount() const;
00036    
00037     void addComment( const BilingualKey& key, const QString& comment );
00038     void removeComment( const BilingualKey& key );
00039     void removeComments( const QString& language );
00040     bool isCommentExists( const BilingualKey& key ) const;
00041     QString& getComment( const BilingualKey& key );
00042     QString getComment( const BilingualKey& key ) const;
00043     CommentMap::ConstIterator commentsBegin() const;
00044     CommentMap::ConstIterator commentsEnd() const;
00045     const QString getImagePath() const;
00046     void setImagePath( const QString& imagePath );
00047 
00048    
00049     friend QDataStream& operator<<( QDataStream& out, const Term& term );
00050     friend QDataStream& operator>>( QDataStream& in, Term& term );
00051 
00052 private:
00053     
00054     int id;
00055     int vocabId;
00056     bool markedForStudy;
00057 
00058     TranslationMap translations;
00059     CommentMap comments;
00060 
00061     QString imagePath;
00062 
00063 };
00064 
00065 QDataStream& operator<<( QDataStream& out, const Term& term );
00066 QDataStream& operator>>( QDataStream& in, Term& term );
00067 
00068 #endif

Generated on Sun Mar 1 17:30:47 2009 for toMOTko by  doxygen 1.5.6