Bibletime – a bible study tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cplaintextexportrendering.cpp 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // C++ Implementation: cplaintextexportrendering
  3. //
  4. // Description:
  5. //
  6. //
  7. // Author: The BibleTime team <info@bibletime.info>, (C) 2004
  8. //
  9. // Copyright: See COPYING file that comes with this distribution
  10. //
  11. //
  12. //Backend includes
  13. #include "cplaintextexportrendering.h"
  14. #include "cswordkey.h"
  15. //Util
  16. #include "util/scoped_resource.h"
  17. namespace Rendering {
  18. CPlainTextExportRendering::CPlainTextExportRendering(const CPlainTextExportRendering::Settings& settings, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions)
  19. : CHTMLExportRendering(settings, displayOptions, filterOptions) {}
  20. CPlainTextExportRendering::~CPlainTextExportRendering() {}
  21. const TQString CPlainTextExportRendering::renderEntry( const KeyTreeItem& i, CSwordKey* ) {
  22. if (!m_settings.addText) {
  23. return TQString(i.key()).append("\n");
  24. }
  25. ListCSwordModuleInfo modules = i.modules();
  26. util::scoped_ptr<CSwordKey> key( CSwordKey::createInstance(modules.first()) );
  27. TQString renderedText = TQString(i.key()).append(":\n");
  28. TQString entry;
  29. // for (CSwordModuleInfo* m = modules.first(); m; m = modules.next()) {
  30. ListCSwordModuleInfo::iterator end_it = modules.end();
  31. for (ListCSwordModuleInfo::iterator it(modules.begin()); it != end_it; ++it) {
  32. key->module(*it);
  33. key->key( i.key() );
  34. //ToDo: Check this code
  35. entry.append(key->strippedText()).append("\n");
  36. renderedText.append( entry );
  37. }
  38. return renderedText;
  39. }
  40. const TQString CPlainTextExportRendering::finishText( const TQString& oldText, KeyTree& ) {
  41. return oldText;
  42. }
  43. };