summaryrefslogtreecommitdiffstats
path: root/fbreader/src/formats/PluginCollection.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-06-07 23:30:05 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-06-07 23:30:05 +0900
commit17b259df9cb6b28779d4881b2b6c805ee2e48eea (patch)
tree5ed61937459cb7081089111b0242c01ec178f1f3 /fbreader/src/formats/PluginCollection.cpp
parent1cba8bce178eb2d6719c6f7f21e2c9352c5513a6 (diff)
downloadtde-ebook-reader-17b259df9cb6b28779d4881b2b6c805ee2e48eea.tar.gz
tde-ebook-reader-17b259df9cb6b28779d4881b2b6c805ee2e48eea.zip
Rename to tde-ebook-reader
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'fbreader/src/formats/PluginCollection.cpp')
-rw-r--r--fbreader/src/formats/PluginCollection.cpp89
1 files changed, 0 insertions, 89 deletions
diff --git a/fbreader/src/formats/PluginCollection.cpp b/fbreader/src/formats/PluginCollection.cpp
deleted file mode 100644
index d120de1..0000000
--- a/fbreader/src/formats/PluginCollection.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2004-2012 Geometer Plus <contact@geometerplus.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#include <ZLibrary.h>
-#include <ZLFile.h>
-
-#include "FormatPlugin.h"
-
-#include "../library/Book.h"
-
-#include "fb2/FB2Plugin.h"
-//#include "docbook/DocBookPlugin.h"
-#include "html/HtmlPlugin.h"
-#include "txt/TxtPlugin.h"
-#include "pdb/PdbPlugin.h"
-#include "tcr/TcrPlugin.h"
-#include "oeb/OEBPlugin.h"
-#include "chm/CHMPlugin.h"
-#include "rtf/RtfPlugin.h"
-#include "openreader/OpenReaderPlugin.h"
-#include "doc/DocPlugin.h"
-//#include "pdf/PdfPlugin.h"
-
-PluginCollection *PluginCollection::ourInstance = 0;
-
-PluginCollection &PluginCollection::Instance() {
- if (ourInstance == 0) {
- ourInstance = new PluginCollection();
- ourInstance->myPlugins.push_back(new FB2Plugin());
- //ourInstance->myPlugins.push_back(new DocBookPlugin());
- ourInstance->myPlugins.push_back(new HtmlPlugin());
- ourInstance->myPlugins.push_back(new TxtPlugin());
- ourInstance->myPlugins.push_back(new PluckerPlugin());
- ourInstance->myPlugins.push_back(new PalmDocPlugin());
- ourInstance->myPlugins.push_back(new MobipocketPlugin());
- ourInstance->myPlugins.push_back(new EReaderPlugin());
- ourInstance->myPlugins.push_back(new ZTXTPlugin());
- ourInstance->myPlugins.push_back(new TcrPlugin());
- ourInstance->myPlugins.push_back(new CHMPlugin());
- ourInstance->myPlugins.push_back(new OEBPlugin());
- ourInstance->myPlugins.push_back(new RtfPlugin());
- ourInstance->myPlugins.push_back(new OpenReaderPlugin());
- ourInstance->myPlugins.push_back(new DocPlugin());
- //ourInstance->myPlugins.push_back(new PdfPlugin());
- }
- return *ourInstance;
-}
-
-void PluginCollection::deleteInstance() {
- if (ourInstance != 0) {
- delete ourInstance;
- ourInstance = 0;
- }
-}
-
-PluginCollection::PluginCollection() :
- LanguageAutoDetectOption(ZLCategoryKey::CONFIG, "Format", "AutoDetect", true),
- DefaultLanguageOption(ZLCategoryKey::CONFIG, "Format", "DefaultLanguageS", ZLibrary::Language()),
- DefaultEncodingOption(ZLCategoryKey::CONFIG, "Format", "DefaultEncoding", "UTF-8") {
-}
-
-shared_ptr<FormatPlugin> PluginCollection::plugin(const Book &book) {
- return plugin(book.file(), false);
-}
-
-shared_ptr<FormatPlugin> PluginCollection::plugin(const ZLFile &file, bool strong) {
- for (std::vector<shared_ptr<FormatPlugin> >::const_iterator it = myPlugins.begin(); it != myPlugins.end(); ++it) {
- if ((!strong || (*it)->providesMetaInfo()) && (*it)->acceptsFile(file)) {
- return *it;
- }
- }
- return 0;
-}