Copyright 2010 Comarch S.A.
*******************************************************************************/
+/*! \file TranslationXdxf.cpp
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
+
#include "TranslationXdxf.h"
#include <QDebug>
-TranslationXdxf::TranslationXdxf() {
+TranslationXdxf::TranslationXdxf():_key(""),_dictionaryInfo("") {
+ xdxfPlugin=0;
}
-TranslationXdxf::TranslationXdxf(QString _key, QString _dictionaryInfo, XdxfPlugin *xdxfPlugin): _key(_key),_dictionaryInfo(_dictionaryInfo) {
+TranslationXdxf::TranslationXdxf(QString _key, QString _dictionaryInfo,
+ XdxfPlugin *xdxfPlugin): _key(_key),_dictionaryInfo(_dictionaryInfo) {
this->xdxfPlugin=xdxfPlugin;
+ if(xdxfPlugin)
+ _dictHash = xdxfPlugin->hash();
+ _bookmark=0;
}
QString TranslationXdxf::key() const {
return _dictionaryInfo;
}
-QString TranslationXdxf::toHtml() const {
+QString TranslationXdxf::toHtml() const {
QString result("");
-// qDebug()<<xdxfPlugin->search(_key);
- result+="<dict>" + _dictionaryInfo + "<key>" + _key + "</key>" +xdxfPlugin->search(_key) + "</dict>";
-// qDebug()<<result;
- return result;
+ if(!xdxfPlugin)
+ return result;
+ result=result + "<dict>" + "<info";
+ if(isBookmark())
+ result+= " bookmark=\"true\" ";
+ else
+ result+= " bookmark=\"false\" ";
+ result+= _dictionaryInfo + "</info>" + xdxfPlugin->search(_key) + "</dict>";
+ return result.replace("&","&");
}
void TranslationXdxf::setKey(QString _key) {