Copyright 2010 Comarch S.A.
*******************************************************************************/
+/*! \file TranslationXdxf.cpp
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
-#include "TranslationXdxf.h"
+#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 {
- return xdxfPlugin->search(_key);
+QString TranslationXdxf::toHtml() const {
+ QString 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) {