display code afrer JsonParse
[mdictionary] / trunk / src / plugins / google / src / TranslationGoogle.cpp
1 #include "TranslationGoogle.h"
2
3 TranslationGoogle::TranslationGoogle():_key(""),_trans(""),_dictionaryInfo("") {
4     googlePlugin=0;
5 }
6
7 TranslationGoogle::TranslationGoogle(QString _key,QString _trans,
8                     QString _dictionaryInfo,GooglePlugin *googlePlugin):
9                     _key(_key),_trans(_trans),_dictionaryInfo(_dictionaryInfo) {
10     this->googlePlugin=googlePlugin;
11     if(googlePlugin)
12         _dictHash = googlePlugin->hash();
13     _bookmark=0;
14 }
15
16 QString TranslationGoogle::key() const{
17     return _key;
18 }
19
20 QString TranslationGoogle::dictionaryInfo() const {
21     return _dictionaryInfo;
22 }
23
24 QString TranslationGoogle::toHtml() const {
25     QString result("");
26     if(!googlePlugin)
27         return result;
28     result="<dict> <info path=\"\" ";
29     if(isBookmark())
30         result+="bookmark=\"true\" >";
31     else
32         result+="bookmark=\"false\" >";
33     result+=_dictionaryInfo+ "</info>"+_trans +"</dict>";
34 }
35
36 void TranslationGoogle::setKey(QString) {
37     this->_key=_key;
38 }
39
40 void TranslationGoogle::setDictionaryInfo(QString){
41     this->_dictionaryInfo=_dictionaryInfo;
42 }